Replies: 6 comments 4 replies
-
this is my @import 'tailwindcss';
@config '../../tailwind.config.cjs';
/*
The default border color has changed to `currentColor` in Tailwind CSS v4,
so we've added these compatibility styles to make sure everything still
looks the same as it did with Tailwind CSS v3.
If we ever want to remove these styles, we need to add an explicit border
color utility to any element that depends on these defaults.
*/
@layer base {
*,
::after,
::before,
::backdrop,
::file-selector-button {
border-color: var(--color-gray-200, currentColor);
}
}
@layer components {
input {
color-scheme: light;
}
input[type="date"]::-webkit-calendar-picker-indicator {
width: 18px;
margin-top: -10px;
cursor: pointer;
}
} |
Beta Was this translation helpful? Give feedback.
-
Hey! Mind sharing your v3 config? I suspect that you disabled preflight. In v4 you can disable the resets by doing this: https://tailwindcss.com/docs/preflight#disabling-preflight |
Beta Was this translation helpful? Give feedback.
-
I discovered this is caused by using this is my config from the NextJs project I'm importing my lib into module.exports = {
plugins: {
'postcss-import': {},
'postcss-preset-env': {
stage: 1,
autoprefixer: {
grid: true,
},
},
},
}; somehow this is adding *:not(#\#),
:not(#\#):after,
:not(#\#):before,
:not(#\#)::backdrop {
box-sizing: border-box;
border: 0 solid;
margin: 0;
padding: 0;
} |
Beta Was this translation helpful? Give feedback.
-
@philipp-spiess any ideas on this? |
Beta Was this translation helpful? Give feedback.
-
Incase it help you. I change @import "tailwindcss" to |
Beta Was this translation helpful? Give feedback.
-
@layer theme, customBase, components, utilities; @import 'tailwindcss/theme.css' layer(theme); @layer customBase { This helped me from my leaking preflight css |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Problem Description:
Since upgrading from Tailwind v3 to v4, I've encountered an issue where the global reset rules defined by
are being applied to my entire project, including elements I do not intend to affect. This was not a problem when using Tailwind v3.
The issue arises when importing my custom library (which uses Tailwind v4) into my main project. The styles are overriding the intended layout and design in my main project, even though the reset should ideally only affect elements within the library itself.
Steps to Reproduce:
Expected Behavior:
The *:not(##) rule (or any other global reset) should only affect elements within the library and not the entire project. This behavior was present in Tailwind v3, but now it is impacting the broader scope of my project in v4.
Additional Context:
Environment:
Beta Was this translation helpful? Give feedback.
All reactions