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

feat: add @container at-rule #853

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

Netail
Copy link

@Netail Netail commented Dec 24, 2024

Description

Add @container at rule

Motivation

VSCode not correctly syntax hightlighting

Additional details

https://developer.mozilla.org/en-US/docs/Web/CSS/@container
https://drafts.csswg.org/css-conditional-5/#container-rule

Related issues and pull requests

@Netail Netail requested a review from a team as a code owner December 24, 2024 13:35
@Netail Netail requested review from bsmth and removed request for a team December 24, 2024 13:35
@Netail Netail force-pushed the feat/container-at-rule branch from de560b9 to e924dd1 Compare December 24, 2024 13:47
@@ -120,6 +120,20 @@
"status": "standard",
"mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@counter-style"
},
"@container": {
"syntax": "@container <container-condition># {\n <block-contents>\n}",
Copy link
Contributor

@skyclouds2001 skyclouds2001 Dec 24, 2024

Choose a reason for hiding this comment

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

Suggested change
"syntax": "@container <container-condition># {\n <block-contents>\n}",
"syntax": "@container <container-condition># {\n <block-contents>\n}",

the syntax need to add to syntaxes.json if it is not existed in that file

e.g. #835

Copy link
Member

Choose a reason for hiding this comment

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

I think this is still outstanding, right? I don't get any matches on this branch for @container aside from ./css/at-rules.json:

grep -r "@container" ./
./css/at-rules.json:  "@container": {
./css/at-rules.json:    "syntax": "@container <container-condition># {\n  <group-rule-body>\n}",
./css/at-rules.json:    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@container"

Copy link
Author

@Netail Netail Jan 20, 2025

Choose a reason for hiding this comment

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

Copy link
Author

Choose a reason for hiding this comment

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

@skyclouds2001, do you happen to know the answer to these 3?

css/at-rules.json Outdated Show resolved Hide resolved
@Netail
Copy link
Author

Netail commented Dec 24, 2024

Applied your feedback, thanks :)

css/at-rules.json Outdated Show resolved Hide resolved
@Netail Netail force-pushed the feat/container-at-rule branch from 2d890b5 to 067b698 Compare December 25, 2024 20:39
@Netail Netail changed the title feat: add container at rule feat: add @container at-rule Jan 3, 2025
@Netail Netail requested a review from skyclouds2001 January 20, 2025 09:10
@bsmth
Copy link
Member

bsmth commented Jan 20, 2025

Thanks @Netail - there's a comment from Skyclouds above about adding to syntaxes.json, too: #853 (comment)

Do you want to take a look? Thank you!

@Netail Netail force-pushed the feat/container-at-rule branch from 74c384c to 1b3c5d7 Compare January 20, 2025 10:19
Copy link
Contributor

@skyclouds2001 skyclouds2001 left a comment

Choose a reason for hiding this comment

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

honestly I'm not quite sure either...

Copy link
Contributor

Choose a reason for hiding this comment

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

it is better to make those syntaxes by alphabet order

Comment on lines +230 to +235
"scroll-state-feature": {
"syntax": "<media-feature>"
},
"size-feature": {
"syntax": "<media-feature>"
},
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"scroll-state-feature": {
"syntax": "<media-feature>"
},
"size-feature": {
"syntax": "<media-feature>"
},
"scroll-state-feature": {
"syntax": "<media-query-list>"
},
"size-feature": {
"syntax": "<media-query-list>"
},

@media use <media-query-list>, so I think we should use this, too

Comment on lines +236 to +238
"style-feature": {
"syntax": "<declaration>: <declaration-value> | <custom-property-name>: <declaration-value>"
},
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"style-feature": {
"syntax": "<declaration>: <declaration-value> | <custom-property-name>: <declaration-value>"
},
"style-feature": {
"syntax": "<declaration>"
},

@import and @support also use <declaration> to represent a single css declaration, so I think <declaration> has covered <declaration-value> yet

Copy link
Author

Choose a reason for hiding this comment

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

Also the custom-property?

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.

3 participants