Skip to content
vviinn DocsDocs Beta

Customization Overview

vviinn widgets offer three powerful ways to customize appearance and content. This guide helps you choose the right approach for your needs.

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="…"
vviinn-vps-button {
--color-primary: #078688;
--color-primary-hover: #056b67;
}
vviinn-vps-button::part(upload-photo_button) {
min-height: 48px;
padding: 12px 24px;
font-size: 16px;
}
<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.

You can use multiple customization methods together for maximum flexibility.

Find your best match Upload Image

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.

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 the vviinn-vps-widget stylesheet.
  • On vviinn-results the file is also loaded into the One-Click Discovery buttons and the slider they open, so bare :host rules 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.