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

Unexpected unknown at-rule "@screen" at-rule-no-unknown #263

Closed
avxkim opened this issue Feb 15, 2021 · 15 comments
Closed

Unexpected unknown at-rule "@screen" at-rule-no-unknown #263

avxkim opened this issue Feb 15, 2021 · 15 comments
Labels
question Further information is requested wontfix This will not be worked on

Comments

@avxkim
Copy link

avxkim commented Feb 15, 2021

"nuxt": "^2.14.12",
"@nuxtjs/tailwindcss": "^3.4.2",

Node v14

Whenever i try to use any tailwind directive except @apply it throws me an error: "Unexpected unknown at-rule "@screen" at-rule-no-unknown", nor screen, nor layer works.

Example code:

<style lang="postcss" scoped>
.navbar {
  @apply relative mx-auto px-4 flex items-center h-full;
  @screen lg {
    @apply py-6;
  }
}
</style>

tailwind.config.js:

module.exports = {
  theme: {
    extend: {
      colors: {
        body: '#edf0f1',
      },
    },
  },
}

@Atinux might be related to npm?

@avxkim avxkim added the question Further information is requested label Feb 15, 2021
Copy link
Collaborator

Atinux commented Feb 15, 2021

Can you try to upgrade to Tailwind 2?

https://tailwindcss.nuxtjs.org/setup#tailwind-2

@avxkim
Copy link
Author

avxkim commented Feb 19, 2021

Even on 2.15 it's not Tailwind 2 by default?

Copy link
Collaborator

Atinux commented Feb 26, 2021

Not yet.

@avxkim
Copy link
Author

avxkim commented Feb 28, 2021

Just followed this: https://tailwindcss.nuxtjs.org/setup#tailwind-2

yarn add --dev tailwindcss@npm:@tailwindcss/postcss7-compat postcss@^7 autoprefixer@^9

Still have this issue: Unexpected unknown at-rule "@screen"

Is this a bug?

@luismarquesfreire
Copy link

This is also not working on the latest version 4.0.1 with tailwind 2.
I can only use @screen on root css (tailwind.css), if I try using it inside a component, it gives me this specific error.

@mickaelchanrion
Copy link

As a workaround, it's possible to bypass this error from stylelint

  1. in the file stylelint.config.js, add the rule:
  rules: {
    'at-rule-no-unknown': [
      true,
      {
        ignoreAtRules: ['extends', 'tailwind', 'screen'],
      },
    ],
  },
  1. restart the nuxt dev server

@avxkim
Copy link
Author

avxkim commented Mar 25, 2021

@Atinux can you look at this? It seems like this module works only with @apply directive, other won't work, i think it's an important issue.

Copy link
Collaborator

Atinux commented Mar 25, 2021

Please create a reproduction on CodeSandBox by forking https://codesandbox.io/s/nuxt-tailwindcss-o4vn5pvp7q?from-embed

@avxkim
Copy link
Author

avxkim commented Mar 25, 2021

@stale
Copy link

stale bot commented Jun 4, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Jun 4, 2021
@stale stale bot closed this as completed Jun 16, 2021
@sovetski
Copy link

The issue still there for me with tailwind 3.3.0

@rdourado
Copy link

I am still experiencing the same issue.

@ineshbose
Copy link
Collaborator

Hi, sorry - I believe this to be a postcss thing that Tailwind. I'm not aware of a @screen rule available in the latest version of Tailwind - where does this come from? I do see this - https://tailwindcss.com/docs/functions-and-directives#screen

Please feel free to correct me if I'm wrong.

@sovetski
Copy link

Hi, sorry - I believe this to be a postcss thing that Tailwind. I'm not aware of a @screen rule available in the latest version of Tailwind - where does this come from? I do see this - https://tailwindcss.com/docs/functions-and-directives#screen

Please feel free to correct me if I'm wrong.

Oh yes very strange, I found this documentation but is it from v0 😄 https://tailwindcss-v0.netlify.app/docs/functions-and-directives/#screen

@mirobo
Copy link

mirobo commented Jun 6, 2024

@sovetski It's here to stay.. tailwindlabs/tailwindcss#7516
This also had impact on the new application builder in Angular 17 angular/angular-cli#26709 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

8 participants