Skip to content

Commit 2bab3af

Browse files
committed
feat: add shadows to icons cuz i can
1 parent 4f58f7d commit 2bab3af

File tree

7 files changed

+51
-3
lines changed

7 files changed

+51
-3
lines changed

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,14 @@
4949
"devDependencies": {
5050
"@antfu/eslint-config": "^0.38.6",
5151
"@iconify-json/ph": "^1.1.5",
52+
"@iconify/utils": "^2.1.5",
5253
"@types/dompurify": "^3.0.2",
5354
"@types/node": "^20.1.4",
5455
"@vitejs/plugin-vue": "^4.2.3",
5556
"@vueuse/core": "^10.1.2",
5657
"bumpp": "^9.1.0",
5758
"eslint": "^8.40.0",
59+
"icon-shadow": "^1.0.5",
5860
"typescript": "^5.0.4",
5961
"unbuild": "^1.2.1",
6062
"unocss": "^0.52.3",

playground/public/PhInfoBold.svg

Lines changed: 1 addition & 0 deletions
Loading

playground/public/PhMoonBold.svg

Lines changed: 1 addition & 0 deletions
Loading

playground/public/PhSunBold.svg

Lines changed: 1 addition & 0 deletions
Loading

playground/src/App.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,12 @@ function handleEnter(e: KeyboardEvent, index: number) {
115115
<div>
116116
<h1>TextStyler Playground</h1>
117117
<div flex="~ row" gap-2 items-center>
118-
<div i-ph-info-bold w-6 h-6 text-blue-6 />
118+
<div i-shadow:ph-info-bold w-8 h-8 text-blue-6 />
119119
Change the inputs' values and the styling will be updated.
120120
</div>
121121
</div>
122122
<div
123-
w-8 h-8 cursor-pointer mt-6 text-red-6 dark:text-red-5 :class="isDark ? 'i-ph-moon-bold' : 'i-ph-sun-bold'"
123+
w-10 h-10 cursor-pointer mt-6 text-red-6 dark:text-red-5 :class="isDark ? 'i-shadow:ph-moon-bold md:mr-2' : 'i-shadow:ph-sun-bold'"
124124
@click="toggleDark()"
125125
/>
126126
</div>

pnpm-lock.yaml

Lines changed: 30 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

uno.config.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,23 @@
11
import { defineConfig, presetAttributify, presetIcons, presetUno, presetWebFonts, transformerDirectives } from 'unocss'
2+
import { FileSystemIconLoader } from '@iconify/utils/lib/loader/node-loaders'
3+
import { insertShadow } from 'icon-shadow'
24

35
export default defineConfig({
46
presets: [
57
presetUno(),
68
presetAttributify(),
7-
presetIcons(),
9+
presetIcons({
10+
collections: {
11+
shadow: FileSystemIconLoader(
12+
'./playground/public',
13+
svg => insertShadow(svg, {
14+
stdDeviation: 2,
15+
opacity: 0.3,
16+
viewBoxScale: 1.5,
17+
}),
18+
),
19+
},
20+
}),
821
presetWebFonts({
922
fonts: {
1023
sans: 'Ubuntu',

0 commit comments

Comments
 (0)