CSS
Stylesheet files
Template stylesheet, served sanitized at /templates/<name>/styles.css and linked after the shared styles. style.css is accepted as an alternative name (styles.css wins on /styles.css, style.css wins on /style.css; the page links /style.css). server.js:1084
Cascade order
- Bootstrap 5.3.2 (CSS only) and Font Awesome from the approved CDNs
- Self-hosted fonts from
assets.fonts /assets/storefront/core.css(always)/assets/storefront/kit.css(whenassets.kitis true)- the branding custom properties (
#sf-theme-tokens) - your stylesheet
What the CSS sanitizer changes
- @import rules are removed
- url(http://…), url(https://…) and url(//…) become "none"
- expression(), behavior: and -moz-binding: are removed
security.js:504
The pattern that removes
behavior: also matches the end of scroll-behavior:, so scroll-behavior declarations are removed too. The validator warns about it (css-scroll-behavior).Images in CSS
CSS url() values are not rewritten: write url(/image/hero.jpg) (absolute path). Relative url(image/…) resolves against the stylesheet URL (/templates/<name>/) and fails; external URLs become none.
Custom properties
See Theme system.