Commit Graph

1334 Commits

Author SHA1 Message Date
Natalie Weizenbaum
c55235d166
Don't separate out media queries after one has bubbled (#1933)
Closes #777
2023-04-11 15:44:19 -07:00
Goodwine
e68818a86e
Allow global Sass function colliding with CSS native functions to use CSS variables (#1926)
* Allow global Sass function colliding with CSS native functions to use CSS variables

Many Sass functions are available globally even without loading their module. Some of these are also valid CSS native functions. Sass performs validations which disallow the use of CSS variables because the arguments are asserted a given type of value. For these collisions allow the use of CSS variables and in such cases assume the entire function call is meant to be the CSS native function rather than the global Sass function.

Fixes https://github.com/sass/sass/issues/3507

* Also allow for special numbers, not only for var()

* add changelog oops
2023-04-10 16:58:55 -07:00
Natalie Weizenbaum
283bdc0063
Deprecate duplicate !global and !default declarations (#1931)
See #604
See sass/sass#2607
2023-04-07 16:29:57 -07:00
Natalie Weizenbaum
702a7ee7a1
Fix the performance of selector span expansion (#1929)
Instead of calling `SourceFile.getText()`, which creates string copies
of a substantial subset of the text of the file every time, this
directly accesses the file's underlying code units without doing any
copies.

Closes #1913
2023-04-06 14:44:29 -07:00
Natalie Weizenbaum
f5a3dea748
Add support for constants in calculations (#1922)
Closes #1900
See sass/sass#3258
2023-03-23 15:59:27 -07:00
Jennifer Thakar
09a5f09638
Fix performance regression from selector spans (#1916) 2023-03-14 14:08:46 -07:00
Jennifer Thakar
8f8138dfab
Add --fatal-deprecations and --future-deprecations (#1820)
* Add fatal/futureDeprecations to Dart API

This adds a new `Deprecation` class that specifies an ID for each
deprecated feature along with what Dart Sass version deprecated it.

The compile functions allow you to pass a set of `fatalDeprecations`
that will cause an error instead of a warning. You can also pass a set
of `futureDeprecations`, which let you opt-in to deprecations (like
`@import`) early.

* Add future deprecation for `@import`

* Add flags

* Merge colorUnits and randomWithUnits

* Update changelogs and pubspecs

* Add tests

* Use isFuture instead of deprecatedIn == null
* Split warnForDeprecation from warn

* Add missing word to error message
2023-03-10 14:24:33 -08:00
Natalie Weizenbaum
9417b6e8d8
Track original source spans for selectors (#1903)
Closes #1783
2023-03-08 14:59:12 -08:00
Natalie Weizenbaum
f022e02bc5
Improve errors for invalid CSS values passed to CSS functions (#1901)
Closes #1769
2023-03-03 15:07:15 -08:00
Goodwine
eb1ced15d6
Pull @font-face out to root (#1899)
Closes sass/sass#1251
2023-03-01 18:12:11 -08:00
dannypernik
c4523884bf
Add timestamp to printed compile statement (#1876)
Co-authored-by: dannypernik <dannypernik@mail.com>
Co-authored-by: Natalie Weizenbaum <nweiz@google.com>
Co-authored-by: なつき <i@ntk.me>
2023-02-16 17:27:30 -08:00
Natalie Weizenbaum
13cc7d2da4
Improve the suggested replacements for unary minus in /-as-division (#1888)
Closes #1887
2023-02-16 13:34:57 -08:00
Natalie Weizenbaum
c8b4cd09eb
Don't emit "deg" for hsl hues (#1885) 2023-02-13 16:44:14 -08:00
Andreas Deininger
5eb66fc219
Fixes typos (#1879) 2023-02-03 14:47:13 -08:00
Natalie Weizenbaum
6310dfb129
Update synchronization tests to verify the entire file (#1880)
This catches cases where the target file is edited directly without
also editing the source file.

Also re-run `pub run grinder`.
2023-02-01 16:23:37 -08:00
Natalie Weizenbaum
98fe9a43dd
Track dependencies through meta.load-css() with --watch (#1877)
Closes #1808
2023-01-31 16:58:45 -08:00
Christophe Coevoet
5a521b86f9
Add all CSS length units in known compatibilities (#1868)
This allows more validation of wrong computations in first-class calc.
2023-01-30 23:29:04 +00:00
Jennifer Thakar
00069241b9
Fix escaped backslash crash (#1870)
* Fix escaped backslash crash

Fixes #1855.

* Code review
2023-01-24 16:03:49 -08:00
Goodwine
0248608c44
Return an error when using a custom property in a propset instead of crashing (#1874)
Fixes: #1857
See: sass/sass-spec#1873
2023-01-24 15:42:09 -08:00
Natalie Weizenbaum
b98fa4fbd1
Fix an edge case in superselector computation (#1866)
Closes #1843
2023-01-06 00:30:49 -08:00
Natalie Weizenbaum
14c1634057
Don't crash when parsing +. (#1865)
Closes #1856
2023-01-04 17:03:08 -08:00
Goodwine
aceb1e8c51
Remove sourcemap comments from Sass sources (#1860)
* Remove sourcemap comments from Sass sources

* add changelog

* update version to cut a release and update sass_api changelog and pubspec
2023-01-04 16:08:50 -08:00
Natalie Weizenbaum
441be809a5
Delete dead code (#1864)
Closes #1861
2023-01-04 15:58:45 -08:00
Natalie Weizenbaum
100f76fa7f
Implement string.split() (#1839)
Closes #1821
See sass/sass#1950
2022-12-16 15:53:16 -08:00
Natalie Weizenbaum
641d8e196f
Be strict about whitespace in custom functions (#1848) 2022-12-15 14:44:40 -08:00
なつき
e87176a52a
Add a factory method for creating host callable (#1829)
Co-authored-by: Natalie Weizenbaum <nweiz@google.com>
2022-12-08 12:07:56 -08:00
Goodwine
f3293dbe0f
JS API: Validate that importer result 'contents' is a string and improve ArgumentError output (#1816)
* Validate ImporterResult 'contents' and improve ArgumentError output
* only use JS stuff in the nodejs bindings
* handle non-string contents for legacy importer too
* make it work with node 12
2022-11-03 16:50:06 -07:00
Natalie Weizenbaum
00c351746e
Make `cloneCss() clone modules that transitively contain CSS (#1824)
Previously we were only cloning modules that directly contained CSS,
but this created a problem where extensions could be added to their
*shared* extension store across `load-css()` boundaries and thereby
applied to upstream CSS.

Closes #3322
2022-11-03 16:11:36 -07:00
Natalie Weizenbaum
44d6bb6ac7
Add full support for Media Queries 4 (#1822)
Closes #1728
2022-11-01 16:20:27 -07:00
Natalie Weizenbaum
558640bda4
Support all angle units in color functions (#1818)
See #1174
See sass/sass#2904
2022-10-28 15:52:44 -07:00
Natalie Weizenbaum
dd9e3cc1db
Implement deprecations for strict function units (#1817)
See #1776
See sass/sass#3374
2022-10-27 20:08:54 -07:00
Goodwine
655b55c51d
Indent comma-separated multiline selectors inside @media queries (#1814)
* Indent comma-separated multiline selectors inside @media queries

* update pubspec and changelog
2022-10-27 16:39:21 -07:00
Sam Rawlins
6e670ef6b8
Insert explicit type arguments where types could not be inferred. (#1813) 2022-10-24 13:21:59 -07:00
Natalie Weizenbaum
103cb19b41
Consistently use floating-point numbers everywhere (#1802)
Closes #1794
2022-09-21 14:15:42 -07:00
Natalie Weizenbaum
90b6190027
Add a deprecation warning for strict unary operations (#1800)
Closes #1721
2022-09-15 13:58:12 -07:00
Jennifer Thakar
db1e1261bd
Fix bug in JS MultiSpan (#1801)
Fixes #1790.
2022-09-14 17:08:57 -07:00
Natalie Weizenbaum
5466dd76a2
Give SassScriptException a name parameter (#1798)
This avoids the need to copy around the same `_exception()` helper all
over the place.
2022-09-13 16:09:56 -07:00
Natalie Weizenbaum
e2f97055db
Merge pull request #1795 from stof/upgrade_dependencies
Upgrade dev dependencies to the latest version
2022-09-07 14:35:12 -07:00
Jennifer Thakar
034484260d
Fix span for not operations (#1797) 2022-09-07 14:27:35 -07:00
Christophe Coevoet
fb107bd2a0
Migrate deprecation warnings to sass-lang short links (#1796) 2022-09-07 11:25:14 -07:00
Christophe Coevoet
8480259d6c Avoid using private types in public APIs 2022-09-03 01:41:06 +02:00
Christophe Coevoet
a705445f0d Avoid null check on potentially nullable type parameter 2022-09-03 01:41:06 +02:00
Christophe Coevoet
fec9a2aced Remove leading underscore on local identifiers 2022-09-03 01:41:06 +02:00
Natalie Weizenbaum
016ab24ebd
Fix a bug with @media query bubbling (#1792)
Closes #1791
2022-08-29 15:07:32 -07:00
Natalie Weizenbaum
98f326b507
Convert visitor classes to mixins (#1784)
Co-authored-by: Jennifer Thakar <jathak@google.com>
2022-08-19 15:17:58 -07:00
Natalie Weizenbaum
76953320aa
Update specificity calculation for selector pseudos (#1781)
This is very close to invisible to the user and actually making it
visible would require a complex and hard-to-read test, so I'm electing
to avoid testing it.

Closes #2528
2022-08-18 18:31:31 -07:00
Goodwine
c850501621
Allow a module loaded multiple times by the same configuration (#1739)
* Allow a module loaded multiple times by the same configuration

* use object references as opaque ID

Fixes #1716
2022-08-18 16:49:09 -07:00
Goodwine
3f98441316
Deprecate math.random() when $limit has units (#1779)
* Deprecate math.random() when $limit has units

* add changelog for random with units deprecation

* add link to sass-site/d/random-with-units
2022-08-17 19:24:51 -07:00
Goodwine
0b8a0f606d
Transform all enum-like classes to dart enums (#1777)
* Transform all enum-like classes to dart enums

Fixes #1746

* fix new linter warnings upon upgrading to 2.17 regarding "[new MyClass]" to "[MyClass.new]"
2022-08-17 15:00:13 -07:00
Natalie Weizenbaum
a987352219
Improve combinator superselector logic (#1778)
Closes #791
2022-08-15 18:20:56 -07:00