question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue
"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?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10

github_iconTop GitHub Comments

5reactions
luismarquesfreirecommented, Mar 16, 2021

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.

4reactions
mickaelchanrioncommented, Mar 25, 2021

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
Read more comments on GitHub >

github_iconTop Results From Across the Web

Unexpected unknown at-rule "@screen" at-rule-no-unknown
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 ...
Read more >
css - Unexpected unknown at-rule "@tailwind" scss/at-rule-no ...
Does this help? rules: { 'at-rule-no-unknown': null, 'scss/at-rule-no-unknown': [ true, { 'ignoreAtRules': ['tailwind'] } ], }.
Read more >
@tailwind unknown at rule | The AI Search Engine You Control
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, ...
Read more >
SonarCloud: Fixing unexpected unknown at-rule @tailwind - Tim
In Sonar, go to the Quality Profiles section. The Quality Profiles screen lists out to collections of rules which are applied during analysis....
Read more >
at-rule-no-unknown - Stylelint
at-rule-no-unknown ... Disallow unknown at-rules. ... This rule considers at-rules defined in the CSS Specifications, up to and including Editor's Drafts, to be ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found