Closed JohnCampionJr closed 3 years ago
I've figured out that the styles are being imported, but they seem to be overridden somewhere along the way. I don't know if this is a bug in windicss or Vite-plugin-windicss
This is coming from the plugin
input {
-webkit-writing-mode: horizontal-tb !important;
text-rendering: auto;
color: -internal-light-dark(black, white);
letter-spacing: normal;
word-spacing: normal;
text-transform: none;
text-indent: 0px;
text-shadow: none;
display: inline-block;
text-align: start;
appearance: textfield;
background-color: -internal-light-dark(rgb(255, 255, 255), rgb(59, 59, 59));
-webkit-rtl-ordering: logical;
cursor: text;
margin: 0em;
font: 400 13.3333px Arial;
padding: 1px 2px;
border-width: 2px;
border-style: inset;
border-color: -internal-light-dark(rgb(118, 118, 118), rgb(133, 133, 133));
border-image: initial;
}
But its being overridden by this
*, ::before, ::after {
-webkit-box-sizing: border-box;
box-sizing: border-box;
border-width: 0;
border-style: solid;
border-color: #e5e7eb;
}
Is the forms plugin being imported too early perhaps?
@JohnCampionJr Which one comes first in your css?
@JohnCampionJr Which one comes first in your css?
I'll have to check the generated CSS, but in my code, none. I only added the forms plug-in to an empty vitesse project.
@JohnCampionJr Which one comes first in your css?
@antfu I'm back to thinking its not imported. I can see the prose classes showing up and disappearing when I enable/disable the typography plugin. There is no change at all to the generated code whether or not I have the forms plugin enabled.
I just realized the input CSS I pasted above is saying its from the browser, not the app's CSS. So the forms plugin is definitely not being imported.
I don't see any of the forms' CSS in my pages, neither.
The generated css priority seems to be lower than the style tag style in SFC
I don't have any styles in the SFC. I don't see the classes at all in the generated CSS
EDIT: Since v0.4.x it's fixed, the workaround is no longer needed.
As a workaround for now, you can set
// vite.config.js
WindiCSS({
preflight: {
enableAll: true,
},
})
in v0.3.2
OK, just in case it matters, this rule is still overriding the forms CSS on selects
button, input, optgroup, select, textarea {
font-family: inherit;
font-size: 100%;
line-height: 1.15;
margin: 0;
padding: 0;
line-height: inherit;
color: inherit;
}
Still seems to be broken for <select>
s in v1.0.4. The padding
is set to 0
, since the
button, input, select { ... }
style overrides the
[type='text'], [type='email'], [type='url'], [type='password'], [type='number'], [type='date'], [type='datetime-local'], [type='month'], [type='search'], [type='tel'], [type='time'], [type='week'], [multiple], textarea, select { ... }
style.
Still seems to be broken for
<select>
s in v1.0.4. Thepadding
is set to0
, since thebutton, input, select { ... }
style overrides the
[type='text'], [type='email'], [type='url'], [type='password'], [type='number'], [type='date'], [type='datetime-local'], [type='month'], [type='search'], [type='tel'], [type='time'], [type='week'], [multiple], textarea, select { ... }
style.
same here
OK, just in case it matters, this rule is still overriding the forms CSS on selects
@JohnCampionJr Please do you have a workaround for this.
Thanks
I have the same issue.
Is the forms plugin working with
vite-plugin-windicss
?I'm adding it to the tailwind.config
But the styles aren't coming through....