Giter Club home page Giter Club logo

bulvar's Introduction

๐Ÿ›ฃ Bulvar

Bulvar logo


Bulvar it is Bulma and Buefy on steroids using CSS variables


npm package npm package build status


  • โšก๏ธ Runtime variables change
  • ๐Ÿ› ๏ธ Rich Features - includes Bulma, Buefy CSS and Bulma extensions
  • ๐Ÿ’ก Root and Local variables scoping
  • ๐Ÿ“ฆ CSS minifier with structural optimizations

๐Ÿ’™ SPECIAL SPONSOR

๐Ÿš€ QUICK INSTALL

Bulvar is constantly in development! Try it out now:

For Bulma only

Install using PNPM

pnpm add @bulvar/bulma

Install using NPM

npm install @bulvar/bulma

Install using Yarn

yarn add @bulvar/bulma

For Buefy

Install using NPM.

NOTE: If you install Buefy, Bulma is installed as well as dependency.

Install using PNPM

pnpm add @bulvar/buefy

Install using NPM

npm install @bulvar/buefy

Install using Yarn

yarn add @bulvar/buefy

๐Ÿ”ฉ IMPORT

Build includes (for both Bulma & Buefy)

  • Standard CSS file bulma.css or buefy.css
  • Standard minified CSS file bulma.min.css and buefy.min.css
  • RTL CSS file bulma-rtl.css and buefy-rtl.css
  • Minified RTL CSS file bulma-rtl.min.css and buefy-rtl.min.css

After installation, you can import any from above CSS file into your project using this snippet:

@use 'sass:meta';

@include meta.load-css('@bulvar/bulma/css/bulma.css');

or

@use 'sass:meta';

@include meta.load-css('@bulvar/bulma/css/buefy.css');

๐Ÿค” WHY Bulvar?

Bulvar is a monorepo with all Bulma-derived packages rewritten with CSS Variables and new @use and @forward features.

Currently Includes :

๐Ÿงช WHAT HAS BEEN CHANGED

  • CSS Vars compatible! Woohoo!
  • Real modularity! Drop deprecated @import. Use @foward and @use (read more HERE)
  • Always using latest Dart(โš ๏ธ make sure you are using Dart version of SASS in your project too) Sass instead of deprecated node-sass
  • Added namespacing. No need to worry about variables overwrite
  • Added flag to be able to exports SASS variables using export for JS
  • Added secondary color
  • Added flexbox gap helper classes
  • Added color-scheme support
  • Added cross-browser support for placeholder opacity
  • Custom divide() function replaced with SASS math.div()
  • Custom power() function replaced with SASS math.pow()
  • Added link pseudo selectors

๐Ÿš€ CUSTOMIZATION TIPS

Using @use instead of @import itself makes compiling faster.

If you want to save some space you could overwrite helper lists with empty lists during the import like:

@use "path/to/bulma" with (
  $flex-direction-values: (),
  $flex-wrap-values: (),
  $justify-content-values: (),
  $align-content-values: (),
  $align-items-values: (),
  $align-self-values: (),
  $flex-operators:  (),
  $flex-gap-values: (),
)

bulma.sass holds all !default variables, hence if you need all Bulma elements, pass all your variables directly there

@use 'bulma.sass' with (
  $radius-rounded: 99px,
  $button-color: red,
  $button-family: 'Helvetica',
)
@use 'themes/light.sass'

NOTE: You'll have to import light.sass or dark.sass from themes for the CSS Variables Bulma functioning properly.

๐Ÿงฉ MODULARITY

Now to import only needed elements instead of entire Bulma became much easy due to "real" modularity.

Thanks to @use and @forward, no need to import top level (global) variables in order to import just few needed elements, just import whatever you need.

For example if you need only buttons.sass in your project, and need to overwrite few variables:

// In order to customize global variables
// Not required, unless you want to modify global variables from utils
@use 'themes/light.sass' with ($radius-rounded: 99px)

// Customize local variables in the module with !default
@use 'buttons.sass' with (
  $button-color: red,
  $button-family: 'Helvetica',
)

Note that in the example above, when using theme/light you can modify all global variables.

โš™๏ธ HELPERS

There were bunch of improvements in helpers utility classes

  • is-radiusless is extended
  • Added is-radiusless-top
  • Added is-radiusless-bottom
  • Added is-radiusless-{top-left, top-right, bottom-right, bottom-left}
  • Added is-borderless is extended
  • Added is-borderless-top
  • Added is-borderless-bottom
  • Added is-{top-left, top-right, bottom-right, bottom-left}

โš ๏ธ CSS ONLY

IMPORTANT: This packages is CSS ONLY!

If you need Buefy Vue components, but you wan to use CSS variable in your project, you'll have to install both buefy and @bulvar/buefy

NOTE: If you need Buefy styles, do not import Bulma, it already includes it in correct order.

โš ๏ธ CSS VARIABLES DRAWBACKS

CSS Variables named after SASS Bulma variables

Each main color in $colors and shade in $shades has corresponding

--#{$name}-h - stands for color hue --#{$name}-s - stands for color saturation --#{$name}-l - stands for color lightness --#{$name}-a - stands for color alpha

Modify Opacity

I.e. to add opacity to the primary color, you'll have to

--primary-a: 0.5;

or

--primary-a: calc(var(--primary-a) - var(--some-other-value));

Modify Lightness and Darkness

Same applies for lightness. Instead of using sass lightness function (which you cannot with css variables), just modify --primary-l value.

Tome make color lighter increase (add) value to the --primary-l, to make it darker, decrease (subtract) accordingly.

Modify Invert Colors

By default, if color's luminance less then 0.55, then invert color will be rgba(#000, 0.7) otherwise white.

You can change those colors now by overwriting $invert-dark-colors & $invert-light-colors

Proper color change in runtime

Best way to change main colors (primary, info etc.) is to change their coresponding --#{$name}-h (hue), --#{$name}-s (saturation), --#{$name}-l (lightness) and --#{$name}-a (alpha aka opacity)

Scoping

One of the SASS variable $at-root indicates where CSS variable going to be registered.

By default it sets to true, and results into

:root {
	--footer-background-color: SOME_COLOR;
	--footer-padding: SOME_PADDING;
}

In case you need more strict scoping, you can set it to false, wich, in case of footer component, will trnasform into:

.footer {
	--footer-background-color: SOME_COLOR;
	--footer-padding: SOME_PADDING;
}

๐Ÿ›ณ EXPORTS

If you are using style modules SASS variable in you JS files, you can set $exports to true, which will generate

:export {
  variableName: VALUE
}

Note that all SASS variable will be camelcased.

๐Ÿ“ข VERSIONING

Version will follow v0.Y.Z, where:

  • Y: Major (breaking changes)
  • Z: Minor or patch

Starting from version 1.Y.Z we going to deprecate @import in favour of @use and @forward

๐Ÿ’ป BROWSER SUPPORT

Bulma & Buefy uses autoprefixer to make (most) Flexbox features compatible with earlier browser versions.

According to Can I use, Bulma is compatible with recent versions of:

  • Chrome
  • Edge
  • Firefox
  • Opera
  • Safari

Internet Explorer is not supported due to the use of css variables.

Although you can use polyfill.

๐Ÿ“– COPYRIGHT AND LICENSE Github

Code copyright 2022 Daniil Chumachenko. Code released under the MIT license.

bulvar's People

Contributors

daniil4udo avatar dpschen avatar renovate-bot avatar renovate[bot] avatar rikkit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

bulvar's Issues

How to import functions.sass to create custom colors?

This is about Bulvar.

Overview of the problem

I am trying to add custom colours and can't find a way to import functions.sass in order to access findColorInvert function.

Description

When trying this code:

@charset "utf-8";

@use "../../node_modules/@bulvar/bulma/sass/utilities/functions.sass" as fn;

$antidote-blue: #00435C;
$antidote-blue-light: fn.findColorInvert($antidote-blue);

// @use "../../node_modules/@bulvar/bulma/sass/helpers/color.sass";
@use "../../node_modules/@bulvar/bulma/bulma.sass" with (
    $primary: #E56F56,
    $success: #66C87D,
    $custom-colors: ("antidote-blue": ($antidote-blue, $antidote-blue-light))
);

I get this error:

File: /Users/mmangel/Documents/Workspaces/GitHub/antidote-ai/antidote-apps/node_modules/@bulvar/bulma/sass/utilities/derived-variables.sass
  Error: This module was already loaded, so it can't be configured using "with".
     โ”Œโ”€โ”€> ../node_modules/@bulvar/bulma/sass/utilities/derived-variables.sass
  3  โ”‚   @forward "initial-variables"
     โ”‚   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ new load
     โ•ต
     โ”Œโ”€โ”€> ../node_modules/@bulvar/bulma/sass/utilities/functions.sass
  8  โ”‚   @use 'initial-variables' as vars
     โ”‚   โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” original load
     โ•ต
     โ”Œโ”€โ”€> src/index.scss
  9  โ”‚ โ”Œ @use "../../node_modules/@bulvar/bulma/bulma.sass" with (
  10 โ”‚ โ”‚     $primary: #E56F56,
  11 โ”‚ โ”‚     $success: #66C87D,
  12 โ”‚ โ”‚     $custom-colors: ("antidote-blue": ($antidote-blue, $antidote-blue-light))
  13 โ”‚ โ”‚ );
     โ”‚ โ””โ”€^ configuration
     โ•ต
    ../node_modules/@bulvar/bulma/sass/utilities/derived-variables.sass 3:1  @forward
    ../node_modules/@bulvar/bulma/bulma.sass 6:1                             @use
    src/index.scss 9:1                                                       root stylesheet

I tried to use @forward but got some errors too.

How would one import the file functions.scss in order to use the defined function in its code?

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/npm-publish.yml
  • actions/checkout v3
  • actions/setup-node v3
  • actions/checkout v3
  • actions/setup-node v3
  • actions/checkout v3
  • actions/setup-node v3
npm
package.json
  • autoprefixer ^10.4.13
  • commitizen ^4.2.5
  • cross-env ^7.0.3
  • csso-cli ^4.0.1
  • cz-conventional-changelog ^3.3.0
  • cz-emoji 1.3.1
  • find-unused-sass-variables ^4.0.4
  • husky ^8.0.2
  • lerna ^6.0.3
  • lint-staged ^13.0.3
  • markdownlint-cli ^0.32.2
  • npm-run-all ^4.1.5
  • postcss ^8.4.19
  • postcss-cli ^10.0.0
  • postcss-sass ^0.5.0
  • postcss-scss ^4.0.5
  • prettier ^2.7.1
  • rimraf ^3.0.2
  • rtlcss ^4.0.0
  • sass ^1.56.1
  • stylelint ^14.15.0
  • stylelint-config-idiomatic-order ^9.0.0
  • stylelint-config-prettier ^9.0.4
  • stylelint-config-standard-scss ^6.1.0
  • sugarss ^4.0.1
packages/buefy/package.json
packages/bulma/package.json
travis
.travis.yml
  • node 14

  • Check this box to trigger a request for Renovate to run again on this repository

Delete styles not getting included

This is about Bulma | Bulma | Extentions | the Docs.

This is, potentially, a bug in bulma. It might also be me doing something wrong.

Overview of the problem

This is about the Bulma CSS framework

I'm using Bulma version [0.11.13]

Description

I am using bulma via @import instead of @use because I was using it like that with regular Bulma. That might be related.

The issue is that the .delete class doesn't include the ::before or ::after of the .delete class for some reason. I can see it is in the sass file as a mixin, but it is not in the css output. The rest of that mixin is, just not the ::before, :;after. I also believe the .is-small and such classes of the .delete are not included.

Steps to Reproduce

This is how I import the Bulma, everything else seems to work fine with it:

// Bulma Import
@import "node_modules/@bulvar/bulma/sass/utilities/initial-variables";
$navbar-breakpoint: $widescreen;
@import 'node_modules/@bulvar/bulma/bulma';

I use the delete inside notifications:

<div class="notification is-danger">
  <button class="delete"></button>
    <p>
      Content...
    </p>
</div>

Expected behavior

The delete is rendered properly. See screenshot below using regular Bulma
image

Actual behavior

The delete isn't rendered properly. See screenshot below using @bulvar/Bulma
image

0.11.0 regression/bug when providing a map to $custom-colors

This is about Bulma.

This is a bug/regression on 0.11.0.

Overview of the problem

The following code:

$antidote-blue-primary: #05435C;
$antidote-blue-primary-invert: #fff;

@use "../../node_modules/@bulvar/bulma/bulma.sass" with (
    $custom-colors: (
        "antidote-blue-primary": ($antidote-blue-primary, $antidote-blue-primary-invert),
    )
);

gives this error:

  Plugin: vite:css
  File: C:\Users\mange\Documents\Workspaces\Github\Antidote-AI\armor-project\node_modules\@bulvar\bulma\sass\utilities\mixins.sass
  Error: $string: #fff is not a string.
      โ•ท
  366 โ”‚   --#{$base}-invert-bis: #{if(string.index($color-invert, 'light'), var(--invert-light-color-bis), var(--invert-dark-color-bis))}
      โ”‚                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      โ•ต
    ..\node_modules\@bulvar\bulma\sass\utilities\mixins.sass 366:31  registerCSSVarColor()
    ..\node_modules\@bulvar\bulma\sass\utilities\mixins.sass 383:5   registerCSSVarColors()
    ..\node_modules\@bulvar\bulma\themes\light.sass 112:2            @forward
    ..\node_modules\@bulvar\bulma\bulma.sass 7:1                     @use
    src\index.scss 11:1                                              root stylesheet

The same code is working with version 0.10.2 of @bulvar/bulma.

Expected behavior

It should compiles

Actual behavior

Doesn't compile

RGB colors in derived-variables.sass are invalid caused by missing bulmaToRGB function

This is about Bulma.
It's a bug in the library.

Overview of the problem

This is about the Bulma CSS framework

This is a Sass issue: I'm using version 1.47.0
I am sure this issue is not a duplicate?

Description

All variables in bulma/sass/utilites/derived-variables.sass that use bulmaToRGB are not set correctly because the bulmaToRGB function is missing (not imported) from the bulma/shared/functions.sass file.
The bulmaToRGB is only defined in the bulma/sass/utilites/functions.sass.

Possible solution would be to import shared/functions.sass into utilities/functions.sass or just to duplicate the bulmaToRGB function from bulma/shared/functions.sass into utilities/functions.sass.

Steps to Reproduce

As you can see in this jsbin, the bulma delete button is invisible because its background-color is missing caused by missing bulmaToRGB sass function.

https://jsbin.com/lekikor/1/edit?html,output

Expected behavior

The RGB colors in derived-variables.sass should be transformed to their actual values.

Actual behavior

The RGB colors in derived-variables.sass have invalid values like background-color: rgba(var(--scheme-invert-rgb, bulmaToRGB(#0a0a0a)), 0.2);

Some default variable values missing

This is about Bulma.

Overview of the problem

This is about the Bulma CSS framework
I'm using Bulma version 0.10.2

Description

There seem to be missing default values in 0.10.2. For example button with is-danger has the wrong text color. It's supposed to be white, but it's black.

It was working as expected in 0.9.7.

Steps to Reproduce

<!DOCTYPE html>
<html>
  <head>
    <link rel="stylesheet" href="bulma.css" />
  </head>
  <body>
    <button class="button is-danger">Hello</button>
  </body>
</html>

Expected behavior

Expected the button to have white text color.

Actual behavior

Button text color is black.

Use Sass modules (@use instead of @import)

This is about Bulma. Is it a feature.

Overview of the problem

This is about the Bulma CSS framework
I'm using Bulma version 0.9.3
I am sure this issue is not a duplicate?

Description

Using the @use syntax in the individual sass files for the import of variables and mixins would allow to import only the modules in a page view that are currently used.

E.g. replace the first line in packages/bulma/sass/components/card.sass:

// replace this
@import "../utilities/mixins"

with this:
@use "../utilities/mixins" as *

=> Better bundle splitting.


If the benefits of this are still unclear I can also write a longer version of this issue and what kind of specific problem it would solve.

I just didn't want to waste any time if changes like this are not wanted =)

Regardless of the benefits: Sass officially discourages the use of @import.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.