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

Use imports everywhere #3176

Merged
merged 10 commits into from
Nov 7, 2020
Merged

Use imports everywhere #3176

merged 10 commits into from
Nov 7, 2020

Conversation

jgthms
Copy link
Owner

@jgthms jgthms commented Nov 7, 2020

This is an improvement.

Proposed solution

Instead of relying on the ancestor Sass file to import dependencies, each component file imports its own dependencies.
Fixes #2797

Tradeoffs

No real tradeoff, unless some old Sass version does not support importing the same file multiple times.

Testing Done

Tested with latest versions of:

  • Dart Sass npm sass@1.29.0
  • Node Sass (LibSass) npm node-sass@5.0.0
  • even Ruby Sass sass-3.7.4.gem

Changelog updated?

Yes.

@jgthms jgthms merged commit 0a1ef3c into master Nov 7, 2020
@jgthms jgthms deleted the imports-everywhere branch November 7, 2020 18:15
@lionzeye
Copy link
Contributor

There is a lot of duplicate css in the output file after this was merged. Selector
.image.is-1by3 .has-ratio, .modal, .modal-background, .is-overlay, .hero-video
appears in the output file 40 times now. See the output in https://github.com/jgthms/bulma/blob/38aa8b9299cb70f165783858122bcc7f6e3d6d35/docs/css/bulma-docs.css for example

@jgthms
Copy link
Owner Author

jgthms commented Nov 25, 2020

You're right, I've noticed that too. It's how @extend rules are populated. I thought cssnano might catch it and optimize it, but it didn't. I will create a new extends.sass file in the /utilities folder which will only be imported once.

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 this pull request may close these issues.

Unable to fully use Bulma Sass with the new Sass modular system (@use)
2 participants