Welcome to Vanilla Breeze
This bell pulls live notifications from /go/notify/messages — the same contract documented at /docs/concepts/service-contracts/. Static articles like this one are the no-JS / no-backend fallback.
This bell pulls live notifications from /go/notify/messages — the same contract documented at /docs/concepts/service-contracts/. Static articles like this one are the no-JS / no-backend fallback.
Troubleshooting common issues with Vanilla Breeze: CSS not loading, custom elements not working, theme problems, and more.
Symptoms: Page looks unstyled, elements have browser defaults.
Check these things:
vanilla-breeze.css. Check for 404 errors.
<link rel="stylesheet" href="https://unpkg.com/vanilla-breeze/dist/cdn/vanilla-breeze.css">
<head>, not <body>.
Symptoms: Basic elements styled, but layout elements or tokens don't work.
Possible causes:
all: initial on parent elements.
@layer. Very old browsers may not support this.
Symptoms: DevTools shows custom properties as invalid or crossed out.
Check these things:
var(--color-text) not var(--Color-Text).
--size-, not --space-.
Reference the Design Tokens documentation for exact token names.
Symptoms: <layout-stack>, <layout-grid> etc. don't apply layout.
Check these things:
display: flex or display: grid.
data-layout-gap="m" not gap="m" or class="gap-m".
xs, s, m, l, xl), not arbitrary values.
<!-- Correct --><layout-stack data-layout-gap="m"> <p>Child 1</p> <p>Child 2</p></layout-stack> <!-- Wrong: missing data- prefix --><layout-stack gap="m">...</layout-stack> <!-- Wrong: invalid value --><layout-stack data-layout-gap="20px">...</layout-stack>
Symptoms: Items stack vertically instead of forming a grid.
Check these things:
layout-grid uses auto-fit with a minimum item width. If the container is narrower than data-min, items will stack.
<!-- Items need at least 200px each --><layout-grid data-layout-min="200px" data-layout-gap="m"> <div>Item</div> <div>Item</div> <div>Item</div></layout-grid>
Symptoms: Custom element renders but doesn't match expected appearance.
Check these things:
<layout-grid data-layout-min="200px">
display: contents or all: unset that might override.
Symptoms: <accordion-wc>, <tab-set> etc. render but don't respond to clicks.
Check these things:
vanilla-breeze.js.
<script type="module" src="https://unpkg.com/vanilla-breeze/dist/cdn/vanilla-breeze.js"></script>
customElements.get('accordion-wc')// Should return the class, not undefined/code-block </li> </ol> </layout-stack> </details> <details> <summary>Component works but animations are jerky</summary> <layout-stack data-layout-gap="m"> <p><strong>Symptoms:</strong> Accordion/tabs animate but not smoothly.</p> <p><strong>Possible causes:</strong></p> <ol> <li> <strong>prefers-reduced-motion is set:</strong> Animations are disabled when the user has requested reduced motion. This is intentional. </li> <li> <strong>Heavy content:</strong> Complex content inside animated regions may cause jank. Consider simplifying. </li> <li> <strong>Browser DevTools open:</strong> DevTools can slow down animations. Try with DevTools closed. </li> </ol> </layout-stack> </details> <details> <summary>Icons don't appear</summary> <layout-stack data-layout-gap="m"> <p><strong>Symptoms:</strong> <code><icon-wc></code> elements are empty or show wrong icon.</p> <p><strong>Check these things:</strong></p> <ol> <li> <strong>JavaScript is loaded:</strong> Icons require the JS bundle. </li> <li> <strong>Icon name is valid:</strong> Icons use Lucide names. Check the <a href="/docs/elements/web-components/icons/">icon documentation</a> for available names. <code-block language="html" label="Icon usage" data-escape><!-- Valid icon names --><icon-wc name="home"></icon-wc><icon-wc name="search"></icon-wc><icon-wc name="settings"></icon-wc> <!-- Invalid: wrong name --><icon-wc name="house"></icon-wc> <!-- Use "home" -->
Symptoms: Dropdown menu appears offset or in unexpected location.
Possible causes:
overflow: hidden, the dropdown may be clipped.
<drop-down position="bottom-start"><drop-down position="bottom-end"><drop-down position="top-start">
Symptoms: Page stays in light mode regardless of system preference.
Check these things:
theme-picker, it may have stored a preference. Try clearing localStorage:
localStorage.removeItem('vb-theme');location.reload();
<html> element should have data-theme="dark" when in dark mode.
Symptoms: Text is hard to read or colors don't look right in dark mode.
Check these things:
/* Good: adapts to dark mode */color: var(--color-text);background: var(--color-surface); /* Bad: doesn't adapt */color: #333;background: white;
Symptoms: Selected theme resets on page reload.
Check these things:
console.log(localStorage.getItem('vb-theme'));// Should show your selected theme/code-block </li> </ol> </layout-stack> </details> </accordion-wc> </section> <!-- Specificity Section --> <section id="specificity"> <h2>CSS Specificity</h2> <accordion-wc> <details> <summary>My custom styles aren't applying</summary> <layout-stack data-layout-gap="m"> <p><strong>Symptoms:</strong> You've written custom CSS but Vanilla Breeze styles take precedence.</p> <p><strong>Solutions:</strong></p> <ol> <li> <strong>Load your CSS after Vanilla Breeze:</strong> <code-block language="html" label="Load order"><!-- Vanilla Breeze first --><link rel="stylesheet" href="vanilla-breeze.css"><!-- Your styles second --><link rel="stylesheet" href="my-styles.css">
/* Your styles outside layers win */button.my-button { background: purple;} /* Or define your layer after VB's layers */@layer vb, my-overrides; @layer my-overrides { button.my-button { background: purple; }}
Symptoms: Local development looks right, but production build has style issues.
Check these things:
Symptoms: Build error about missing module or unresolved import.
Note: npm package is available. For CDN usage:
<!-- In your HTML --><link rel="stylesheet" href="https://unpkg.com/vanilla-breeze/dist/cdn/vanilla-breeze.css"><script type="module" src="https://unpkg.com/vanilla-breeze/dist/cdn/vanilla-breeze.js"></script>
Symptoms: Server-rendered pages don't style custom elements.
Solutions:
<layout-stack> etc. work server-side because they're pure CSS.
<accordion-wc> enhance on the client. The native HTML (<details>) works before JS loads.
Vanilla Breeze targets modern evergreen browsers:
| Browser | Supported Versions |
|---|---|
| Chrome | Last 2 versions |
| Firefox | Last 2 versions |
| Safari | Last 2 versions |
| Edge | Last 2 versions |
:has() won't work.Vanilla Breeze uses these modern features:
@layerIf this guide didn't solve your problem: