Write vanilla HTML, CSS, and JS using REM units instead of PX, BEM-style class naming, class-only styling (no tags/IDs), no descendant selectors, simple selectors, avoid heavy utility classes and complex pseudo-selectors
| Selector Type | Example | Goes To |
|---|---|---|
| Simple class | .hero |
Webflow styleLess |
| Tag | nav {} |
Custom CSS embed |
| ID | #header {} |
Custom CSS embed |
| Descendant | .parent .child |
Custom CSS embed |
| Compound | .card.active |
Custom CSS embed |
| Pseudo-class | :hover, :nth-child |
Custom CSS embed |
| Pseudo-element | ::before, ::after |
Custom CSS embed |
Always routed to custom CSS regardless of property:
var(--anything)— CSS variablesclamp(min, preferred, max)— fluid sizingenv(safe-area-inset-*)— device safe areas
- Use event delegation (addEventListener) instead of inline
onclick - Use
querySelectorAll + addEventListenerpattern - Class toggle patterns need the toggled class in CSS (converter auto-detects unreferenced classes)
- SVGs become HtmlEmbed nodes with
display:block;margin:0 autocentering - For complex SVGs, consider using
<img>with SVG src
- Use
<section>for top-level sections (maps to Webflow Section type) - Use semantic HTML (maps to correct Webflow types)
- Keep nesting reasonable — deep nesting creates many nodes