Skip to content

Conversation

@deathaxe
Copy link
Collaborator

@deathaxe deathaxe commented Jun 3, 2023

Resolves #3688

This commit implements support for nested selectors and rule lists according to current draft specification at https://drafts.csswg.org/css-nesting-1.

deathaxe added 2 commits June 3, 2023 14:07
Resolves sublimehq#3688

This commit implements support for nested selectors and rule lists according to
current draft specification at https://drafts.csswg.org/css-nesting-1.
This commit removes obsolete includes from `property-list-body` context.

- `property-values` is no longer matched as `:` pushes `nested-selectors`
- `illegal-blocks` is replaced by nested `property-lists`
@deathaxe deathaxe marked this pull request as draft June 3, 2023 16:38
@deathaxe
Copy link
Collaborator Author

deathaxe commented Jun 3, 2023

While changes to CSS are simple, the impact on all sorts of inherited syntaxes used in ASP, JSP, Rails, PHP, ... is rather significant.

Sometimes it's enough to change syntax test assertion punctuations.

But there are also cases, which need more work.

deathaxe added 2 commits June 4, 2023 19:38
By excluding `prototype` from rule-lists this commit ensures, template tags
are correctly scoped as part of a selector, property-name or property-value.

That's important as `:` no longer denotes beginning of property-values, but
is the beginning of nested selectors.

Some extra `;` are added in syntax tests to make sure the following content is
scoped correctly. That's required as assertion comments are sometimes scoped as
selectors, caused by comment styles not being supported within CSS.
deathaxe added a commit to SublimeText/Less that referenced this pull request Jun 27, 2023
This commit makes sure to give Less's `&` precedence.

Less and CSS4 treat `&` different.

see: sublimehq/Packages#3785
@deathaxe deathaxe marked this pull request as ready for review June 27, 2023 19:52
deathaxe added a commit to SublimeText/Liquid that referenced this pull request Jun 27, 2023
This commit makes sure to correctly apply propety-name meta scope, even if
property name starts with interpolation.

Prepares for sublimehq/Packages#3785

Requires ST4149+
@deathaxe
Copy link
Collaborator Author

deathaxe commented Jun 27, 2023

Tailwind CSS has implemented this PRs changeset for a while without negative feedback.

Less and Liquid have been updated accordingly.

Other packages like Vue, Blade seem uneffected.

Chrome and Safari support CSS nesting, Firefox has announced support.

@deathaxe deathaxe merged commit dd81bb8 into sublimehq:master Jul 15, 2023
@deathaxe deathaxe deleted the pr/css/add-nesting branch July 15, 2023 15:51
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.

[CSS] Support CSS Nesting

3 participants