6
6
/**
7
7
* Styles
8
8
*/
9
- : root {
9
+ : root ,
10
+ : host {
10
11
--pico-font-family-emoji : "Apple Color Emoji" , "Segoe UI Emoji" , "Segoe UI Symbol" , "Noto Color Emoji" ;
11
12
--pico-font-family-sans-serif : system-ui, "Segoe UI" , Roboto, Oxygen, Ubuntu, Cantarell, Helvetica, Arial, "Helvetica Neue" , sans-serif, var (--pico-font-family-emoji );
12
13
--pico-font-family-monospace : ui-monospace, SFMono-Regular, "SF Mono" , Menlo, Consolas, "Liberation Mono" , monospace, var (--pico-font-family-emoji );
47
48
--pico-icon-loading : url ("data:image/svg+xml,%3Csvg fill='none' height='24' width='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg' %3E%3Cstyle%3E g %7B animation: rotate 2s linear infinite; transform-origin: center center; %7D circle %7B stroke-dasharray: 75,100; stroke-dashoffset: -5; animation: dash 1.5s ease-in-out infinite; stroke-linecap: round; %7D @keyframes rotate %7B 0%25 %7B transform: rotate(0deg); %7D 100%25 %7B transform: rotate(360deg); %7D %7D @keyframes dash %7B 0%25 %7B stroke-dasharray: 1,100; stroke-dashoffset: 0; %7D 50%25 %7B stroke-dasharray: 44.5,100; stroke-dashoffset: -17.5; %7D 100%25 %7B stroke-dasharray: 44.5,100; stroke-dashoffset: -62; %7D %7D %3C/style%3E%3Cg%3E%3Ccircle cx='12' cy='12' r='10' fill='none' stroke='rgb(136, 145, 164)' stroke-width='4' /%3E%3C/g%3E%3C/svg%3E" );
48
49
}
49
50
@media (min-width : 576px ) {
50
- : root {
51
+ : root ,
52
+ : host {
51
53
--pico-font-size : 106.25% ;
52
54
}
53
55
}
54
56
@media (min-width : 768px ) {
55
- : root {
57
+ : root ,
58
+ : host {
56
59
--pico-font-size : 112.5% ;
57
60
}
58
61
}
59
62
@media (min-width : 1024px ) {
60
- : root {
63
+ : root ,
64
+ : host {
61
65
--pico-font-size : 118.75% ;
62
66
}
63
67
}
64
68
@media (min-width : 1280px ) {
65
- : root {
69
+ : root ,
70
+ : host {
66
71
--pico-font-size : 125% ;
67
72
}
68
73
}
69
74
@media (min-width : 1536px ) {
70
- : root {
75
+ : root ,
76
+ : host {
71
77
--pico-font-size : 131.25% ;
72
78
}
73
79
}
@@ -225,7 +231,8 @@ details summary[role=button]:not(.outline)::after {
225
231
* Color schemes
226
232
*/
227
233
[data-theme = light ],
228
- : root : not ([data-theme = dark ]) {
234
+ : root : not ([data-theme = dark ]),
235
+ : host (: not ([data-theme = dark ])) {
229
236
color-scheme : light;
230
237
--pico-background-color : # fff ;
231
238
--pico-color : # 373c44 ;
@@ -344,12 +351,19 @@ details summary[role=button]:not(.outline)::after {
344
351
[type = reset ],
345
352
[type = checkbox ],
346
353
[type = radio ],
354
+ [type = file ]),
355
+ : host (: not ([data-theme = dark ])) input : is ([type = submit ],
356
+ [type = button ],
357
+ [type = reset ],
358
+ [type = checkbox ],
359
+ [type = radio ],
347
360
[type = file ]) {
348
361
--pico-form-element-focus-color : var (--pico-primary-focus );
349
362
}
350
363
351
364
@media only screen and (prefers-color-scheme : dark) {
352
- : root : not ([data-theme ]) {
365
+ : root : not ([data-theme ]),
366
+ : host (: not ([data-theme ])) {
353
367
color-scheme : dark;
354
368
--pico-background-color : rgb (19 , 22.5 , 30.5 );
355
369
--pico-color : # c2c7d0 ;
@@ -461,6 +475,11 @@ details summary[role=button]:not(.outline)::after {
461
475
[type = submit ],
462
476
[type = button ],
463
477
[type = reset ],
478
+ [role = button ]): not (.outline )::before ,
479
+ : host (: not ([data-theme ])) [aria-busy = true ]: not (input , select , textarea ).contrast : is (button ,
480
+ [type = submit ],
481
+ [type = button ],
482
+ [type = reset ],
464
483
[role = button ]): not (.outline )::before {
465
484
filter : brightness (0 );
466
485
}
@@ -469,10 +488,17 @@ details summary[role=button]:not(.outline)::after {
469
488
[type = reset ],
470
489
[type = checkbox ],
471
490
[type = radio ],
491
+ [type = file ]),
492
+ : host (: not ([data-theme ])) input : is ([type = submit ],
493
+ [type = button ],
494
+ [type = reset ],
495
+ [type = checkbox ],
496
+ [type = radio ],
472
497
[type = file ]) {
473
498
--pico-form-element-focus-color : var (--pico-primary-focus );
474
499
}
475
- : root : not ([data-theme ]) details summary [role = button ].contrast : not (.outline )::after {
500
+ : root : not ([data-theme ]) details summary [role = button ].contrast : not (.outline )::after ,
501
+ : host (: not ([data-theme ])) details summary [role = button ].contrast : not (.outline )::after {
476
502
filter : brightness (0 );
477
503
}
478
504
}
@@ -627,7 +653,8 @@ progress,
627
653
vertical-align : inherit;
628
654
}
629
655
630
- : where (: root ) {
656
+ : where (: root ),
657
+ : where (: host ) {
631
658
-webkit-tap-highlight-color : transparent;
632
659
-webkit-text-size-adjust : 100% ;
633
660
-moz-text-size-adjust : 100% ;
@@ -1500,7 +1527,6 @@ button,
1500
1527
line-height : var (--pico-line-height );
1501
1528
text-align : center;
1502
1529
text-decoration : none;
1503
- cursor : pointer;
1504
1530
-webkit-user-select : none;
1505
1531
-moz-user-select : none;
1506
1532
user-select : none;
@@ -1681,7 +1707,8 @@ img {
1681
1707
fill : currentColor;
1682
1708
}
1683
1709
1684
- svg : not (: root ) {
1710
+ svg : not (: root ),
1711
+ svg : not (: host ) {
1685
1712
overflow : hidden;
1686
1713
}
1687
1714
@@ -2652,23 +2679,27 @@ details[open] > summary::after {
2652
2679
}
2653
2680
2654
2681
/**
2655
- * Card (<article>)
2682
+ * Card (<article>, role="article" )
2656
2683
*/
2657
- article {
2684
+ article ,
2685
+ [role = article ] {
2658
2686
margin-bottom : var (--pico-block-spacing-vertical );
2659
2687
padding : var (--pico-block-spacing-vertical ) var (--pico-block-spacing-horizontal );
2660
2688
border-radius : var (--pico-border-radius );
2661
2689
background : var (--pico-card-background-color );
2662
2690
box-shadow : var (--pico-card-box-shadow );
2663
2691
}
2664
2692
article > header ,
2665
- article > footer {
2693
+ article > footer ,
2694
+ [role = article ] > header ,
2695
+ [role = article ] > footer {
2666
2696
margin-right : calc (var (--pico-block-spacing-horizontal ) * -1 );
2667
2697
margin-left : calc (var (--pico-block-spacing-horizontal ) * -1 );
2668
2698
padding : calc (var (--pico-block-spacing-vertical ) * 0.66 ) var (--pico-block-spacing-horizontal );
2669
2699
background-color : var (--pico-card-sectioning-background-color );
2670
2700
}
2671
- article > header {
2701
+ article > header ,
2702
+ [role = article ] > header {
2672
2703
margin-top : calc (var (--pico-block-spacing-vertical ) * -1 );
2673
2704
margin-bottom : var (--pico-block-spacing-vertical );
2674
2705
border-bottom : var (--pico-border-width ) solid var (--pico-card-border-color );
@@ -2680,10 +2711,17 @@ article > header > h2,
2680
2711
article > header > h3 ,
2681
2712
article > header > h4 ,
2682
2713
article > header > h5 ,
2683
- article > header > h6 {
2714
+ article > header > h6 ,
2715
+ [role = article ] > header > h1 ,
2716
+ [role = article ] > header > h2 ,
2717
+ [role = article ] > header > h3 ,
2718
+ [role = article ] > header > h4 ,
2719
+ [role = article ] > header > h5 ,
2720
+ [role = article ] > header > h6 {
2684
2721
margin-bottom : 0 ;
2685
2722
}
2686
- article > footer {
2723
+ article > footer ,
2724
+ [role = article ] > footer {
2687
2725
margin-top : var (--pico-block-spacing-vertical );
2688
2726
margin-bottom : calc (var (--pico-block-spacing-vertical ) * -1 );
2689
2727
border-top : var (--pico-border-width ) solid var (--pico-card-border-color );
@@ -3037,7 +3075,8 @@ a[aria-busy=true] {
3037
3075
/**
3038
3076
* Modal (<dialog>)
3039
3077
*/
3040
- : root {
3078
+ : root ,
3079
+ : host {
3041
3080
--pico-scrollbar-width : 0px ;
3042
3081
}
3043
3082
0 commit comments