Customization Overview
vviinn widgets offer three powerful ways to customize appearance and content. This guide helps you choose the right approach for your needs.
Customization methods
Section titled “Customization methods”| Method | Use for | How |
|---|---|---|
| CSS Variables | Theme-level styling: brand colors, font family, product card alignment and borders | --color-primary on the widget |
| Target Styling | A specific element: its look, position, layout, animations and transforms | ::part() selector |
| Custom Content | Your own HTML in place of default content: button text, labels, icons | Child element with slot="…" |
Quick start examples
Section titled “Quick start examples”CSS Variables: change primary color
Section titled “CSS Variables: change primary color”vviinn-vps-button { --color-primary: #078688; --color-primary-hover: #056b67;}Target Styling: style upload button
Section titled “Target Styling: style upload button”vviinn-vps-button::part(upload-photo_button) { min-height: 48px; padding: 12px 24px; font-size: 16px;}Custom Content: replace button text
Section titled “Custom Content: replace button text”<style> vviinn-vps-button [slot] { visibility: hidden; position: absolute; width: 0; height: 0; }</style>
<vviinn-vps-button token="YOUR_READ_ONLY_TOKEN"> <span slot="vviinn-image-upload-button-text">Upload Image</span></vviinn-vps-button>The widget copies slotted content into its own markup, so hide the original elements with the [slot] rule, as in the Custom Content examples.
Combining methods
Section titled “Combining methods”You can use multiple customization methods together for maximum flexibility.
Combining all three methods
Section titled “Combining all three methods”Where your CSS lives
Section titled “Where your CSS lives”Page stylesheet (default)
Section titled “Page stylesheet (default)”A <style> or <link> on your page. It reaches widget elements through the widget you embed, e.g. vviinn-vpr-widget::part(title). Enough for most styling.
css-url stylesheet
Section titled “css-url stylesheet”A file the widget loads into its own shadow root:
<vviinn-results css-url="https://your-shop.example/vviinn.css"></vviinn-results>Inside it, select elements directly: vviinn-product-card::part(title), :host, ::slotted(). Use it for what a page stylesheet can’t do:
- Style cards by product data: brand, custom labels
- Style elements inside a card by the card’s state, e.g.
vviinn-product-card:hover::part(image)
Limits of css-url:
- In the search modal the cards sit inside a nested
vviinn-results, out of reach of thevviinn-vps-widgetstylesheet. - On
vviinn-resultsthe file is also loaded into the One-Click Discovery buttons and the slider they open, so bare:hostrules apply there too. Scope layout rules with:host(vviinn-results).
Across these docs, css-url examples begin with a /* loaded via … css-url="..." */ comment; all other examples go into a page stylesheet.