Skip to content

Fix border-widths that crash Vite when compiling#1356

Open
Floppy wants to merge 2 commits into
thomaspark:v5from
manyfold3d:fix-border-width-vite-crash
Open

Fix border-widths that crash Vite when compiling#1356
Floppy wants to merge 2 commits into
thomaspark:v5from
manyfold3d:fix-border-width-vite-crash

Conversation

@Floppy

@Floppy Floppy commented Jun 11, 2026

Copy link
Copy Markdown

I've been using sassc to build my CSS for ages, and bootswatch has been working great. However, I changed to Vite recently, and it would crash without any extra info when compiling the Vapor theme. I narrowed it down to this $border-width variable - if it's set to 0, it crashes, if it's 0px it works fine.

I don't know why this is the case either on the Vite or the Bootswatch side, but it does seem to fix it. I wondered if some calculation is done elsewhere inside Bootstrap using border-width that gets confused if the px specifier isn't included, perhaps.

Floppy added 2 commits June 11, 2026 15:17
Set to 0px instead of 0
Set to 0px instead of 0 to fix compilation crash with Vite
@Floppy

Floppy commented Jun 11, 2026

Copy link
Copy Markdown
Author

OK, I found out where it's going wrong; I'm also including tom-select, which has this in it:

min-height: calc(1.5em + 0.5rem + calc(var(--bs-border-width) * 2));

So, yeah, I guess Vite is crashing because of that calculation and the fact that the border-width as set is dimensionless.

@Floppy

Floppy commented Jun 11, 2026

Copy link
Copy Markdown
Author

BTW, I appreciate that this might well be the wrong place to fix my problem. I'm trying to create a reproduction for Vite as it's probably their bug at heart, but haven't got there yet. This PR is open in case it's a useful change for you anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant