Skip to content

Commit a17a9d6

Browse files
committed
Update at-container review CSS
1 parent c2c356b commit a17a9d6

File tree

1 file changed

+121
-13
lines changed

1 file changed

+121
-13
lines changed

.dev-assets/syntax-issues/at-container.css

Lines changed: 121 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,140 @@
22
* AT CONTAINER
33
*/
44

5-
/* DOES NOT HIGHLIGHT LIKE OTHER AT QUERIES */
5+
/* AND */
66
@container (width > 400px) and (height > 400px) {
77
}
8+
@container (min-width: 600px) and (orientation: landscape) {
9+
}
10+
11+
/* NOT */
812
@container not (width < 400px) {
913
}
10-
@container (width > 400px) or (height > 400px) {
14+
@container not (width < 400px) not (width > 800px) {
15+
}
16+
@container sidebar not (orientation: landscape) and (min-width: 600px) {
17+
}
18+
@container sidebar not (orientation: landscape) and (min-width: 600px) or (min-width: 600px) {
1119
}
1220

13-
/* AND */
14-
@container (width > 400px) and (height > 400px) {
21+
/* OR */
22+
@container (width > 400px) or (height > 400px) {''
1523
}
16-
@media (min-width: 600px) and (orientation: landscape) {
24+
@container (display: grid) or (display: flex) {
25+
}
26+
27+
/* CONTAINER-NAME */
28+
@container name (width > 400px) and (height > 400px) {
1729
}
18-
@supports (display: grid) and (gap: 1rem) {
30+
@container name1 name2 name3 not (width > 400px) not (height > 400px) {
1931
}
2032

21-
/* NOT */
22-
@container not (width < 400px) {
33+
@container default (width > 400px) {
2334
}
24-
@media not (orientation: landscape) {
35+
@container none default (width > 400px) {
2536
}
26-
@supports not (display: flex) {
37+
38+
/* CONTAINER-QUERY */
39+
@container (min-aspect-ratio: 3 / 2) {
40+
.video-player {
41+
border: 5px solid #fff;
42+
}
2743
}
2844

29-
/* OR */
30-
@container (width > 400px) or (height > 400px) {
45+
@container (min-width: calc( var(--width) * 1rem)) {
46+
.card {
47+
margin: 0;
48+
}
49+
}
50+
51+
/* STYLE-QUERY */
52+
@container style( --accent-color : currentColor ) {
53+
}
54+
55+
@container style(small --cards: /*comment*/ small 333px) {
56+
}
57+
@container card (inline-size > 30em) and style(--responsive: true) {
58+
}
59+
@container style( --width : calc( var(--hello) ) ) {
3160
}
32-
@supports (display: grid) or (display: flex) {
61+
62+
@container style(--themeBackground), not style(--themeColor: blue), style(--themeColor: blue) and style(--themeColor: purple), style(--themeColor: blue) or style(--themeColor: purple) {
63+
}
64+
@container card (inline-size > 30em) and style(--responsive: true) {
65+
}
66+
@container style(--cards: 333px) {
67+
article {
68+
border: thin solid silver;
69+
border-radius: 0.5em;
70+
padding: 1em;
71+
}
72+
}
73+
74+
/* NESTED @CONTAINER */
75+
@container summary (min-width: 400px) {
76+
@container (min-width: 800px) {
77+
.card {
78+
margin: 0;
79+
}
80+
@container (min-width: calc( var(--width) * 1rem)) {
81+
.card {
82+
margin: 0;
83+
}
84+
}
85+
}
86+
}
87+
@container card (inline-size > 30em) {
88+
@container style(--responsive: true) {
89+
/* styles */
90+
}
91+
}
92+
93+
/* EVERYTHING */
94+
@container /*comment*/ tall /*comment*/ short not invalidName (width > 400px) and invalidName not (min-height: 400px /*comment*/ invalidName) /*comment*/ or style(--accent-color: currentColor) {
95+
.card {
96+
margin: 0;
97+
.example {
98+
margin: 0;
99+
}
100+
}
101+
}
102+
103+
@container name1 name2 not (max-width: calc( (768 / 16) * 1rem)) invalidName {
104+
invalidName .wp-block-buttons {
105+
margin: calc(var(--wp--custom--element-spacing) * 3) auto;
106+
.wp-block-button,
107+
.wp-element-button {
108+
width: 100%;
109+
}
110+
}
111+
}
112+
113+
@container (10em <= width <= 20em) {
114+
/* styles */
115+
}
116+
117+
@container (inline-size >= 0px) {
118+
/* only applies when an inline-size container is available */
119+
h2 {
120+
font-size: calc(1.2em + 1cqi);
121+
}
122+
}
123+
124+
@container (width > 40em) {
125+
h2 {
126+
font-size: 1.5em;
127+
}
128+
}
129+
130+
@container my-page-layout (block-size > 12em) {
131+
.card {
132+
margin-block: 2em;
133+
}
134+
}
135+
136+
@container (inline-size >= 0px) {
137+
/* only applies when an inline-size container is available */
138+
h2 {
139+
font-size: calc(1.2em + 1cqi);
140+
}
33141
}

0 commit comments

Comments
 (0)