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
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions css/at-rules.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,17 @@
"status": "standard",
"mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@counter-style"
},
"@container": {
"syntax": "@container <container-condition># {\n <group-rule-body>\n}",
"interfaces": [
"CSSContainerRule"
],
"groups": [
"CSS Conditional Rules"
],
"status": "standard",
"mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@container"
},
"@document": {
"syntax": "@document [ <url> | url-prefix(<string>) | domain(<string>) | media-document(<string>) | regexp(<string>) ]# {\n <group-rule-body>\n}",
"interfaces": [
Expand Down
33 changes: 33 additions & 0 deletions css/syntaxes.json
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

Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,39 @@
"conic-gradient()": {
"syntax": "conic-gradient( [ from <angle> ]? [ at <position> ]?, <angular-color-stop-list> )"
},
"container-name": {
"syntax": "<custom-ident>"
},
"container-query": {
"syntax": "not <query-in-parens> | <query-in-parens> [ [ and <query-in-parens> ]* | [ or <query-in-parens> ]* ]"
},
"query-in-parens": {
"syntax": "( <container-query> ) | ( <size-feature> ) | style( <style-query> ) | scroll-state( <scroll-state-query> ) | <general-enclosed>"
},
"style-query": {
"syntax": "not <style-in-parens> | <style-in-parens> [ [ and <style-in-parens> ]* | [ or <style-in-parens> ]* ] | <style-feature> "
},
"style-in-parens": {
"syntax": "( <style-query> ) | ( <style-feature> ) | <general-enclosed>"
},
"scroll-state-query": {
"syntax": "not <scroll-state-in-parens> | <scroll-state-in-parens> [ [ and <scroll-state-in-parens> ]* | [ or <scroll-state-in-parens> ]* ] | <scroll-state-feature> "
},
"scroll-state-in-parens": {
"syntax": "( <scroll-state-query> ) | ( <scroll-state-feature> ) | <general-enclosed>"
},
"scroll-state-feature": {
"syntax": "<media-feature>"
},
"size-feature": {
"syntax": "<media-feature>"
},
Comment on lines +230 to +235
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

"style-feature": {
"syntax": "<declaration>: <declaration-value> | <custom-property-name>: <declaration-value>"
},
Comment on lines +236 to +238
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?

"container-condition": {
"syntax": "[ <container-name>? <container-query>? ]!"
},
"content-distribution": {
"syntax": "space-between | space-around | space-evenly | stretch"
},
Expand Down