From 45ad97e0bed7eab37c3ef611eddb523489810855 Mon Sep 17 00:00:00 2001 From: connorskees Date: Wed, 25 Jan 2023 03:35:46 +0000 Subject: [PATCH] fix typo in docs --- .gitignore | 6 +++++- CHANGELOG.md | 12 ++++++++---- Cargo.toml | 12 ++++++------ crates/compiler/src/lib.rs | 2 +- crates/compiler/src/serializer.rs | 6 ++++++ crates/lib/src/lib.rs | 2 +- crates/lib/tests/media.rs | 2 +- crates/lib/tests/number.rs | 15 +++++++++++++++ 8 files changed, 43 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index 9b8d155..12f2044 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ *.s[ac]ss *.css -*.exe !input.scss !crates/static/_index.scss @@ -11,6 +10,8 @@ coverage pkg flamegraph.svg perf* +dhat* +*.tar.gz # editor specific .idea @@ -20,6 +21,7 @@ perf* *.py *.sh *.cmd +*.exe # common Sass frameworks that may wish to live alongside grass for testing susy @@ -33,3 +35,5 @@ sassline true dart-sass sass-fairy +duomo +ibm-cloud-cognitive diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d38b97..145d018 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,8 @@ - error when `@extend` is used across `@media` boundaries - more robust support for NaN in builtin functions +- support unquoted imports in the indented/SASS syntax + --> # 0.12.2 (unreleased) @@ -11,10 +13,12 @@ - slash lists can be compared using `==` - resolve rounding errors for extremely large numbers - potentially breaking bug fixes in certain color functions - - `color.hwb(..)` no longer allows whiteness or blackness values outside the bounds 0% to 100% - - `scale-color(..)` no longer allows the `$hue` argument. previously it was ignored - - `scale-color(..)`, `change-color(..)`, and `adjust-color(..)` no longer allow invalid combinations of arguments or unknown named arguments - - many functions that accept hues now convert other angle units (`rad`, `grad`, `turn`) to `deg`. previously the unit was ignored + - `color.hwb(..)` no longer allows whiteness or blackness values outside the bounds 0% to 100% + - `scale-color(..)` no longer allows the `$hue` argument. previously it was ignored + - `scale-color(..)`, `change-color(..)`, and `adjust-color(..)` no longer allow invalid combinations of arguments or unknown named arguments + - many functions that accept hues now convert other angle units (`rad`, `grad`, `turn`) to `deg`. previously the unit was ignored +- improve compressed output of selectors containing newlines and `rgba(..)` colors +- improve resolution of imports containing explicit file extensions, e.g. `@import "foo.scss"` # 0.12.1 diff --git a/Cargo.toml b/Cargo.toml index 9c690d1..2598e47 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,15 +6,15 @@ members = [ ] [profile.release] -debug = true +debug = 1 panic = "abort" lto = true codegen-units = 1 [profile.small] inherits = 'release' -opt-level = 'z' # Optimize for size -lto = true # Enable link-time optimization -codegen-units = 1 # Reduce number of codegen units to increase optimizations -panic = 'abort' # Abort on panic -strip = true # Strip symbols from binary* +opt-level = 'z' +lto = true +codegen-units = 1 +panic = 'abort' +strip = true diff --git a/crates/compiler/src/lib.rs b/crates/compiler/src/lib.rs index 09e3091..be352ad 100644 --- a/crates/compiler/src/lib.rs +++ b/crates/compiler/src/lib.rs @@ -1,7 +1,7 @@ /*! This crate provides functionality for compiling [Sass](https://sass-lang.com/) to CSS. -This crate targets compatability with the reference implementation in Dart. If +This crate targets compatibility with the reference implementation in Dart. If upgrading from the [now deprecated](https://sass-lang.com/blog/libsass-is-deprecated) `libsass`, one may have to modify their stylesheets. These changes will not differ from those necessary to upgrade to `dart-sass`, and in general such changes should diff --git a/crates/compiler/src/serializer.rs b/crates/compiler/src/serializer.rs index ae10f38..1ad1183 100644 --- a/crates/compiler/src/serializer.rs +++ b/crates/compiler/src/serializer.rs @@ -597,6 +597,12 @@ impl<'a> Serializer<'a> { if formatted.ends_with(".0") { buffer.push_str(formatted.trim_end_matches('0').trim_end_matches('.')); + } else if n.is_infinite() { + buffer.push_str( + format!("{:.10}", num) + .trim_end_matches('0') + .trim_end_matches('.'), + ); } else { buffer.push_str(&formatted); } diff --git a/crates/lib/src/lib.rs b/crates/lib/src/lib.rs index c3a42f9..2bd486e 100644 --- a/crates/lib/src/lib.rs +++ b/crates/lib/src/lib.rs @@ -1,7 +1,7 @@ /*! This crate provides functionality for compiling [Sass](https://sass-lang.com/) to CSS. -This crate targets compatability with the reference implementation in Dart. If +This crate targets compatibility with the reference implementation in Dart. If upgrading from the [now deprecated](https://sass-lang.com/blog/libsass-is-deprecated) `libsass`, one may have to modify their stylesheets. These changes will not differ from those necessary to upgrade to `dart-sass`, and in general such changes should diff --git a/crates/lib/tests/media.rs b/crates/lib/tests/media.rs index 7f2b3f6..5fb6e51 100644 --- a/crates/lib/tests/media.rs +++ b/crates/lib/tests/media.rs @@ -559,7 +559,7 @@ test!( font-weight: 200; } }", - "@media (url) {\n a {\n color: red;\n }\n}\n" + "@media (min-width: 1px) {\n .first {\n font-weight: 100;\n }\n .second {\n font-weight: 200;\n }\n}\n" ); test!( escaped_nullbyte_in_query, diff --git a/crates/lib/tests/number.rs b/crates/lib/tests/number.rs index fd4b98f..f99af94 100644 --- a/crates/lib/tests/number.rs +++ b/crates/lib/tests/number.rs @@ -213,6 +213,21 @@ test!( "a {\n color: 1e-100;\n}\n", "a {\n color: 0;\n}\n" ); +test!( + overflows_float_positive, + "a {\n color: 1e999;\n}\n", + "a {\n color: Infinity;\n}\n" +); +test!( + overflows_float_negative, + "a {\n color: -1e999;\n}\n", + "a {\n color: -Infinity;\n}\n" +); +test!( + very_large_but_no_overflow, + "a {\n color: 17976931348623157000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000;\n}\n", + "a {\n color: 17976931348623157580412819756850388593900235011794141176754562789180111453639664485361928830517704263393537268510363518759043843737070229269956251768752166883397940628862983287625967246810352023792017211936260189893797509826303293149283469713429932049693599732425511693654044437030940398714664210204414967808;\n}\n" +); error!( scientific_notation_no_number_after_decimal, "a {\n color: 1.e3;\n}\n", "Error: Expected digit."