Poimen / stencil-tailwind-plugin

Plugin for using tailwindcss with StencilJS
https://www.npmjs.com/package/stencil-tailwind-plugin
MIT License
51 stars 5 forks source link

Allow user configuration of the Tailwind configuration rather than a single object for all files #26

Closed Poimen closed 2 years ago

Poimen commented 2 years ago
    Regarding the `safelist` option in the Tailwind config. Yeah, I've tried using that but it messes up the performance when starting the project for development. Takes minutes before it starts and I don't want that πŸ˜…. Basically, I need every text and background color to be present in the Tailwind output. This is because I have an `Avatar` component that gets it background  color and text color (when profile image is not available) based on the user that is currently logged in. So, it's dynamic.

image

I've tried the following patterns to add those classes. These aren't even all the available colors and it took too long to process. I even tried adding them manually in the safelist array. So I though adding one more file that contains all the classes I want in, into the source and content option would be far more performant. So I guess that's not an option then?

safelist: [
  'ux-bg-white',
  'ux-bg-black',
  'ux-text-white',
  'ux-text-black',
  {
      pattern: /ux-bg-(gray|red|yellow|green|blue|purple)-(50|100|200|300|400|500|600|700|800|900)/
  },
  {
      pattern: /ux-text-(gray|red|yellow|green|blue|purple)-(50|100|200|300|400|500|600|700|800|900)/
  }    
],

Regarding the warning. I got a lot of components (about 40 now) with loads of TW styling, so thats why I thought the warning weird πŸ˜‰. Perhaps it is because I use ux- prefix for the TW classes? I don't know. Looks like it doesn't cause any problems though. Not sure if problems will arise in the near future while developing the UX project. I surely hope not πŸ˜€.

Originally posted by @dtaalbers in https://github.com/Poimen/stencil-tailwind-plugin/issues/23#issuecomment-1246724050

Poimen commented 2 years ago

@dtaalbers I have release v1.6.0

This should now the allow customisation that we chatted around in #23.

Just take note of the README parts on Configuration and considerations.

I'm closing this for now.

Feel free to log new issues for anything you pickup with this functionality πŸ‘

dtaalbers commented 2 years ago

Thanks! I will check it out ASAP!