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

Tailwind 2 #20

Open
microliving opened this issue Dec 8, 2020 · 10 comments
Open

Tailwind 2 #20

microliving opened this issue Dec 8, 2020 · 10 comments

Comments

@microliving
Copy link

Hi here,
Any chance to upgrade to Tailwind 2 by any chance?

@kayue
Copy link

kayue commented Jan 17, 2021

@microliving This works in Tailwind 2

@Circuit8
Copy link

Circuit8 commented Jan 20, 2021

Also struggling with this. Given the config below I'm expecting user:background-green-100 and driver:background-green-100 to be generated css classes but not having any luck. Using tailwind 2.0.1 and twilwindcss-multi-theme 1.0.4. Thanks in advance.

const defaultTheme = require('tailwindcss/defaultTheme')

module.exports = {
  future: {
    removeDeprecatedGapUtilities: true,
    purgeLayersByDefault: true,
  },
  purge: {
    options: {
      safelist: ['type'],
    },
    preserveHtmlElements: true,
    content: [
      './app/views/**/*.erb',
      './app/components/**/*.erb',
      './app/components/**/*.rb',
      './app/helpers/*.rb',
      './app/javascript/controllers/**/*.js',
    ],
  },
  theme: {
    extend: {
      fontFamily: {
        sans: ['Inter var', ...defaultTheme.fontFamily.sans],
      },
    },
    themeVariants: ['user', 'driver'],
  },
  variants: {
    extend: {
      textColor: ['user', 'driver'],
      backgroundColor: ['user', 'driver'],
    },
  },
  plugins: [require('@tailwindcss/forms'), require('tailwindcss-multi-theme')],
}

@kayue
Copy link

kayue commented Jan 20, 2021

@Circuit8 Seems correct. Have you tried disable the purge?

@simmerz
Copy link

simmerz commented Jan 20, 2021

@kayue went too early! purge disabled and it works! Now how to enable the purge to keep the built size small? Do we add the variants to the safelist?

@kayue
Copy link

kayue commented Jan 20, 2021

@simmerz Glad to hear that. Purge options actually works for me, but I have a simpler setup. You might want to play with the purge settings.

    purge: {
        enabled: false,
        content: [
            './assets/**/*',
            './templates/**/*',
            './themes/**/*',
            './.storybook/preview.js',
            './stories/**/*',
        ],
    },

@codemem
Copy link

codemem commented Feb 18, 2021

It's also not working for me with tailwind2.0.2

purge: ['./components/**/*.{js,ts,jsx,tsx}', './pages/**/*.{js,ts,jsx,tsx}', './styles/**/*.{css}'],
  theme: {
    themeVariants: ['dark', 'founder'],
  },
  variants: {
    backgroundColor: ['responsive', 'hover', 'founder', 'focus', 'dark', 'dark:hover', 'dark:focus'],
    textColor: ['responsive', 'hover', 'focus', 'founder', 'dark', 'dark:hover', 'dark:focus'],
  },
  plugins: [require('tailwindcss-multi-theme')],

any luck for tailwind2

@codemem
Copy link

codemem commented Feb 18, 2021

@simmerz Glad to hear that. Purge options actually works for me, but I have a simpler setup. You might want to play with the purge settings.

    purge: {
        enabled: false,
        content: [
            './assets/**/*',
            './templates/**/*',
            './themes/**/*',
            './.storybook/preview.js',
            './stories/**/*',
        ],
    },

it's working fine with purge: false => but it's not working with production build

@kcsf
Copy link

kcsf commented Mar 19, 2021

Doesn't work with tailwind2x. Nor can I update from 1.03 to 1.04:

npm ERR! Could not resolve dependency:
npm ERR! peer tailwindcss@"^1.4.6" from [email protected]
npm ERR! node_modules/tailwindcss-multi-theme
npm ERR! tailwindcss-multi-theme@"*" from the root project

the package.json lists "tailwindcss": "1.4.6" as a dependency. and that is removed per the Tailwind 2.x upgrade instructions.

@dariorinaldi
Copy link

The problem is the version in the peerDependecies, which is not compatible with the v2.
So if you're using the v2 in the host project, the new Arborist from NPM7 shots those errors.

@tiznull
Copy link

tiznull commented Sep 3, 2022

I believe this package is abandoned and should be marked as such. No updates for two years, tailwind dependencies are very outdated. Projects that are using this package cannot update anymore. It would be great if the person that developed this package offered an alternative.

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

8 participants