Closed jordin-marshall closed 7 months ago
Radonis uses UnoCSS by default, which means DaisyUI would need a plugin which is compatible with UnoCSS. You can however just setup Tailwind like you would normally, and include the compiled Tailwind styles via ˋwithHeadTagsˋ. You would need to run the Tailwind CLI manually.
@microeinhundert So I'd have to add the following code to every Controller render return? There's currently no other way to include it on all pages?
.withHeadTags([{
name: 'link href="css/custom.css"',
content: '',
}])
You can use a middleware.
Thank you for your quick responses, creating a middleware solved everything.
For anyone else who stumbles upon this while looking for a solution, the middleware "example" code is:
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
export default class AppendHeadTagsGlobal {
async handle({ radonis }: HttpContextContract, next: () => Promise<void>) {
await next();
radonis.withHeadTags([
{
name: 'link rel="stylesheet" href="custom.css"',
content: ''
},
]);
}
}
You should add the attributes to the link tag via the "attributes" property, not as part of the name.
Description
With this not using webpack and I'm not sure how everything is being built with esbuild, how would one go about adding Tailwind w/ Daisy UI? For the life of me, I can't figure it out
Package Version
5.0.4
Error Message & Stack Trace
Relevant Information