Advanced Configuration for UnoCSS: Need Guidance #768
-
|
In a similar vein to #584, I have some questions/problems with the UnoCSS plugin. For an advanced configuration with UnoCSS, one might have: export default defineConfig({
content: {
filesystem: ["_includes/components/*.vto", "_includes/components/**/*.vto"],
},
presets: [
presetWind4({
preflights: {
reset: true,
theme: {
mode: "on-demand",
},
},
}),
presetTypography(),
presetIcons(),
presetWebFonts({
themeKey: "font",
provider: "bunny",
fonts: {
// IBM Plex Sans for the site
sans: "IBM Plex Sans",
// Atkinson Hyperlegible for post content
"post-content": "Atkinson Hyperlegible",
// IBM Plex Mono for code blocks
mono: "IBM Plex Mono",
},
}),
],
transformers: [ transformerCompileClass() ],
theme: {
colors: {
// lots of colors
},
},
shortcuts: {
// lots of shortcuts
},
rules: [
// some rules
],
preflights: [
// some preflight stuff
],
});This does make Using So that's one thing, and using the compile class transformer shows another massive error: Okay, so, well, maybe we can use the config file and import it into // in uno.config.ts
import type { UserConfig } from 'npm:unocss';
import {
defineConfig,
presetIcons,
presetTypography,
presetWebFonts,
presetWind4,
transformerCompileClass,
} from "npm:unocss";
const userConfig: UserConfig<object> = defineConfig({ /* our big config */});
export default userConfig;// in _config.ts
import userConfig from "./uno.config.ts";
site.use(
unocss({
options: userConfig,
reset: "tailwind",
}),
);Nope, another error: Maybe this is just a Deno thing and add a special comment to tell Deno to shutup fixes this, but I'm not sure. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I think Deno is mixing different npm versions of unocss with different types. ( |
Beta Was this translation helpful? Give feedback.
I think Deno is mixing different npm versions of unocss with different types. (
@[email protected]and@[email protected]).Try to import the version used by Lume, which is 66.2.0 (https://github.com/lumeland/lume/blob/v3.0.4/deps/unocss.ts)