Skip to content

Commit 146480f

Browse files
feat: bg on nav
1 parent e74cb5c commit 146480f

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

web/src/uno.css

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/uno.config.ts

+19-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,18 @@ import { presetUno } from 'unocss'
33
import presetIcons from '@unocss/preset-icons'
44

55
export default defineConfig({
6-
rules: [],
6+
rules: [
7+
[/^bg-(.*)$/, ([, c], { theme }) => {
8+
//@ts-ignore
9+
if (theme.colors[c]) {
10+
return {
11+
//@ts-ignore
12+
color: theme.colors[c],
13+
}
14+
}
15+
}],
16+
17+
],
718
presets: [
819
presetUno(),
920
presetIcons(),
@@ -14,4 +25,11 @@ export default defineConfig({
1425
outFile: "src/uno.css"
1526
},
1627
},
28+
theme: {
29+
colors: {
30+
'pico': {
31+
'background': 'var(--background-color)',
32+
}
33+
},
34+
}
1735
})

web/views/p/header.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="container-fluid">
1+
<div class="container-fluid sticky top-0 z-50 bg-pico-background">
22
<nav>
33
<ul>
44
<li>

0 commit comments

Comments
 (0)