L-Blondy / tw-colors

Tailwind plugin to easily add multiple color themes to your projects.
MIT License
464 stars 14 forks source link

3.1.2 breaks my colors #30

Closed AlanMorel closed 1 year ago

AlanMorel commented 1 year ago

Everything works on 3.1.1 but breaks on 3.1.2. I'm using Next.js and this is the relevant part of my tailwind.config.ts:

import type { Config } from "tailwindcss";
import colors from "tailwindcss/colors";
import { createThemes } from "tw-colors";

const config: Config = {
    content: ["./app/**/*.{ts,tsx}", "./src/components/**/*.{ts,tsx}"],
    plugins: [
        createThemes({
            light: {
                white: colors.white,
                black: colors.black,
                slate: colors.slate
            },
            dark: {
                white: colors.black,
                black: colors.white,
                slate: colors.slate
            }
        })
    ],
};

export default config;

If I downgrade back to 3.1.1 without touching the code, everything works as intended again. I think the changes made to support NativeWind in 3.1.2 is probably what broke it for me.

Thanks in advance for your work on this library!

L-Blondy commented 1 year ago

Hi @AlanMorel

Can you be more specific? What does not work? Can you reproduce the issue in a miniml example?

AlanMorel commented 1 year ago

The thing that's "not working" is, for example, when I use text-slate-900, I see the color correctly on 3.1.1 but it's just black on 3.1.2.

This isn't a minimal example but it's small enough to illustrate the point (my personal portfolio site's repo).

Steps to reproduce:

git clone https://github.com/AlanMorel/alanmorel.com
cd alanmorel.com
pnpm install
pnpm add tw-colors@3.1.1
pnpm dev

The colors and icons should look normal: chrome_tlCcnVgM7l

Now update to 3.1.2 and the same colors should now be black/white.

pnpm add tw-colors@3.1.2
pnpm dev

chrome_JYBBxm2zA7

I tried downgrading back to Next.js 13 and on a different machine entirely but I'm still able to repeatedly break and fix the colors just by changing between these two versions.

L-Blondy commented 1 year ago

Found the issue, fixing it right now

L-Blondy commented 1 year ago

You can update to 3.2.0