File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,6 +21,10 @@ pub fn stylesheet_fixtures() -> Vec<Fixture> {
2121 name: "large" ,
2222 css: generated_fixture( 192 , 384 ) ,
2323 } ,
24+ Fixture {
25+ name: "conditional-run" ,
26+ css: conditional_run_fixture( 256 ) ,
27+ } ,
2428 ]
2529}
2630
@@ -183,3 +187,61 @@ fn generated_fixture(component_count: usize, utility_count: usize) -> String {
183187
184188 css
185189}
190+
191+ fn conditional_run_fixture ( rule_count : usize ) -> String {
192+ let mut css = String :: with_capacity ( rule_count * 720 ) ;
193+
194+ for i in 0 ..rule_count {
195+ let hue = ( i * 17 ) % 360 ;
196+ writeln ! (
197+ css,
198+ r#"
199+ @media (min-width: 768px) {{
200+ .media-card-{i} {{
201+ color: hsl({hue}deg 52% 28%);
202+ display: grid;
203+ gap: {gap}px;
204+ grid-template-columns: repeat(3, minmax(0, 1fr));
205+ }}
206+ }}
207+ "# ,
208+ gap = 8 + ( i % 12 ) ,
209+ )
210+ . unwrap ( ) ;
211+ }
212+
213+ for i in 0 ..rule_count {
214+ let width = 420 + ( i % 24 ) ;
215+ writeln ! (
216+ css,
217+ r#"
218+
219+ @supports (container-type: inline-size) {{
220+ .supports-card-{i} {{
221+ container-type: inline-size;
222+ inline-size: min(100%, {width}px);
223+ }}
224+ }}
225+ "# ,
226+ )
227+ . unwrap ( ) ;
228+ }
229+
230+ for i in 0 ..rule_count {
231+ writeln ! (
232+ css,
233+ r#"
234+
235+ @container (min-width: 32rem) {{
236+ .container-card-{i} {{
237+ padding: {padding}px;
238+ }}
239+ }}
240+ "# ,
241+ padding = 12 + ( i % 10 ) ,
242+ )
243+ . unwrap ( ) ;
244+ }
245+
246+ css
247+ }
You can’t perform that action at this time.
0 commit comments