Skip to content

Commit a11537c

Browse files
Netailbsmth
andauthored
feat: add @container at-rule (#853)
* feat: add container at rule * fix: feedback * add syntaxes * fix: feedback * Update css/at-rules.json Co-authored-by: Brian Smith <brian@smith.berlin> --------- Co-authored-by: Brian Smith <brian@smith.berlin>
1 parent ddc6e0d commit a11537c

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

css/at-rules.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,17 @@
120120
"status": "standard",
121121
"mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@counter-style"
122122
},
123+
"@container": {
124+
"syntax": "@container <container-condition># {\n <block-contents>\n}",
125+
"interfaces": [
126+
"CSSContainerRule"
127+
],
128+
"groups": [
129+
"CSS Conditional Rules"
130+
],
131+
"status": "standard",
132+
"mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@container"
133+
},
123134
"@document": {
124135
"syntax": "@document [ <url> | url-prefix(<string>) | domain(<string>) | media-document(<string>) | regexp(<string>) ]# {\n <group-rule-body>\n}",
125136
"interfaces": [

css/syntaxes.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,15 @@
209209
"conic-gradient()": {
210210
"syntax": "conic-gradient( [ from <angle> ]? [ at <position> ]?, <angular-color-stop-list> )"
211211
},
212+
"container-condition": {
213+
"syntax": "[ <container-name>? <container-query>? ]!"
214+
},
215+
"container-name": {
216+
"syntax": "<custom-ident>"
217+
},
218+
"container-query": {
219+
"syntax": "not <query-in-parens> | <query-in-parens> [ [ and <query-in-parens> ]* | [ or <query-in-parens> ]* ]"
220+
},
212221
"content-distribution": {
213222
"syntax": "space-between | space-around | space-evenly | stretch"
214223
},
@@ -728,6 +737,9 @@
728737
"pseudo-page": {
729738
"syntax": ": [ left | right | first | blank ]"
730739
},
740+
"query-in-parens": {
741+
"syntax": "( <container-query> ) | ( <size-feature> ) | style( <style-query> ) | scroll-state( <scroll-state-query> ) | <general-enclosed>"
742+
},
731743
"quote": {
732744
"syntax": "open-quote | close-quote | no-open-quote | no-close-quote"
733745
},
@@ -839,6 +851,15 @@
839851
"scroller": {
840852
"syntax": "root | nearest | self"
841853
},
854+
"scroll-state-feature": {
855+
"syntax": "<media-query-list>"
856+
},
857+
"scroll-state-in-parens": {
858+
"syntax": "( <scroll-state-query> ) | ( <scroll-state-feature> ) | <general-enclosed>"
859+
},
860+
"scroll-state-query": {
861+
"syntax": "not <scroll-state-in-parens> | <scroll-state-in-parens> [ [ and <scroll-state-in-parens> ]* | [ or <scroll-state-in-parens> ]* ] | <scroll-state-feature> "
862+
},
842863
"selector-list": {
843864
"syntax": "<complex-selector-list>"
844865
},
@@ -905,6 +926,9 @@
905926
"size": {
906927
"syntax": "closest-side | farthest-side | closest-corner | farthest-corner | <length> | <length-percentage>{2}"
907928
},
929+
"size-feature": {
930+
"syntax": "<media-query-list>"
931+
},
908932
"skew()": {
909933
"syntax": "skew( [ <angle> | <zero> ] , [ <angle> | <zero> ]? )"
910934
},
@@ -923,6 +947,15 @@
923947
"step-timing-function": {
924948
"syntax": "step-start | step-end | steps(<integer>[, <step-position>]?)"
925949
},
950+
"style-feature": {
951+
"syntax": "<declaration>"
952+
},
953+
"style-in-parens": {
954+
"syntax": "( <style-query> ) | ( <style-feature> ) | <general-enclosed>"
955+
},
956+
"style-query": {
957+
"syntax": "not <style-in-parens> | <style-in-parens> [ [ and <style-in-parens> ]* | [ or <style-in-parens> ]* ] | <style-feature> "
958+
},
926959
"subclass-selector": {
927960
"syntax": "<id-selector> | <class-selector> | <attribute-selector> | <pseudo-class-selector>"
928961
},

0 commit comments

Comments
 (0)