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.