Skip to content
Docs

Styling & Data Attributes

This is the shared reference for <dkl-price> — the data-* attributes that drive its behaviour, the --dkl-* tokens that style it, and the CSS parts you can target. The app block settings map onto these; on a web component you set them directly.

All optional. The price itself, the compare-at and the money format come from the carrier, so only the attributes you set are listed.

"true" | "false" · default: false

Show the savings badge (saving versus the original / highest price).

"percentage" | "amount" · default: percentage

How the savings badge displays the saving.

string · default: Save

The badge’s leading label, e.g. “Save 15%”.

string · default: + an extra

Connector between the sale saving and the tier saving, e.g. “Save 10% + an extra 15%”.

presence · default: unset

Set by the component while a tier is active — a styling hook only. Don’t author it yourself.

Descriptive alt text

CSS styling tokens for the DKL Price component

<dkl-price> has no shadow <style> — its stylesheet (loaded site-wide by the embed) is the single source, styling the host and parts. Set any token above the element (:root, the Custom CSS in Components → Styles, an inline style, or the block’s scoped rule).

default: 6px

Gap between price and compare-at.

default: inherit

Font size for the main price and compare-at (the savings badge has its own token).

Explicit sizes don’t follow the browser’s default-font-size setting (the theme’s own size, which inherit tracks, already does). --dkl-price-font-size-mobile overrides it at ≤768px — what a component entry’s mobile size emits.

default: inherit (→ --dkl-font-family)

The font family for every part. Only renders if your theme loads that font.

default: 600

Main price font weight

default: inherit

Main price color

default: var(--dkl-price-color)

Main price while a tier is active ([data-dkl-discounted]).

default: 0.6

Struck-through compare-at opacity

default: 400

Compare-at font weight

default: inherit

Compare-at color

default: line-through

Compare-at text decoration

default: 13px (12px at ≤768px via --dkl-price-savings-font-size-mobile)

Savings badge font size

default: 600

Savings badge font weight

default: #ffffff

Savings badge text color

default: var(--dkl-color-success)

Savings badge background color

default: var(--dkl-radius)

Savings badge corner radius

default: 2px 8px

Savings badge padding (vertical and horizontal)

Also reads the global brand tokens --dkl-font-family and --dkl-color-text.

Image highlighting the CSS parts for the DKL Price component

CSS parts for the DKL Price component

<dkl-price> is fully shadow DOM. Target its internals with ::part().

CSSPart

The main price (the discounted price while a tier is active).

CSSPart

The struck-through compare-at wrapper.

CSSPart

The compare-at number.

CSSPart

The savings line wrapper.

CSSPart

The savings label text.

CSSPart

The savings amount.

Style via :root tokens
:root {
--dkl-price-sale-color: #c0392b;
--dkl-price-compare-opacity: 1;
--dkl-price-compare-color: #888;
}
Style via ::part()
dkl-price::part(price) {
font-size: 1.5rem;
font-weight: 700;
}
Data attribute overrides for web component
<dkl-price
data-show-savings="true"
data-savings-format="amount"
data-savings-label="You save"
></dkl-price>