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

Switch to dart-sass #31728

Merged
merged 4 commits into from
Oct 29, 2020
Merged

Switch to dart-sass #31728

merged 4 commits into from
Oct 29, 2020

Conversation

XhmikosR
Copy link
Member

@XhmikosR XhmikosR commented Sep 23, 2020

This is something we've been discussing internally for some time now.

Things to note:

  1. dart-sass's precision is hardcoded to 10; I dropped it down to 6 for the minified files, but we might want to reconsider this and just go with the default? I need to check how much it adds, though
  2. dart-sass orders grouped selectors differently; I have not found a way to work around this and perhaps we should ask upstream. Do note that the minified files keep the old behavior since clean-css sorts the grouped selectors alphabetically
  3. dart-sass converts escaped UTF-8 characters which in turn means we need a @charset "UTF-8";. Not the end of the world, but it is something to note. Also, note that there's a --no-charset flag, but then this could be dangerous since we do have Unicode characters, so we better not use it
  4. dart-sass removes quotes from attribute selectors; not a big deal since they are already removed in the minified files
  5. dart-sass adds leading zeros; again, not a big deal since they are already removed in the minified files
  6. other minor output differences like whitespaces

@twbs/css-review for discussion


  1. Check the bundlewatch size differences
  2. Live preview: https://deploy-preview-31728--twbs-bootstrap.netlify.app/
  3. Test that sourcemaps work properly; I see some changes in soucemaps' sources property

Refs #29853

@XhmikosR XhmikosR force-pushed the main-xmr-dart-sass branch 2 times, most recently from e3fae53 to 34d1e1b Compare September 23, 2020 13:12
Copy link
Member

@mdo mdo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pre-approving for when this comes up for review.

node-sass is now deprecated
This is so that we get the same behavior for our minified files since dart-sass doesn't have a precision option and defaults to 10.
@XhmikosR XhmikosR force-pushed the main-xmr-dart-sass branch 2 times, most recently from 98cd0ee to 4a75759 Compare October 29, 2020 07:36
@XhmikosR XhmikosR marked this pull request as ready for review October 29, 2020 07:36
@XhmikosR
Copy link
Member Author

Let's land it as is and we can always revisit the clean-css options later. BTW we could also ask upstream for the output discrepancies and if they can do something about it, like with sorting grouped selectors.

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

Successfully merging this pull request may close these issues.

3 participants