Code Monkey home page Code Monkey logo

Comments (4)

RonMelkhior avatar RonMelkhior commented on July 22, 2024

Odd, do other variants get preserved? i.e hover: etc.

I'd need some more info to help out

from tailwindcss-dir.

jonadeline avatar jonadeline commented on July 22, 2024

Actually this is more odd than I thought when I build locally the tailwindcss-dir rules are in the css but when deploying (on Vercel) it's not there 😭

And to answer your question, yes the other variants are preserved.

from tailwindcss-dir.

jonadeline avatar jonadeline commented on July 22, 2024

Ok finally I'm able to reproduce locally.
I was not running the build with the NODE_ENV to prod that's why I didn't have the same output than on Vercel 😑

So definitely this is a purgecss issue (when I disable it, the ltr and rtl rules works on the built version).

So I tried to add some whitelist patterns in tailwind.conf like below but with no success.

Do you think there is a way to make tailwind-dir compatible with purgecss ?

module.exports = {
  purge: {
    content: ["./src/**/*.svelte"],
    options: {
      whitelistPattern: ["/svelte-/", "/ltr/", "/rtl/"],
    },
  },
  theme: {
    extend: {
      colors: {
        green: {
          default: "#9cce63",
          dark: "#799a53",
        },
        brown: "#b69b83",
      },
    },
  },
  plugins: [
    require("tailwindcss-dir")(),
    require("@neojp/tailwindcss-line-clamp-utilities"),
    require("@tailwindcss/custom-forms"),
  ],
  variants: {
    backgroundColor: ["responsive", "hover", "focus", "active"],
    margin: ["responsive", "direction"],
    padding: ["responsive", "direction"],
    lineClamp: ["responsive"],
    boxShadow: ["focus-within"],
  },
};

from tailwindcss-dir.

jonadeline avatar jonadeline commented on July 22, 2024

Finally I came across this issue providing the answer 🥳

tailwindlabs/tailwindcss#1931

It would be interesting to add a note in the doc for this I think.

from tailwindcss-dir.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.