Create A CSS File
Create a plain CSS file and add any rules you need; the styles will be applied to every page in the specified directory.
/fragment/css/common/test.css
div{color: red}
copy
Configuring CSS Common Fragment
In the ref object, add a css property.
Inside it, create a common object whose keys are absolute directory paths whose pages need styling and whose values are arrays of absolute paths to the CSS fragments that should be injected onceโon reload, route change, or a cleanup() call.
export const ref = {
css: {
common: {
"/docs/": ["/fragment/css/Common/test.css"]
}
}
}
copy
๐ Note
Always use absolute path