daief / daisyui-vue

(WIP) Vue3 UI components based on daisyui.
https://daief.tech/daisyui-vue/components/button
Apache License 2.0
163 stars 9 forks source link

feature request: provide safelists in tailwind.config #1

Closed arily closed 1 year ago

arily commented 1 year ago

concatenated class names will not be detected by tailwind according to this tailwind's document. meanwhile tailwind has an safelisting option to keep those classes from being filtered out.

It would be much more convenient to have some pre-defined safelists for users to import. (I would assume that SSR renderes first page without critical styles will also be fixed with this.)

// safelist
export const button = [
    {
      pattern: /btn-.+/
    }
]
// tailwind.config.js
const { button } =  require('daisyui-vue/config/safelist')

module.exports = {
  safelist: [
     ...button,
  ]
}
daief commented 1 year ago

First I am glad you insterest in this project. But I guess you may submit this suggestion to daisyui.

This is a vue3 based library which does not depend on tailwind.

arily commented 1 year ago

created an issue for daisyui https://github.com/saadeghi/daisyui/issues/1155