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.

In a CSS file in a class, @apply shows error in VSCode Vue 2 project, when more then 1 tailwind class is assigned

See original GitHub issue

Describe the problem:

In a css file, a class is assigned tailwind styles using @apply:

.new-activity-show {
  @apply h-80 mt-8;
}

This causes VSCode to put wiggley lines under the 2 classes and signal problems:

semi-colon expected { “resource”: “/[path]/components/NewActivity.vue”, “owner”: “generated_diagnostic_collection_name#2”, “code”: “css-semicolonexpected”, “severity”: 8, “message”: “semi-colon expected”, “source”: “css”, “startLineNumber”: 371, “startColumn”: 15, “endLineNumber”: 371, “endColumn”: 19 }

at-rule or selector expected { “resource”: “/[path]/components/NewActivity.vue”, “owner”: “generated_diagnostic_collection_name#2”, “code”: “css-ruleorselectorexpected”, “severity”: 8, “message”: “at-rule or selector expected”, “source”: “css”, “startLineNumber”: 372, “startColumn”: 1, “endLineNumber”: 372, “endColumn”: 2

}

Tailwind Intellisense is installed, which I expected to handle tailwind lasses in Vue. Maybe I am wrong on this assumption? Uninstalling it does not change anything.

I would expect that there are no error messages shown.

Link to a minimal reproduction:

Please try in VScode, because this cannot be show-cased on the playground or somewhere else. A screenshot is included.

Thank you!

Screen Shot 2021-02-10 at 12 11 03

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
adamwathancommented, Feb 10, 2021

Leaving an issue open when it is resolved doesn’t really make much sense to me, they show up in Google whether open or closed. This also isn’t a bug in the Tailwind CSS codebase itself, so really it belongs in our discussion forum as a “help” topic.

Tailwind can be used with any text editor not just VS Code, so if we started documenting that sort of thing in the Tailwind docs it would quickly grow out of control as we added instructions for VS Code, Atom, Nova, Sublime, Webstorm, etc. I’d be happy to look at a PR for the docs repo if someone wanted to contribute docs for this that were high quality and logically organized but to me this is ultimately more of a VS Code question than a Tailwind question.

For what it’s worth I think it’s important that we normalize closing issues without the ceremony of having to provide a thoughtful response, especially when the answer to the question is already in the issue. Maintaining open-source is a tremendous amount of work and being expected to provide in-depth responses to every single issue that is opened is essentially a DDOS vector for a maintainer’s life 😕 The only way to stay on top of this stuff is to process things very mechanically without having to spend the emotional energy trying to navigate unrealistic social expectations. It’s not personal, it’s just the only way to even have a chance at keeping issues and PRs under control at all.

1reaction
rowildcommented, Feb 10, 2021

Thank you, @debrice !

For others: Install the postcss extension for VSCode Add "lang=“postcss” to the style tag in a vue file.

Haven’t found any docu on that, not even on the tailwind page itself! I feel ashamed about my poor search capabilities… but maybe somebody can point out a source?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tailwind CSS classes is not working in my project?
This error is due to tailwind not finding any classes to scan in what it 'thinks' is your HTML code directories.
Read more >
unknown at rule @tailwind vue - You.com | The AI Search ...
tailwindlabs/tailwindcssIn a CSS file in a class, @apply shows error in VSCode Vue 2 project, when more then 1 tailwind class is assigned#3561....
Read more >
Editor Setup - Tailwind CSS
Plugins and configuration settings that can improve the developer experience when working with Tailwind CSS.
Read more >
How to Build a Full-Stack Single Page Application with ...
Tailwind CSS is a utility-first CSS framework packed with classes like flex, pt-4, ... We'll use it in this project to build our...
Read more >
SyntaxError: unterminated string literal - JavaScript | MDN
The JavaScript error "unterminated string literal" occurs when there is an unterminated string literal somewhere. String literals must be enclosed by single ...
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