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

rewrite parsing, evaluation, and serialization #67

Merged
merged 98 commits into from
Dec 26, 2022
Merged

rewrite parsing, evaluation, and serialization #67

merged 98 commits into from
Dec 26, 2022

Conversation

connorskees
Copy link
Owner

@connorskees connorskees commented Dec 23, 2022

Rewrite effectively the entire compiler in order to implement all missing features. This includes

  • plain css imports
  • SASS/the indented syntax
  • custom properties
  • feature-complete @supports conditions
  • @at-root conditions
  • @import conditions and queries
  • the builtin function keywords
  • more robust support for NaN, Infinity, and -Infinity
  • @forward
  • media query merging
  • feature complete support for complex units
  • fuzzy number operations
  • interpolated functions
  • named arguments in varargs/splat
  • a number of other minor features

This PR also implements new features that dart-sass has added through the course of this year, including

  • the calculation value type and simplification. that is, something like calc(1 + 1) will now be simplified to the literal number 2
  • builtin math module variables $epsilon, $max-safe-integer, $min-safe-integer, $max-number, $min-number
  • builtin meta module functions meta.calc-name and meta.calc-args
  • builtin list module function list.slash
  • media queries level 4

Miscellaneous changes and improvements:

  • remove dependency on num-rational, num-traits, num-bigint, and beef
  • update spec test submodule
  • bootstrap now compiles 3-4x faster on my machine

As a result of this PR, we are now failing 886/6905 spec tests. ~20% of these failures come from @use, @forward, and the module system. ~50% of these failures come from the builtin functions. It appears a large number of the current failures are either purely cosmetic (e.g. the whitespace of inline /* */ comments) or related to error messages.

Work remaining on this PR before merging:

  • add back support for meta.load-css
  • resolve regressions with the hwb color space
  • resolve compressed output regressions
  • resolve clippy and other lints
  • make error spans more accurate in certain cases

Closes #52
Closes #31

@connorskees connorskees marked this pull request as ready for review December 24, 2022 16:43
@connorskees connorskees merged commit ffaee04 into master Dec 26, 2022
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.

Importing .css files with @use Reducing size of Color
1 participant