New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Border (and maybe other) styles not working when vite builds in library mode #2285
Comments
It seems explicitly adding 'border-solid' to the classes list fixes the issue for now |
I remember not having to explicitly set border-solid few months ago but now it's required. |
Yes it is removed in #1971. If you don't want to add b-solid on every occurrence of border utilities, maybe this code would help: export default defineConfig({
variants: [
{
match(input) {
const match = input.match(/^(?:border|b)()(?:-(.+))?$/)
if (match) {
return {
matcher: input,
handle: (input, next) => {
if (input.entries[0]?.[0] === 'border-width') {
return next({
...input,
entries: [...input.entries, ['border-style', 'solid']],
})
}
},
}
}
},
},
],
presets: [
presetUno(),
presetAttributify(),
]
}) I'm not sure if this has some edge cases or not. @chu121su12 is better at this stuff than me. Let me know if you encounter any issues. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
UnoCSS version
0.50.2
Describe the bug
I'm building a standalone component library for my company, and in it I'm using unocss of course.
After building and packing, and importing it as a standalone package in another repository, everything works kind of like expected but some properties refuse to work. I can see they are correctly exported in the css file but they're just not being applied for some reason.
In this specific case, the border property is the one being ignored. Everything else styles correctly, font-sans, margins, etc...
I have tried this in a brand new project without anything else installed, so no other unocss or styling packages that could conflict.
Reproduction
Not sure how to reproduce in playground since this involves building the project in library mode and then importing it from another as a package
System Info
MacOS, tested on every browser, React 18
Validations
The text was updated successfully, but these errors were encountered: