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

[3.x] Transforms not working (Laravel Mix) #6432

Closed
marcreichel opened this issue Dec 12, 2021 · 10 comments
Closed

[3.x] Transforms not working (Laravel Mix) #6432

marcreichel opened this issue Dec 12, 2021 · 10 comments

Comments

@marcreichel
Copy link

marcreichel commented Dec 12, 2021

What version of Tailwind CSS are you using?

v3.0.1

What build tool (or framework if it abstracts the build tool) are you using?

  • Laravel 8.75
  • Laravel Mix 6.0.39

What version of Node.js are you using?

14.17.0

What browser are you using?

Chrome

What operating system are you using?

macOS

Reproduction URL

https://github.com/marcreichel/tailwind3-transforms-reproduction (Deleted)

Screenshot:

image

Describe your issue

The "base transform" selector is not generated. Therefore any transform utilities do not work.
Basically there should be at least the following css code:

.rotate-90, .translate-x-1\/2 {
    /* --tw-... */
    transform: rotate(var(--tw-rotate)) translateX(var(--tw-translate-x)) /* and so on ... */;
}

But this is completely missing.

@adamwathan
Copy link
Member

Just had two seconds to look but it appears this works if you switch to:

@tailwind base;
@tailwind components;
@tailwind utilities;

...instead of doing the imports. Not sure why, will get it looked into this week though!

@marcreichel
Copy link
Author

Confirmed! Thanks a lot!

Are the imports not the "go to" for SCSS anymore? Thought for SCSS we have to use the imports instead of the @tailwind directives.

But good to know it is working with the directives.

Again: Thanks a lot! 💙

@ivan-bragin
Copy link

Got the same issue. Tried to import tailwind base in every possible way(scss import, @tailwind base, import "tailwind/tailwind.css";). In my case @apply backdrop-blur doesn't work cause --tw-backdrop-filter is not defined. It seems that defaults are not being created. Project configuration is basically default freshly created vite + vue app with create-vue and added postcss

@little3201
Copy link

little3201 commented Dec 13, 2021

same question

@keithn
Copy link

keithn commented Dec 13, 2021

in vite + vue + tailwind 3.0 I also see that it doesn't seem to generate the css classes, I can definitely see the classes update on the dom, it just doesn't show any generated css. If I stop vite and restart it, then they get generated.

@tarasmelnychuk
Copy link

tarasmelnychuk commented Dec 13, 2021

Same issue with gatsby, in css I have @apply md:translate-y-10; and then in inspector I see

Screenshot 2021-12-13 at 15 08 50

I have

@tailwind base;
@tailwind components;
@tailwind utilities;

in global.css

tailwindcss@3.0.1
gatsby@4.3.0

@adamwathan
Copy link
Member

Most of these comments are not about the main issue here (which is specific to Sass imports), they are actually this issue:

#6409 (comment)

...which is that you cannot use @apply inside a CSS module/Svelte component/Vue component to apply a class that provides @defaults (internal detail).

@thecrypticace
Copy link
Contributor

You can either use the @tailwind directives or @import but they need to not have extensions. When you import the files with a .css extension each file is run through postcss individually before being returned to sass for further compilation which will cause things to break (there's also just other weird issues with .css imports & sass in general). The imports should be written without the extension like this:

@import "tailwindcss/base";
@import "tailwindcss/components";
@import "tailwindcss/utilities";

This also mirrors our installation instructions on this page. Also note that the ~ prefix is not required by sass-loader anymore and as such has been deprecated.

@marcreichel
Copy link
Author

@thecrypticace Thanks! I would consider adding this to the upgrade guide as I upgraded from 2.x where everything was working fine to 3.x where things broke because of this.

@aje
Copy link

aje commented Oct 11, 2022

I use Tailwind and NextUI together, and I don't want to import Tailwind's "base" since it will break NextUI's base styles. Is there any way to do this?

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