Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to the tailwind.config.js not taking effect in the xw types #24

Closed
daviesesiro opened this issue Dec 19, 2020 · 3 comments
Closed

Comments

@daviesesiro
Copy link

I adjusted the tailwindcss theme, but my changes are not showing on the xw types and it logs errors

// tailwind.config.js
module.exports = {
  darkMode: "class",
  theme: {
    extend: {
      colors: {
        green: "#00AF54",
        "yellow-dark": "#FBAF00",
        "yellow-light": "#FFD639",
        pink: "#FFA3AF",
        blue: "#007CBE",
      },
    },
  },
  variants: {},
  plugins: [],
  // xwind options
  xwind: {
    mode: "objectstyles",
  },
};
 <div
      css={xw`h-screen bg-gray-800 flex justify-center items-center bg-yellow-dark`}
    >

the error says "bg-yellow-dark is not a tailwind class, but its still works on the browser

I got the template from nextjs template for emotion and tailwindcss

Please help out🥺🥺

@Arthie
Copy link
Owner

Arthie commented Dec 19, 2020

Yes, this is a known problem that can occur when you have babel caching enabled (next.js has this by default). The babel cache should be invalidated when there is a change in the tailwind.config.js but this is currently not possible until babel adds this PR. To fix this problem you will need to delete the cached babel files located in the .next folder. I recommend deleting the cached files after tailwind.config.js changes or after updating packages. I am working on a solution that fixes this without having to wait for babel to add the feature.

@daviesesiro
Copy link
Author

Thank you very much.

@matepaiva
Copy link

I tried only deleting .next/cache, but to make the changes take effect I had to remove the whole .next folder and restarting the app. Am I doing it right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants