Comments (5)
No, classes are added and merged but still CSS specificity decides what to run. you might want to look into https://www.npmjs.com/package/tailwind-merge
from nuxt.
Would you be able to provide a reproduction? π
More info
Why do I need to provide a reproduction?
Reproductions make it possible for us to triage and fix issues quickly with a relatively small team. It helps us discover the source of the problem, and also can reveal assumptions you or we might be making.
What will happen?
If you've provided a reproduction, we'll remove the label and try to reproduce the issue. If we can, we'll mark it as a bug and prioritize it based on its severity and how many people we think it might affect.
If needs reproduction
labeled issues don't receive any substantial activity (e.g., new comments featuring a reproduction link), we'll close them. That's not because we don't care! At any point, feel free to comment with a reproduction and we'll reopen it.
How can I create a reproduction?
We have a couple of templates for starting with a minimal reproduction:
π https://stackblitz.com/github/nuxt/starter/tree/v3-stackblitz
π https://codesandbox.io/s/github/nuxt/starter/v3-codesandbox
A public GitHub repository is also perfect. π
Please ensure that the reproduction is as minimal as possible. See more details in our guide.
You might also find these other articles interesting and/or helpful:
from nuxt.
Cannot reproduce the issue either on new repo or stackblitz
Then it is most likely not a Nuxt issue
Why do you apply both classes though if they cancel/interfere with each other? π€
FYI - Not the class applied last has the "priority" in tailwind but the order of definition (aka CSS specificity) is still relevant.
You can use !
to make it utilize "important!".
from nuxt.
Parent Component
<Child class="border border-blue-800 border-yellow-500 bg-transparent" />
Child Component
<template>
<div
class="bg-slate-700 w-20 h-20 border-8 border border-red-800"
>
TEST
</div>
</template>
Parent component CSS added to Child should override already defined CSS in child component
@manniL
from nuxt.
There is another tailwind css issue similar to current issue related to CSS specificity, css does not remain consistent when dev server is restarted.
I have recorded the issue.
https://drive.google.com/file/d/1HJ7y2opGSoUkSgCzK8qnnvyvtcPbE2ig/view?usp=drive_link
Github link for code - https://github.com/bippan1407/nuxt-explore/tree/tailwind-issue
CSS specificity while working on dev and after restarting the dev should remain same @manniL
from nuxt.
Related Issues (20)
- WebSockets for dev server not respecting HTTPS HOT 1
- The route I customized in pages:extend cannot load the custom layout. HOT 4
- useState lost reactivity on `ssr: false` HOT 2
- `definePageMeta` breaks definition/compilation of inline JSX-components HOT 2
- `selectiveClient: 'deep'` with unocss breaks components with scoped styles and `<slot />` during 'build'
- Middleware ( in definePageMeta ) isn't called in Option API components in Nuxt v3.12.1 HOT 2
- Error: Cannot find module '@nuxt/ui-templates'
- @bg-dev/nuxt-directus not working with Nuxt 3.12.2
- Nuxt 4 - defineNuxtModule using nuxt.dir.public resolve to absolute path HOT 7
- Error: Cannot find module '@nuxt/ui-templates' HOT 4
- Build size increase 7x after upgrading nuxt from 3.5.3 to 3.11.2 HOT 5
- useAsyncData unexpected behaviour when callback return falsy value HOT 5
- `nuxt-nightly` installs `nuxt` and `nitro` with `npm i`
- Type error in nuxt.config.ts for valid app.head.link[].type HOT 3
- Cannot deploy to cloudflare pages HOT 5
- module compatibility for Nuxt v4
- `typedPages` does not work without `shamefully-hoist` unless `unplugin-vue-router` is installed HOT 9
- High CPU Usage with Nuxt Dev Server in Docker HOT 4
- feat: add plugin resolved hook
- useState inside plugin is not reactive when ssr: false HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nuxt.