This repository was archived by the owner on Feb 3, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -135,3 +135,12 @@ svg .text-shadow {
135135.prose h1 {
136136 margin : inherit !important ;
137137}
138+
139+ .emoji {
140+ display : inline;
141+ height : 1em ;
142+ width : 1em ;
143+ margin : 0 !important ;
144+ margin-top : -0.2em !important ;
145+ vertical-align : middle;
146+ }
Original file line number Diff line number Diff line change @@ -19,8 +19,10 @@ const toggleElements = document.querySelectorAll('.toggle')
1919mode . subscribe ( ( v ) => {
2020 toggleElements . forEach (
2121 ( el ) =>
22- ( el . querySelector ( '.label' ) . textContent =
23- v === 'dark' ? 'π Dark' : 'π Light' ) ,
22+ ( el . querySelector ( '.label' ) . innerHTML =
23+ v === 'dark'
24+ ? '<img class="emoji" src="moon.png"> Dark'
25+ : '<img class="emoji" src="sun.png"> Light' ) ,
2426 )
2527 changeFavicon ( v === 'dark' ? 'moon.png' : 'sun.png' )
2628} )
Original file line number Diff line number Diff line change 1414 include ./index.css
1515 body.prose
1616 div.header.flex.items-center.mb-3.justify-between.flex-col ( class ="md:flex-row" )
17- h1( class ="mb-3 md:mb-0" ) ππ Perfect Dark Mode
17+ h1( class ="mb-3 md:mb-0" ) < img class = " emoji " src = " moon.png " >< img class = " emoji " src = " sun.png " > Perfect Dark Mode
1818 button.toggle.flex.flex-col.items-center ( style ="visibility: hidden;" )
19- span.label π color mode
19+ span.label < img class = " emoji " src = " sun.png " > color mode
2020 span.text-xs (Click Me)
2121
2222 div.flex.space-x-2.justify-center ( class ="md:justify-start" )
4444 // their system color mode.
4545 p You can set the color mode, this will be saved.
4646 button.toggle ( style ="visibility: hidden;" )
47- span.label π color mode
47+ span.label < img class = " emoji " src = " sun.png " > color mode
4848 p You can reset the color mode and fallback to system color mode.
4949 button( id ="button" ) Reset
5050 p For debugging and understanding here is the saved color mode and the OS color mode.
You canβt perform that action at this time.
0 commit comments