CSS Variables
Theme-level customization using CSS Custom Properties (CSS Variables) for all or specific vviinn widgets.
Available CSS variables
Section titled “Available CSS variables”Each component’s page in the Component Reference lists all of its variables, e.g. Search Modal.
General
Section titled “General”--font-family— The font family of every widget.
Search Modal
Section titled “Search Modal”--color-primary— The color of Search Button and bullets in Onboarding Block.--color-primary-hover— The color of Search Button and bullets in Onboarding Block on mouse hover.--modal-border-radius— The border radius of the modal.--product-card-width— Minimum width of product card inside the grid.--search-modal-animation-duration— The animation duration of the modal on desktop devices.--search-modal-animation-duration-mobile— The animation duration of the modal on mobile devices.
Plus the Product Card variables.
Product Card
Section titled “Product Card”--basket-button-bg-color-pressed— The background color of the pressed Basket Button.--product-card-content-align— The alignment of the content inside the product card's flex container.--product-card-image-aspect-ratio— The aspect ratio of the product card image (e.g., "1 / 1", "3 / 4").--product-card-image-bg-color— The background color of the product card image.--product-card-image-border— The border of the product card image.--product-card-text-align— The alignment of the text inside the product card.--product-card-transition-duration— Duration of skeleton to content transitions.
Search Results
Section titled “Search Results”--product-card-width— Minimum width of product card inside the grid.--vviinn-results-row-gap— Vertical gap between rows of product cards.
Plus the Product Card variables.
Discovery
Section titled “Discovery”--sidebar-animation-duration— The animation duration of the recommendations sidebar.--vviinn-carousel-columns— A number of items in grid mode.
Plus the Product Card variables.
Shop-the-Look
Section titled “Shop-the-Look”--shop-the-look-product-card-width— Width of the product card in the detail view. Defaults to 160px on desktop and 120px on mobile — a set value applies to both.--shop-the-look-results-grid-width— Width of the tiles grid in the grid view — tiles scale with it. Defaults to 140px.
See Shop-the-Look styling for the two views and an example.
Applying CSS variables to widgets
Section titled “Applying CSS variables to widgets”Apply the CSS variables to all vviinn widgets on the page by using the html selector:
html { ... --color-primary: #078688; ...}To apply variables to a specific widget, use the widget name as a selector:
vviinn-vps-button { ... --color-primary: #078688; ...}