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

[CSS] Add :global() and :local() pseudo-classes #3944

Merged
merged 3 commits into from
Jul 12, 2024

Conversation

deathaxe
Copy link
Collaborator

@deathaxe deathaxe commented Mar 11, 2024

This commit adds :global(selector) and :local(selector) pseudo-class support. The former is used by CSS Modules, Less and Astro framework. The ladder is used by CSS Modules only, but is added for completeness.

It is no default CSS feature, but appears to be specific enough to not cause any conflicts.

Adding it to core CSS would avoid the need to extend CSS for Astro, just for this single reason.

Vue.js also uses :global (see: https://vuejs.org/api/sfc-css-features.html#global-selectors).

This commit adds `:global(selector)` and `:local(selector)` pseudo-class
support. The former is used by CSS Modules, Less and Astro framework.
The ladder is used by CSS Modules only, but is added for completeness.

It is no default CSS feature, but appears to be specific enough to not cause
any conflicts.

Adding it to core CSS would avoid the need to extend CSS for Astro, just
for this single reason.
@deathaxe deathaxe marked this pull request as ready for review March 11, 2024 19:18
FichteFoll
FichteFoll previously approved these changes Mar 15, 2024
@deathaxe
Copy link
Collaborator Author

Another request for supporting :global() was made for vue.js at Sass package.

This request technically also hits CSS as also being supported/used by vue.js

Are there certain concerns against adding it here?

Copy link
Collaborator

@michaelblyons michaelblyons left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems safe enough. If someone is really offended, we can revisit later.

@deathaxe deathaxe merged commit a5ed29e into sublimehq:master Jul 12, 2024
2 checks passed
@deathaxe deathaxe deleted the pr/css/global-pseudo-class branch July 12, 2024 06:42
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.

5 participants