diff --git a/package.json b/package.json index 6a77131..a373192 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,8 @@ "@iconify-json/solar": "^1.1.9", "@types/node": "^20.12.12", "@unocss/cli": "^0.60.3", + "@unocss/core": "^0.60.4", + "@unocss/preset-mini": "^0.60.4", "@unocss/rule-utils": "^0.60.4", "unocss": "^0.60.3" } diff --git a/pages/homepage.templ b/pages/homepage.templ index c3346a6..d15c476 100644 --- a/pages/homepage.templ +++ b/pages/homepage.templ @@ -67,7 +67,9 @@ templ Homepage() { {Text: "blog", Link: templ.SafeURL("#blog")}, {Text: "contact", Link: templ.SafeURL("#contact")}, }) -
+
=14'} dependencies: - '@unocss/core': 0.60.3 + '@unocss/core': 0.60.4 magic-string: 0.30.10 dev: true diff --git a/uno.config.js b/uno.config.js index d7afee3..6f723d4 100644 --- a/uno.config.js +++ b/uno.config.js @@ -9,6 +9,7 @@ import { } from 'unocss'; import { definePreset } from 'unocss'; import { variantGetParameter } from '@unocss/rule-utils'; +import { colorResolver, parseColor } from '@unocss/preset-mini/utils'; import * as utils from './uno-utils.js'; @@ -61,7 +62,6 @@ const presetContainers = definePreset( if (variant) { const [match, rest, label] = variant; const unit = utils.bracket(match); - console.log(match, rest, label) /** @type {string | undefined } */ let container; @@ -112,6 +112,26 @@ export default defineConfig({ 'yellow': '#f9e2af', }, }, + rules: [ + [ + 'scrollbar', + { + 'scrollbar-color': 'var(--un-scrollbar-thumb, #ddd) var(--un-scrollbar-track, #f5f5f5)', + }, + ], + [ + /^(?:scrollbar-)?thumb-(?:color-)?(.+)$/, + // @ts-expect-error + colorResolver('--un-scrollbar-thumb', 'scrollbar-thumb'), + { autocomplete: 'scrollbar-thumb-$colors' }, + ], + [ + /^(?:scrollbar-)?track-(?:color-)?(.+)$/, + // @ts-expect-error + colorResolver('--un-scrollbar-track', 'scrollbar-thumb'), + { autocomplete: 'scrollbar-track-$colors' }, + ], + ], cli: { entry: { patterns: [