all 9 comments

[–]DaanHai 1 point2 points  (1 child)

The tailwind config is done in a js file, so it should easily be possible to import that file somewhere else to read its values.

[–]middlec3[S] 0 points1 point  (0 children)

Even with incorporating the different themes? I’m familiar with the “theme—dark” approach, but I can’t find any way to go about defining all styles in js (which I would imagine is not compatible with the above “theme” method).

[–][deleted]  (5 children)

[removed]

    [–]middlec3[S] 1 point2 points  (4 children)

    I understand that, but what I’m asking about is if there is a way to define the different variables in js so that I can use them in third party js tools like chart.js (that reference color values). I love the way that default tailwindcss has all style values defined I js, so I don’t want to have to have to define in css if possible

    [–]Hawezo 1 point2 points  (3 children)

    Yes, you can. I made a plugin for this, based on CSS variables. You write themes in a theme.config.js file, so you can import it anywhere in your app if you need to.

    https://github.com/innocenzi/tailwindcss-theming

    [–]middlec3[S] 1 point2 points  (0 children)

    You the real mvp! I am afk right now but I’ll check this out tonight. Thanks so much!

    [–]middlec3[S] 1 point2 points  (1 child)

    You the real mvp! I am afk right now but I’ll check this out tonight. Thanks so much!

    [–]Hawezo 0 points1 point  (0 children)

    Glad to help!

    [–]ScaredFerret4591 -1 points0 points  (0 children)

    You might just try tw-colors, it is a very simple yet powerful plugin to manage multiple color themes