@@ -63,14 +63,16 @@ html {
6363}
6464
6565body {
66- font : 400 100% / 1.5 var (--main-font );
66+ font : 400 100% / 1.5 sans-serif;
67+ font-family : var (--main-font );
6768 -moz-osx-font-smoothing : grayscale;
6869 -webkit-font-smoothing : antialiased;
6970 font-smoothing : antialiased;
7071 letter-spacing : -.00125em ;
7172 padding : 0 calc ((100% - 960px ) / 2 );
7273 text-rendering : optimizeLegibility;
7374 text-size-adjust : 100% ;
75+ transition : 400ms background-color, 400ms color;
7476
7577 @media (width < 560px) {
7678 margin : 16px ;
9193 text-decoration : none;
9294}
9395
94- code ,
95- pre {
96+ aside , header , main , section {
97+ display : block;
98+ }
99+
100+ code , pre {
96101 font-family : var (--code-font );
102+ font-size : 100% ;
97103 font-weight : 600 ;
98104}
99105
@@ -115,13 +121,22 @@ code {
115121 }
116122}
117123
124+ img {
125+ border : 0 ;
126+ }
127+
118128/* Header
119129/* ========================================================================== */
120130
121131.cssdb-header {
122132 @media (width > = 960px) {
123133 align-items : center;
124134 display : flex;
135+
136+ & > * {
137+ display : inline-block;
138+ vertical-align : top;
139+ }
125140 }
126141}
127142
@@ -170,6 +185,11 @@ code {
170185
171186.cssdb-feature-header {
172187 display : flex;
188+
189+ & > * {
190+ display : inline-block;
191+ vertical-align : top;
192+ }
173193}
174194
175195.cssdb-feature-stage {
@@ -220,8 +240,7 @@ code {
220240 }
221241}
222242
223- .cssdb-feature-mdn-badge ,
224- .cssdb-feature-specification-badge {
243+ .cssdb-feature-mdn-badge , .cssdb-feature-specification-badge {
225244 height : 20px ;
226245 vertical-align : top;
227246}
@@ -270,6 +289,7 @@ code {
270289 color : # 727272 ;
271290 overflow : auto;
272291 padding : 20px 15px ;
292+ transition : 400ms background-color, 400ms color;
273293
274294 @media (prefers-color-scheme : dark) {
275295 background-color : # 111111 ;
@@ -309,8 +329,7 @@ code {
309329 }
310330}
311331
312- .css-value ,
313- .css-atrule-params {
332+ .css-value , .css-atrule-params {
314333 color : # 000000 ;
315334
316335 @media (prefers-color-scheme : dark) {
@@ -586,3 +605,127 @@ code {
586605 margin-end : 20px ;
587606 }
588607}
608+
609+ /* Color Scheme Toggle
610+ /* ========================================================================== */
611+
612+ .cssdb-color_scheme_toggle {
613+ display : inline-block;
614+ position : absolute;
615+
616+ @media (width < 560px) {
617+ inset-inline-end : 16px ;
618+ }
619+
620+ @media (560px <= width < 960px) {
621+ inset-inline-end : 64px ;
622+ }
623+
624+ @media (width > = 960px) {
625+ inset-block-start : 32px ;
626+ inset-inline-end : calc ((100% - 960px ) / 2 );
627+
628+ & : dir (ltr ) {
629+ transform : translateX (-100% );
630+ }
631+
632+ & : dir (rtl ) {
633+ transform : translateX (100% );
634+ }
635+ }
636+
637+ & > input {
638+ appearance : none;
639+ height : 100% ;
640+ inset-block : 0 ;
641+ margin : 0 ;
642+ opacity : 0 ;
643+ position : absolute;
644+ z-index : 1 ;
645+ }
646+
647+ & > : nth-child (1 ) {
648+ inset-inline-start : 0 ;
649+ width : 37.5% ;
650+ }
651+
652+ & > : nth-child (2 ) {
653+ inset-inline-start : 37.5% ;
654+ width : 25% ;
655+ }
656+
657+ & > : nth-child (3 ) {
658+ inset-inline-start : 62.5% ;
659+ width : 37.5% ;
660+ }
661+
662+ & > label ::before {
663+ background-color : # f2f2f2 ;
664+ border-radius : 1.75em ;
665+ box-shadow : 0 0 0 2px # dddddd ;
666+ content : "" ;
667+ display : block;
668+ height : 1.75em ;
669+ transition : 200ms background-color, 200ms box-shadow;
670+ width : 4em ;
671+
672+ @media (prefers-color-scheme : dark) {
673+ background-color : # 181818 ;
674+ box-shadow : 0 0 0 2px # 333333 ;
675+ }
676+ }
677+
678+ & > input : nth-child (1 ): focus ~ label ::before {
679+ box-shadow : 0 0 5px 0 # 5e9ed7, 0 0 0 2px # 333333 ;
680+ }
681+
682+ & > input : nth-child (2 ): focus ~ label ::before {
683+ box-shadow : 0 0 3px 0 # 3bb5fc, 0 0 0 2px # dddddd ;
684+
685+ @media (prefers-color-scheme : dark) {
686+ box-shadow : 0 0 5px 0 # 5e9ed7, 0 0 0 2px # 333333 ;
687+ }
688+ }
689+
690+ & > input : nth-child (3 ): focus ~ label ::before {
691+ box-shadow : 0 0 5px 2px # f0fc3b, 0 0 0 2px # dddddd ;
692+ }
693+
694+ & > label ::after {
695+ background-color : # ffffff ;
696+ border-radius : 2.5em ;
697+ box-shadow : 0 0 0 2px # dddddd ;
698+ content : "" ;
699+ height : 1.75em ;
700+ inset-block-start : 0 ;
701+ position : absolute;
702+ transition : 200ms background-color, 200ms box-shadow, 200ms left, 200ms margin, 200ms width;
703+ width : 1.75em ;
704+
705+ @media (prefers-color-scheme : dark) {
706+ background-color : # 181818 ;
707+ box-shadow : 0 0 0 2px # 444444 ;
708+ }
709+ }
710+
711+ & > input : focus ~ label ::after {
712+ box-shadow : 0 0 5px 2px # 3b99fc, 0 0 0 2px # dddddd ;
713+ }
714+
715+ & > input : nth-child (1 ): checked ~ label ::after {
716+ inset-inline-start : 0 ;
717+ }
718+
719+ & > input : nth-child (2 ): checked ~ label ::after {
720+ inset-inline-start : 1.125em ;
721+ }
722+
723+ & > input : nth-child (3 ): checked ~ label ::after {
724+ inset-inline-start : 2.25em ;
725+ }
726+
727+ & > input : active ~ : last-child ::after {
728+ margin-inline-start : -.075em ;
729+ width : 1.875em ;
730+ }
731+ }
0 commit comments