Skip to content

Commit

Permalink
Update sass-spec to 2024-10-10.
Browse files Browse the repository at this point in the history
  • Loading branch information
kaj committed Oct 11, 2024
1 parent c19273f commit 2268ee1
Show file tree
Hide file tree
Showing 90 changed files with 598 additions and 601 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ project adheres to
* Improved parse error handling (PR #201, Issue #141).
Many parse errors now match the dart sass error message.
Also allow "loud" comments in more places.
* Updated sass-spec test suite to 2024-09-30.
* Updated sass-spec test suite to 2024-10-10.


## Release 0.28.10
Expand Down
9 changes: 8 additions & 1 deletion rsass/src/value/unitset.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use super::{CssDimension, Dimension, Number, Unit};
use std::fmt::{self, Display};
use std::fmt::{self, Display, Write};
use std::ops::{Div, Mul};

/// A set of units.
Expand Down Expand Up @@ -203,11 +203,18 @@ impl Display for UnitSet {
}
if let Some((u, p)) = neg.next() {
out.write_str(if short { "/" } else { " / 1" })?;
let paren = short && neg.clone().next().is_some();
if paren {
out.write_char('(')?;
}
write_one(out, u, p.abs())?;
for (u, p) in neg {
out.write_str(if short { "*" } else { " / 1" })?;
write_one(out, u, p.abs())?;
}
if paren {
out.write_char(')')?;
}
}
} else if short {
match (neg.next(), neg.next()) {
Expand Down
2 changes: 1 addition & 1 deletion rsass/tests/spec/core_functions/color/adjust/global.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ fn non_legacy() {
runner()
.ok("a {b: change-color(pink, $chroma: 0.01, $space: oklch)}\n"),
"a {\
\n b: rgb(217.7587670223, 208.8497864408, 210.1600909257);\
\n b: rgb(217.7587741846, 208.8497862891, 210.1600712342);\
\n}\n"
);
}
4 changes: 2 additions & 2 deletions rsass/tests/spec/core_functions/color/adjust/space.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ mod legacy {
runner().ok("@use \"sass:color\";\
\na {b: color.adjust(pink, $chroma: -0.01, $space: oklch)}\n"),
"a {\
\n b: rgb(249.5073873455, 194.8272088475, 204.1290090118);\
\n b: rgb(249.5073881917, 194.8272088582, 204.1290059224);\
\n}\n"
);
}
Expand Down Expand Up @@ -182,7 +182,7 @@ mod modern {
\na {b: color.adjust(lab(50% 10 -20), $chroma: 0.01, $space: oklch)}\n"
),
"a {\
\n b: lab(49.8635566117% 11.8934236813 -23.2342925555);\
\n b: lab(49.8635566292% 11.8934232635 -23.234292765);\
\n}\n"
);
}
Expand Down
2 changes: 1 addition & 1 deletion rsass/tests/spec/core_functions/color/change/global.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ fn non_legacy() {
runner()
.ok("a {b: change-color(pink, $chroma: 0.06, $space: oklch)}\n"),
"a {\
\n b: rgb(247.5333900768, 195.811523731, 204.5286989775);\
\n b: rgb(247.5333922506, 195.8115232441, 204.5286945902);\
\n}\n"
);
}
2 changes: 1 addition & 1 deletion rsass/tests/spec/core_functions/color/change/oklab.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ mod lightness {
\na {b: color.change(oklab(50% 0.2 -0.3), $lightness: 1.2)}\n"
),
"a {\
\n b: color-mix(in oklab, color(xyz 2.3267923962 1.5626810194 5.2743259015) 100%, black);\
\n b: color-mix(in oklab, color(xyz 2.3267922825 1.5626810145 5.2743251916) 100%, black);\
\n}\n"
);
}
Expand Down
2 changes: 1 addition & 1 deletion rsass/tests/spec/core_functions/color/change/oklch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ mod lightness {
\na {b: color.change(oklch(50% 0.2 30deg), $lightness: 120%)}\n"
),
"a {\
\n b: color-mix(in oklch, color(xyz 2.0602078346 1.6344742217 1.0169251403) 100%, black);\
\n b: color-mix(in oklch, color(xyz 2.0602077969 1.6344741917 1.0169248199) 100%, black);\
\n}\n"
);
}
Expand Down
4 changes: 2 additions & 2 deletions rsass/tests/spec/core_functions/color/change/space.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ mod legacy {
runner().ok("@use \"sass:color\";\
\na {b: color.change(pink, $chroma: 0.01, $space: oklch)}\n"),
"a {\
\n b: rgb(217.7587670223, 208.8497864408, 210.1600909257);\
\n b: rgb(217.7587741846, 208.8497862891, 210.1600712342);\
\n}\n"
);
}
Expand Down Expand Up @@ -300,7 +300,7 @@ mod modern {
\na {b: color.change(lab(50% 10 -20), $chroma: 0.01, $space: oklch)}\n"
),
"a {\
\n b: lab(50.5994457353% 1.499908117 -3.4111247636);\
\n b: lab(50.5994458541% 1.4999074176 -3.4111169436);\
\n}\n"
);
}
Expand Down
6 changes: 3 additions & 3 deletions rsass/tests/spec/core_functions/color/channel/oklab.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ mod foreign {
runner().ok("@use \"sass:color\";\
\na {b: color.channel(pink, \"a\", $space: oklab)}\n"),
"a {\
\n b: 0.0729803698;\
\n b: 0.072980372;\
\n}\n"
);
}
Expand All @@ -27,7 +27,7 @@ mod foreign {
runner().ok("@use \"sass:color\";\
\na {b: color.channel(pink, \"b\", $space: oklab)}\n"),
"a {\
\n b: 0.0090714488;\
\n b: 0.0090714168;\
\n}\n"
);
}
Expand All @@ -38,7 +38,7 @@ mod foreign {
runner().ok("@use \"sass:color\";\
\na {b: color.channel(pink, \"lightness\", $space: oklab)}\n"),
"a {\
\n b: 86.7738445294%;\
\n b: 86.7738450841%;\
\n}\n"
);
}
Expand Down
6 changes: 3 additions & 3 deletions rsass/tests/spec/core_functions/color/channel/oklch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ mod foreign {
runner().ok("@use \"sass:color\";\
\na {b: color.channel(pink, \"chroma\", $space: oklch)}\n"),
"a {\
\n b: 0.0735419986;\
\n b: 0.0735419968;\
\n}\n"
);
}
Expand All @@ -27,7 +27,7 @@ mod foreign {
runner().ok("@use \"sass:color\";\
\na {b: color.channel(pink, \"hue\", $space: oklch)}\n"),
"a {\
\n b: 7.0855142734deg;\
\n b: 7.0854893498deg;\
\n}\n"
);
}
Expand All @@ -38,7 +38,7 @@ mod foreign {
runner().ok("@use \"sass:color\";\
\na {b: color.channel(pink, \"lightness\", $space: oklch)}\n"),
"a {\
\n b: 86.7738445294%;\
\n b: 86.7738450841%;\
\n}\n"
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fn test() {
runner().ok("@use \"sass:color\";\
\na {b: color.channel(oklch(60% 70% 0.6turn), \"red\", rgb)}\n"),
"a {\
\n b: -143.1028884453;\
\n b: -143.1028856642;\
\n}\n"
);
}
8 changes: 4 additions & 4 deletions rsass/tests/spec/core_functions/color/complement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ mod space {
runner().ok("@use \"sass:color\";\
\na {b: color.complement(red, $space: oklch)}\n"),
"a {\
\n b: hsl(188.1998868883, 488.1808399597%, 14.588696385%);\
\n b: hsl(188.199882451, 488.180958059%, 14.5886916745%);\
\n}\n"
);
}
Expand Down Expand Up @@ -453,7 +453,7 @@ mod space {
runner().ok("@use \"sass:color\";\
\na {b: color.complement(lch(none 50% 0deg), $space: oklch)}\n"),
"a {\
\n b: lch(none 24.5072211405 180.9107983689deg);\
\n b: lch(none 24.5072331187 180.9107983391deg);\
\n}\n"
);
}
Expand All @@ -466,7 +466,7 @@ mod space {
\na {b: color.complement(color(srgb none 100 200), $space: oklch)}\n"
),
"a {\
\n b: color(srgb 156.4212689375 85.1578644836 -71.2263945029);\
\n b: color(srgb 156.4212742119 85.1578604941 -71.226404054);\
\n}\n"
);
}
Expand Down Expand Up @@ -505,7 +505,7 @@ mod space {
runner().ok("@use \"sass:color\";\
\na {b: color.complement(lab(50% 10 -20), $space: oklch)}\n"),
"a {\
\n b: lab(51.2269614349% -7.7080887555 21.8652618775);\
\n b: lab(51.226961501% -7.7080869407 21.8652805706);\
\n}\n"
);
}
Expand Down
6 changes: 3 additions & 3 deletions rsass/tests/spec/core_functions/color/grayscale.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ mod modern {
runner().ok("@use \"sass:color\";\
\na {b: color.grayscale(lch(54.3 107 40.9))}\n"),
"a {\
\n b: lch(56.854581217% 0.0000089094 270.4699001175deg);\
\n b: lch(56.8545812484% 0 none);\
\n}\n"
);
}
Expand All @@ -278,7 +278,7 @@ mod modern {
runner().ok("@use \"sass:color\";\
\na {b: color.grayscale(color(xyz-d65 0.41 0.21 0.02))}\n"),
"a {\
\n b: color(xyz 0.232829773 0.2449664044 0.2667826176);\
\n b: color(xyz 0.2328297704 0.2449664038 0.2667825607);\
\n}\n"
);
}
Expand All @@ -289,7 +289,7 @@ mod modern {
runner().ok("@use \"sass:color\";\
\na {b: color.grayscale(lab(50 -30 40))}\n"),
"a {\
\n b: lab(48.58892555% 0.0000000648 -0.0000078984);\
\n b: lab(48.5889256803% 0 0);\
\n}\n"
);
}
Expand Down
2 changes: 1 addition & 1 deletion rsass/tests/spec/core_functions/color/invert/named.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ fn test() {
\na {b: color.invert($color: turquoise, $weight: 10%, $space: oklch)}\n"
),
"a {\
\n b: rgb(72.3071640492, 202.5503954693, 158.9647820206);\
\n b: rgb(72.3071483527, 202.5503969316, 158.9647817173);\
\n}\n"
);
}
4 changes: 2 additions & 2 deletions rsass/tests/spec/core_functions/color/mix/explicit_method.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ fn non_srgb() {
"a {b: mix(lab(54.3 80.8 69.9), lch(46.3 68 134), $method: oklch)}\n"
),
"a {\
\n b: lab(50.3820989016% 23.739480318 159.7498257827);\
\n b: lab(50.3820988862% 23.7394813109 159.7498356926);\
\n}\n"
);
}
Expand Down Expand Up @@ -49,7 +49,7 @@ fn weighted() {
"a {b: mix(lab(54.3 80.8 69.9), lch(46.3 68 134), 30%, oklch)}\n"
),
"a {\
\n b: lab(48.946809662% -7.9262399011 131.5295913021);\
\n b: lab(48.9468096831% -7.9262402391 131.5295999957);\
\n}\n"
);
}
2 changes: 1 addition & 1 deletion rsass/tests/spec/core_functions/color/mix/predefined.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ fn rgb() {
"a {b: mix(color(display-p3 1 0 0), color(display-p3 0 1 0), 20%, oklch)}\n"
),
"a {\
\n b: color(display-p3 0.6684751745 0.8535262883 -0.4281891831);\
\n b: color(display-p3 0.6684751748 0.8535262895 -0.4281892011);\
\n}\n"
);
}
Expand Down
2 changes: 1 addition & 1 deletion rsass/tests/spec/core_functions/color/same.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ mod test_true {
\na {\
\n b: color.same(\
\n color(rec2020 0.5 none 0.2),\
\n oklab(44.668866707461% 0.236673642675 0.018728349677)\
\n oklab(44.66886691637825% 0.2366736512579 0.01872833430856)\
\n );\
\n}\n"),
"a {\
Expand Down
2 changes: 1 addition & 1 deletion rsass/tests/spec/core_functions/color/scale/global.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ fn non_legacy() {
runner()
.ok("a {b: scale-color(pink, $chroma: -10%, $space: oklch)}\n"),
"a {\
\n b: rgb(250.9720040643, 194.0861924561, 203.8303793932);\
\n b: rgb(250.9720047847, 194.0861924112, 203.8303770998);\
\n}\n"
);
}
2 changes: 1 addition & 1 deletion rsass/tests/spec/core_functions/color/scale/space.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ mod modern {
\na {b: color.scale(lab(50% 10 -20), $chroma: 20%, $space: oklch)}\n"
),
"a {\
\n b: lab(48.9487508713% 24.2085150873 -41.732226413);\
\n b: lab(48.9487510552% 24.2085116419 -41.7322265307);\
\n}\n"
);
}
Expand Down
2 changes: 1 addition & 1 deletion rsass/tests/spec/core_functions/color/to_gamut/a98_rgb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ mod local_minde {
\na {b: color.to-gamut(color(a98-rgb 1.1 0.5 0.8), $method: local-minde)}\n"
),
"a {\
\n b: color(a98-rgb 1 0.5850609654 0.8001989835);\
\n b: color(a98-rgb 1 0.5850609644 0.8001989651);\
\n}\n"
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ mod local_minde {
\na {b: color.to-gamut(color(display-p3 1.5 0.5 0.8), $method: local-minde)}\n"
),
"a {\
\n b: color(display-p3 1 0.9080382844 0.9302909848);\
\n b: color(display-p3 1 0.9080382834 0.9302909049);\
\n}\n"
);
}
Expand Down
2 changes: 1 addition & 1 deletion rsass/tests/spec/core_functions/color/to_gamut/hsl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ mod local_minde {
\n );\
\n}\n"),
"a {\
\n b: hsl(73.5850781672, 100%, 67.4750294398%);\
\n b: hsl(73.5850769516, 100%, 67.4750278515%);\
\n}\n"
);
}
Expand Down
2 changes: 1 addition & 1 deletion rsass/tests/spec/core_functions/color/to_gamut/hwb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ mod local_minde {
\na {b: color.to-gamut(hwb(70deg -5% -5%), $method: local-minde)}\n"
),
"a {\
\n b: hsl(75.7157487534, 100%, 75.8982992248%);\
\n b: hsl(75.715745279, 100%, 75.8982967878%);\
\n}\n"
);
}
Expand Down
4 changes: 2 additions & 2 deletions rsass/tests/spec/core_functions/color/to_gamut/oklab.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ fn clip() {
\n}\n"
),
"a {\
\n b: color-mix(in oklab, color(xyz 593644537356868864 -153762261215017152 3418717280664545280) 100%, black);\
\n b: color-mix(in oklab, color(xyz 593644542057412224 -153762246556647904 3418717351297831936) 100%, black);\
\n}\n"
);
}
Expand All @@ -37,7 +37,7 @@ fn local_minde() {
\n}\n"
),
"a {\
\n b: color-mix(in oklab, color(xyz 593644537356868864 -153762261215017152 3418717280664545280) 100%, black);\
\n b: color-mix(in oklab, color(xyz 593644542057412224 -153762246556647904 3418717351297831936) 100%, black);\
\n}\n"
);
}
4 changes: 2 additions & 2 deletions rsass/tests/spec/core_functions/color/to_gamut/oklch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ fn clip() {
\n}\n"
),
"a {\
\n b: color-mix(in oklch, color(xyz 5.2395754107 2.9713210909 -1.434870419) 100%, black);\
\n b: color-mix(in oklch, color(xyz 5.2395754279 2.9713210325 -1.434870444) 100%, black);\
\n}\n"
);
}
Expand All @@ -37,7 +37,7 @@ fn local_minde() {
\n}\n"
),
"a {\
\n b: color-mix(in oklch, color(xyz 5.2395754107 2.9713210909 -1.434870419) 100%, black);\
\n b: color-mix(in oklch, color(xyz 5.2395754279 2.9713210325 -1.434870444) 100%, black);\
\n}\n"
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ mod local_minde {
\na {b: color.to-gamut(color(prophoto-rgb 1.1 0.5 0.8), $method: local-minde)}\n"
),
"a {\
\n b: color(prophoto-rgb 1 0.5625312196 0.7939519528);\
\n b: color(prophoto-rgb 1 0.5625312191 0.7939519353);\
\n}\n"
);
}
Expand Down
2 changes: 1 addition & 1 deletion rsass/tests/spec/core_functions/color/to_gamut/rec2020.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ mod local_minde {
\na {b: color.to-gamut(color(rec2020 1.1 0.5 0.8), $method: local-minde)}\n"
),
"a {\
\n b: color(rec2020 1 0.5720949845 0.7959438083);\
\n b: color(rec2020 1 0.572094984 0.7959437908);\
\n}\n"
);
}
Expand Down
2 changes: 1 addition & 1 deletion rsass/tests/spec/core_functions/color/to_gamut/rgb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ mod local_minde {
\na {b: color.to-gamut(color.change(#abcdef, $red: 300), $method: local-minde)}\n"
),
"a {\
\n b: rgb(255, 222.6637652053, 237.9231180222);\
\n b: rgb(255, 222.6637650714, 237.9231048356);\
\n}\n"
);
}
Expand Down
Loading

0 comments on commit 2268ee1

Please sign in to comment.