Remove background-color: transparent from default button styles #12063
Replies: 5 comments 5 replies
-
I have same concern |
Beta Was this translation helpful? Give feedback.
-
Do you set other backgrounds using the Tailwind classes, like If the second is the case, make sure, that you import the Tailwind CSS file first, before your custom CSS file. |
Beta Was this translation helpful? Give feedback.
-
For me the problem was really a problem of CSS (?) precedence. On a base install of Tailwind if you have:
You're going to be very frustrated because the background of your If you change the button style to:
...then all is well. It makes sense in retrospect that the most specific definition wins it's just a bit counterintuitive for me! |
Beta Was this translation helpful? Give feedback.
-
This background-color: transparent is overwriting other backgroud color CSS of button. button, |
Beta Was this translation helpful? Give feedback.
-
I had this issue as well until I moved my custom classes to inside of the export default {
content: [
"./index.html",
"./src/**/*.{js,ts,jsx,tsx}",
],
theme: {
extend: {
colors: {
ivory: "#FFFFEF",
beige: "#F5F4DB",
white: "#FFF",
yellow: "#F7F59D",
gray: "#D6D5D3",
},
fontFamily: {
'header': ["Chonburi", "serif"],
'body': ["Montserrat", "sans-serif"]
}
},
},
plugins: [],
} I am using react vite and did not have to set |
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.
-
This background-color: transparent is overwriting other backgroud color CSS of button.
button,
[type='button'],
[type='reset'],
[type='submit'] {
-webkit-appearance: button; /* 1 /
background-color: transparent; / 2 /
background-image: none; / 2 */
}
I have to be disabled preflight in config and add default reset CSS in global.css file manually to get my button background color work.
https://unpkg.com/tailwindcss@3.0.24/src/css/preflight.css
Beta Was this translation helpful? Give feedback.
All reactions