Skip to content
This repository was archived by the owner on Feb 3, 2024. It is now read-only.

Commit 7f6f892

Browse files
committed
use i instead of img
1 parent bb2eb36 commit 7f6f892

3 files changed

Lines changed: 21 additions & 7 deletions

File tree

packages/docs/index.css

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272

7373
:root.blue {
7474
--color: #2a4365;
75-
--background: #EBF8FF;
75+
--background: #ebf8ff;
7676
}
7777

7878
:root {
@@ -164,7 +164,8 @@ input {
164164
display: none;
165165
}
166166

167-
button, select {
167+
button,
168+
select {
168169
text-transform: capitalize;
169170
min-width: 120px;
170171
padding: 0.5rem 1rem;
@@ -210,10 +211,23 @@ svg .text-shadow {
210211
}
211212

212213
.emoji {
213-
display: inline;
214+
display: inline-block;
215+
background-size: contain;
214216
height: 1em;
215217
width: 1em;
216218
margin: 0 !important;
217219
margin-top: -0.25em !important;
218220
vertical-align: middle;
219221
}
222+
223+
.emoji.light {
224+
background-image: url('images/light.png');
225+
}
226+
227+
.emoji.dark {
228+
background-image: url('images/dark.png');
229+
}
230+
231+
.emoji.blue {
232+
background-image: url('images/blue.png');
233+
}

packages/docs/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const toggleElements = document.querySelectorAll('.pdm-toggle')
1717

1818
const modeToLabel = (m) => {
1919
if (m === 'dark' || m === 'light' || m === 'blue') {
20-
return `<img class="emoji" src="images/${m}.png" alt=""> ${m}`
20+
return `<i class="emoji ${m}"></i> ${m}`
2121
}
2222
return m
2323
}

packages/docs/index.pug

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ html(data-pdm="light dark blue")
1919
- var outline = ['focus:outline-none focus:shadow-outline focus:border-yellow-300']
2020
div.container.px-3.mb-3
2121
div.header.flex.items-center.justify-between.flex-col.my-3(class="md:flex-row md:my-6")
22-
h1.mb-3.title(class="md:mb-0") <img class="emoji" src="images/dark.png" alt=""><img class="emoji" src="images/light.png" alt=""> Perfect Dark Mode
22+
h1.mb-3.title(class="md:mb-0") <i class="emoji dark"></i><i class="emoji light"></i> Perfect Dark Mode
2323
button.rounded-sm.pdm-toggle.flex.flex-col.items-center(style="visibility: hidden;" class=outline)
24-
span.label <img class="emoji" src="images/light.png" alt=""> color mode
24+
span.label <i class="emoji light"></i> color mode
2525
span.text-xs (Click Me)
2626

2727
div.flex.space-x-2.justify-center(class="md:justify-start")
@@ -53,7 +53,7 @@ html(data-pdm="light dark blue")
5353
// their system color mode.
5454
p You can set the color mode, this will be saved.
5555
button.rounded-sm.pdm-toggle(style="visibility: hidden;" class=outline)
56-
span.label <img class="emoji" src="images/light.png" alt=""> color mode
56+
span.label <i class="emoji light"></i> color mode
5757
p You can reset the color mode and fallback to system color mode.
5858
button.rounded-sm.pdm-reset(class=outline) Reset
5959
p For debugging and understanding here is the saved color mode and the OS color mode.

0 commit comments

Comments
 (0)