Skip to content

Commit 8c8f78e

Browse files
committed
fix: adjust margin and icon opacity in sidebar and headline components
1 parent 488cb9d commit 8c8f78e

File tree

9 files changed

+37
-10
lines changed

9 files changed

+37
-10
lines changed

docs/uno.config.ts

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,32 @@
11
import type { PresetWind3Theme } from 'unocss'
2+
import { dirname, resolve } from 'node:path'
3+
import { fileURLToPath } from 'node:url'
24
import { createExternalPackageIconLoader } from '@iconify/utils/lib/loader/external-pkg'
5+
import { FileSystemIconLoader } from '@iconify/utils/lib/loader/node-loaders'
36
import { defineConfig, presetIcons } from 'unocss'
47
import { presetOnmax } from 'unocss-preset-onmax'
5-
import { FileSystemIconLoader } from 'unplugin-icons/loaders'
68
import { presetNimiq } from '../packages/nimiq-css/src/index'
79

10+
const __filename = fileURLToPath(import.meta.url)
11+
const __dirname = dirname(__filename)
12+
13+
const themeIconsLoader = FileSystemIconLoader(resolve(__dirname, '../packages/nimiq-vitepress-theme/src/assets/icons'))
14+
const docsIconsLoader = FileSystemIconLoader(resolve(__dirname, './public/assets/icons'))
15+
16+
async function tryLoadIcon(loader: ReturnType<typeof FileSystemIconLoader>, name: string) {
17+
try {
18+
return await loader(name)
19+
}
20+
catch {
21+
return null
22+
}
23+
}
24+
25+
async function localIconLoader(name: string) {
26+
return (await tryLoadIcon(themeIconsLoader, name))
27+
?? (await tryLoadIcon(docsIconsLoader, name))
28+
}
29+
830
export default defineConfig<PresetWind3Theme>({
931
content: {
1032
filesystem: ['./.vitepress/config.ts', '../**/**.{vue,md}', './theme/components/**/*.vue', './config.ts'],
@@ -137,7 +159,7 @@ export default defineConfig<PresetWind3Theme>({
137159
collections: {
138160
...createExternalPackageIconLoader('@iconify-json/tabler'),
139161
...createExternalPackageIconLoader('@iconify-json/simple-icons'),
140-
local: FileSystemIconLoader('public/assets/icons'),
162+
local: localIconLoader,
141163
},
142164
}),
143165
],

packages/nimiq-icons/src/flags/icons.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1268,7 +1268,7 @@
12681268
"body": "<mask id=\"nimiq-flags-zw-hexagon-pbk987\" width=\"32\" height=\"28\" x=\"0\" y=\"2\" maskUnits=\"userSpaceOnUse\" style=\"mask-type:alpha\"><path fill=\"#fff\" d=\"M31.15 14.71 24.707 3.54a2.58 2.58 0 00-2.234-1.29H9.582c-.92 0-1.77.49-2.23 1.29L.907 14.71c-.46.8-.46 1.78 0 2.58l6.445 11.17c.46.8 1.31 1.29 2.23 1.29h12.89c.92 0 1.77-.49 2.23-1.29l6.445-11.17c.464-.8.464-1.78.004-2.58\"/></mask><g fill=\"none\"><g mask=\"url(#nimiq-flags-zw-hexagon-pbk987)\"><path fill=\"#6DA544\" d=\"M1.962 0H32v32H1.962z\"/><path fill=\"#FFDA44\" d=\"M3.613 4.581H32v4.582l-4.069 6.875 4.07 6.875v4.58H3.612z\"/><path fill=\"#D80027\" d=\"M8.25 9.162H32v4.582l-1.687 2.25L32 18.325v4.581H8.25z\"/><path fill=\"#EEE\" d=\"M0 0v32l17.488-16z\"/><path fill=\"#D80027\" d=\"m6.437 11.825 1.032 3.188h3.35l-2.713 1.975 1.038 3.187-2.713-1.969-2.712 1.969 1.037-3.187-2.712-1.976h3.35z\"/><path fill=\"#FFDA44\" d=\"m9.281 16.263-2.7-.957-.212-1.937a1.044 1.044 0 10-2.032.475l-.75.756h1.344c0 1.4-1.044 1.4-1.044 2.794l.575 1.387h3.482l.58-1.387q.086-.198.107-.413c.5-.2.65-.719.65-.719\"/><path fill=\"#333\" d=\"m1.963 0 13.75 13.75H32v4.575H15.638L1.962 32H0l16-16L0 0z\"/><path fill=\"url(#nimiq-flags-zw-hexagon-pbk987)\" d=\"M31.15 14.71 24.707 3.54a2.58 2.58 0 00-2.234-1.29H9.582c-.92 0-1.77.49-2.23 1.29L.907 14.71c-.46.8-.46 1.78 0 2.58l6.445 11.17c.46.8 1.31 1.29 2.23 1.29h12.89c.92 0 1.77-.49 2.23-1.29l6.445-11.17c.464-.8.464-1.78.004-2.58\"/></g><defs><radialGradient id=\"nimiq-flags-zw-hexagon-pbk987\" cx=\"0\" cy=\"0\" r=\"1\" gradientTransform=\"matrix(30.943 0 0 30.9452 23.829 29.395)\" gradientUnits=\"userSpaceOnUse\"><stop stop-color=\"#1D1D1B\" stop-opacity=\".3\"/><stop offset=\"1\" stop-color=\"#E9B213\" stop-opacity=\"0\"/></radialGradient></defs></g>"
12691269
}
12701270
},
1271-
"lastModified": 1758641643,
1271+
"lastModified": 1758646007,
12721272
"width": 32,
12731273
"height": 32
12741274
}

packages/nimiq-icons/src/flags/info.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"prefix": "nimiq-flags",
33
"name": "nimiq-flags",
44
"total": 422,
5-
"version": "1.0.0-beta.95",
5+
"version": "1.0.0-beta.96",
66
"author": {
77
"name": "onmax",
88
"url": "https://github.com/onmax"

packages/nimiq-icons/src/flags/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "nimiq-flags",
33
"description": "The Nimiq Flags as an iconify icon set.",
44
"version": "1.0.0-beta.96",
5-
"iconSetVersion": "1.0.0-beta.95",
5+
"iconSetVersion": "1.0.0-beta.96",
66
"main": "index.js",
77
"module": "index.mjs",
88
"types": "index.d.ts",

packages/nimiq-icons/src/icons/icons.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1586,7 +1586,7 @@
15861586
"hidden": true
15871587
}
15881588
},
1589-
"lastModified": 1758641643,
1589+
"lastModified": 1758646007,
15901590
"width": 12,
15911591
"height": 12
15921592
}

packages/nimiq-icons/src/icons/info.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"prefix": "nimiq",
33
"name": "nimiq-icons",
44
"total": 84,
5-
"version": "1.0.0-beta.95",
5+
"version": "1.0.0-beta.96",
66
"author": {
77
"name": "onmax",
88
"url": "https://github.com/onmax"

packages/nimiq-icons/src/icons/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "nimiq-icons",
33
"description": "The Nimiq Icons as an iconify icon set.",
44
"version": "1.0.0-beta.96",
5-
"iconSetVersion": "1.0.0-beta.95",
5+
"iconSetVersion": "1.0.0-beta.96",
66
"main": "index.js",
77
"module": "index.mjs",
88
"types": "index.d.ts",

packages/nimiq-vitepress-theme/build.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ export default defineBuildConfig({
5454
const srcDir = join(packageDir, 'src')
5555
const distFile = join(packageDir, 'dist/assets/uno.css')
5656
const config = join(packageDir, 'uno.config.ts')
57+
console.log({ config })
5758
await execAsync(`unocss "${srcDir}/**/*.vue" -o "${distFile}" --config "${config}"`, { cwd: packageDir })
5859
},
5960
},

packages/nimiq-vitepress-theme/uno.config.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1+
import { dirname, resolve } from 'node:path'
2+
import { fileURLToPath } from 'node:url'
13
import { createExternalPackageIconLoader } from '@iconify/utils/lib/loader/external-pkg'
24
import { FileSystemIconLoader } from '@iconify/utils/lib/loader/node-loaders'
35
import { defineConfig, presetIcons, transformerDirectives } from 'unocss'
46
import { presetOnmax } from 'unocss-preset-onmax'
57
import { presetNimiq } from '../nimiq-css/src'
68

7-
console.log('Generating unocss styles...')
9+
const __filename = fileURLToPath(import.meta.url)
10+
const __dirname = dirname(__filename)
11+
console.log('Generating unocss styles...', resolve(__dirname, './src/assets/icons'))
812

913
export default defineConfig({
1014
presets: [
@@ -21,7 +25,7 @@ export default defineConfig({
2125
presetIcons({
2226
collections: {
2327
...createExternalPackageIconLoader('@iconify-json/tabler'),
24-
local: FileSystemIconLoader('./src/assets/icons'),
28+
local: FileSystemIconLoader(resolve(__dirname, './src/assets/icons')),
2529
...createExternalPackageIconLoader('nimiq-icons'),
2630
},
2731
}),

0 commit comments

Comments
 (0)