bulma
bulma copied to clipboard
Move `sass` to `devDependencies`
This is about Bulma. It is an optimization/enhancement request.
Overview of the problem
This is about the Bulma CSS framework, more precisely about the published NPM package.
I'm using Bulma version 1.0.0.
This issue doesn't seem to be a duplicate.
Description
TL;DR Installing sass
shouldn't be mandatory for developers using only CSS files.
- Bulma v1 is a full rewrite of the framework using Dart Sass.
-
sass
has been added as a dependency of the NPM package (to promote its usage with Bulma v1?), increasing dramatically the package size. - Compiled CSS is provided in the NPM package along Sass files, so Sass doesn't seem to be required in order to use Bulma. Even some customization can be done with CSS only (using CSS variables), Sass seems to be required only for advanced usage/customization.
-
sass
dependency could be moved todevDependencies
in order to reduce the package installation size, developers can still installsass
when they need to use Bulma Sass files.
Steps to Reproduce
Install [email protected]
NPM package (to use only CSS files).
Expected behavior
sass
dependency installation shouldn't be forced when we only want to use Bulma CSS files.
Actual behavior
sass
is a dependency of [email protected]
and is installed automatically by NPM, even if uneeded.
P.S. Thanks for your work on the v1, it's great to see that this project is still alive 🎉
I understand your argument regarding the use of sass as only a dev dependency, however, why would you install Bulma in the first place, if all you want is the finalized CSS? You could simply use the CSS from a CDN, or just use a local copy of it for your build.
- "use the CSS from a CDN" → not everyone wants their application to rely on public CDNs, sometimes we need to build our own CSS files (that embed the application stylesheet together with dependencies like Bulma) using toolchains like Vite, Webpack, etc. especially in enterprise internal applications.
- "use a local copy of it" → storing dependency files together with the application source code in a repository is most of the time a bad practice, that's why we tend to rely on package managers to fetch required dependencies before building the application, even for compiled CSS files from a library.
Using Sass or compiled CSS files shouldn't impact the global logic of our toolchain (= how we install dependencies, how we bundle our application, etc.), even if, obviously, some more tools and configurations may need to be added in the middle of it, depending on the choice we make.
From my point of view, that's the entire point of having compiled CSS files published in the NPM package together with Sass source files: to allow us to include Bulma in our application and in our development & build process (without changing its global logic), whether we're working with Sass or vanilla CSS (the later being a totally valid choice, not everyone will need Sass in order to use Bulma). And if we have this choice, Sass dependency shouldn't be enforced.
Nothing exceptional here in my opinion, this is how Bulma was working before (node-sass
is a dev dependency of v0.9.4), that's how Bootstrap works (sass
is a dev dependency), etc. unless I'm missing a totally valid reason for this change?