Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move sass to devDependencies #3737

Closed
GaelGirodon opened this issue Mar 22, 2024 · 2 comments
Closed

Move sass to devDependencies #3737

GaelGirodon opened this issue Mar 22, 2024 · 2 comments

Comments

@GaelGirodon
Copy link

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 to devDependencies in order to reduce the package installation size, developers can still install sass when they need to use Bulma Sass files.

Steps to Reproduce

Install bulma@1.0.0 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 bulma@1.0.0 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 🎉

@suterma
Copy link

suterma commented Mar 23, 2024

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.

@GaelGirodon
Copy link
Author

GaelGirodon commented Mar 23, 2024

  • "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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants