Skip to content
vviinn DocsDocs Beta

Product Card

Full content view with modal One-Click Discovery

Section titled “Full content view with modal One-Click Discovery”

Partial content view with appended One-Click Discovery

Section titled “Partial content view with appended One-Click Discovery”

Minimalistic view with manually hidden content

Section titled “Minimalistic view with manually hidden content”

Each card carries the product’s brand and its non-empty custom labels as attributes: data-brand and data-custom-label-0 … data-custom-label-4, numbered like the feed fields custom_label_0 … custom_label_4. A stylesheet loaded through the widget’s css-url prop lives in the same shadow root as the cards, so it can style cards by these values:

/* loaded via <vviinn-results css-url="..."> */
/* Highlight cards whose feed field custom_label_0 is "Sale" */
vviinn-product-card[data-custom-label-0="Sale"] {
border: 1px solid #e30613;
}
/* Hide the brand line on the shop's own brand */
vviinn-product-card[data-brand="Acme"]::part(brand) {
display: none;
}

These attributes are not reachable from the page’s own stylesheet, since ::part() cannot be combined with an attribute selector. Where a css-url stylesheet reaches, and where it doesn’t (the search modal), is in Where your CSS lives.