Loading...
Loading...
Apply when deciding, designing, or implementing FastStore theme customizations in src/themes/ or working with design tokens and SCSS variables. Covers global tokens, local component tokens, Sass variables, CSS custom properties, and Brandless architecture. Use for any visual customization of FastStore storefronts that does not require component overrides.
npx skill4agent add vtexdocs/ai-skills faststore-themingsrc/themes/custom-theme.scss[data-fs-*]faststore-overridesfaststore-state-managementfaststore-data-fetching:root[data-fs-*][data-fs-*].fs-*src/themes/custom-theme.scssvar(--fs-*)style={}style={{style={@faststore/ui@faststore/core// src/themes/custom-theme.scss
// Override the BuyButton's primary background color using design tokens
[data-fs-buy-button] {
--fs-button-primary-bkg-color: #e31c58;
--fs-button-primary-bkg-color-hover: #c4174d;
--fs-button-primary-text-color: var(--fs-color-text-inverse);
[data-fs-button-wrapper] {
border-radius: var(--fs-border-radius-pill);
}
}// WRONG: Using inline styles on a FastStore component
import { BuyButton } from '@faststore/ui'
function ProductActions() {
return (
<BuyButton
style={{ backgroundColor: '#e31c58', color: 'white', borderRadius: '999px' }}
>
Add to Cart
</BuyButton>
)
// Inline styles bypass the design token hierarchy.
// They cannot be changed store-wide from the theme file.
// They do not respond to dark mode or other theme variants.
}src/themes/custom-theme.scsssrc/themes/custom-theme.scss--fs-src/themes/src/themes/custom-theme.scss// src/themes/custom-theme.scss
// Global token overrides — applied store-wide
:root {
--fs-color-main-0: #003232;
--fs-color-main-1: #004c4c;
--fs-color-main-2: #006666;
--fs-color-main-3: #008080;
--fs-color-main-4: #00b3b3;
--fs-color-accent-0: #e31c58;
--fs-color-accent-1: #c4174d;
--fs-color-accent-2: #a51342;
--fs-text-face-body: 'Inter', -apple-system, system-ui, BlinkMacSystemFont, sans-serif;
--fs-text-face-title: 'Poppins', var(--fs-text-face-body);
--fs-text-size-title-huge: 3.5rem;
--fs-text-size-title-page: 2.25rem;
}
// Component-specific token overrides
[data-fs-price] {
--fs-price-listing-color: #cb4242;
}// src/styles/my-theme.scss
// WRONG: This file is in src/styles/, not src/themes/
// FastStore will NOT import this file. Token overrides will be ignored.
:root {
--fs-color-main-0: #003232;
--fs-color-accent-0: #e31c58;
}
// Also WRONG: Creating a theme in the project root
// ./theme.scss — this will not be discovered by the build systemdata-fs-*data-fs-buttondata-fs-pricedata-fs-hero.fs-*buttonh1div[data-fs-*]// src/themes/custom-theme.scss
// Target the Hero section using its data attribute
[data-fs-hero] {
--fs-hero-text-size: var(--fs-text-size-title-huge);
--fs-hero-heading-weight: var(--fs-text-weight-bold);
[data-fs-hero-heading] {
text-transform: uppercase;
letter-spacing: 0.05em;
}
[data-fs-hero-image] {
border-radius: var(--fs-border-radius);
filter: brightness(0.9);
}
}// src/themes/custom-theme.scss
// WRONG: Targeting by class names — these are internal and may change
.fs-hero {
font-size: 3.5rem;
}
.fs-hero h1 {
text-transform: uppercase;
}
// WRONG: Using generic tag selectors
section > div > h1 {
font-weight: bold;
}
// These are fragile selectors that break when FastStore restructures its HTML.src/
└── themes/
└── custom-theme.scss ← main entry point (auto-imported by FastStore)// src/themes/custom-theme.scss
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Poppins:wght@600;700;800&display=swap');
// Global Token Overrides
:root {
--fs-color-main-0: #003232;
--fs-color-main-1: #004c4c;
--fs-color-accent-0: #e31c58;
--fs-color-accent-1: #c4174d;
--fs-text-face-body: 'Inter', -apple-system, system-ui, sans-serif;
--fs-text-face-title: 'Poppins', var(--fs-text-face-body);
}
// Component-specific overrides
[data-fs-button] {
--fs-button-border-radius: var(--fs-border-radius-pill);
&[data-fs-button-variant="primary"] {
--fs-button-primary-bkg-color: var(--fs-color-accent-0);
--fs-button-primary-bkg-color-hover: var(--fs-color-accent-1);
--fs-button-primary-text-color: var(--fs-color-text-inverse);
}
}
[data-fs-price] {
--fs-price-listing-color: #cb4242;
--fs-price-listing-text-decoration: line-through;
}
[data-fs-navbar] {
--fs-navbar-bkg-color: var(--fs-color-main-0);
--fs-navbar-text-color: var(--fs-color-text-inverse);
}// src/components/CustomBanner.module.scss
.customBanner {
display: flex;
align-items: center;
gap: var(--fs-spacing-3); // Still reference FastStore tokens for consistency
padding: var(--fs-spacing-4);
background-color: var(--fs-color-main-0);
color: var(--fs-color-text-inverse);
border-radius: var(--fs-border-radius);
}!importantvar(--fs-*)src/themes/.fs-*[data-fs-*]src/themes/custom-theme.scss:root[data-fs-*]var(--fs-*)!importantfaststore-overrides