Config
Config object let's you, well, configure your Atlet application.
Here is the overall type definition of the Config object:
export type Config = {
static?: string
unocss?: UnoGenerator
}Static
With static, you can set a relative path to the folder with your static assets, for example "./static". Check more in the Static files section.
UnoCSS
Atlet comes in with a builtin support for UnoCSS, which is a CSS atomic library, similair to the Tailwind.
To setup UnoCSS, you have to provide your own instance of a UnoGenerator.
const config: Config = {
static: './static',
unocss: new UnoGenerator({
presets: [presetWind()],
}),
}As mentioned in the UnoCSS - Browser Style Reset section:
UnoCSS does not provide style resetting or preflight by default for maximum flexibility and does not populate your global CSS. If you use UnoCSS along with other CSS frameworks, they probably already do the resetting for you. If you use UnoCSS alone, you can use resetting libraries like Normalize.css.
If you want to reset your CSS, you can do so by adding a link element to either your middleware, or your layout.
const handler = await createHandler({
[MIDDLEWARE]: (props) => {
// In this case, the <link/> will only be included to the pages which are using JSX.
props.page.head.push(
<link rel="stylesheet" href="https://esm.sh/@unocss/reset@0.53.4/tailwind.css" />,
)
},
})