> ## Documentation Index
> Fetch the complete documentation index at: https://docs.loveful.app/llms.txt
> Use this file to discover all available pages before exploring further.

# CSS variables

> Every --loveful-* custom property the storefront stylesheet reads, with its default, and the order in which they win.

Every look in Loveful's storefront stylesheet (`loveful.css`, served by the theme app extension) reads a `--loveful-*` custom property, with Loveful's own default as the `var()` fallback. Nothing is set on `:root` or on Loveful's elements, so a theme or a developer can set any of these and win:

```css theme.css theme={null}
:root {
  --loveful-btn-padding: 1rem 2rem;
  --loveful-dialog-radius: 0;
  --loveful-card-title-weight: 700;
}
```

## Precedence

Order of precedence, strongest first:

1. A choice made in Loveful's storefront design window (written by the app embed as the same variable, after the theme's stylesheets).
2. The variable set in the theme's own CSS, or on a wrapper element.
3. The matched theme's preset (the `--loveful-theme-*` variables, from the app embed).
4. Loveful's default (below).

> [!NOTE]
>
> The `--loveful-theme-*` variables are written by the app embed whenever a theme is matched, after the theme's stylesheets, so set the specific variable instead (`--loveful-btn-radius` rather than `--loveful-theme-radius`), or set it on a wrapper element.

Defaults that read another variable fall back through it first. Where a variable has two defaults ("`a` or `b`"), the stylesheet uses a different fallback in different places, for example on the idle and saved states of a button.

## All buttons

Every Loveful button falls back to these before its own default.

| Variable | Default |
| - | - |
| `--loveful-all-btn-bg` | `transparent` or `var(--loveful-theme-btn-bg, canvastext)` |
| `--loveful-all-btn-border` | `currentColor` |
| `--loveful-all-btn-fg` | `inherit` or `var(--loveful-theme-btn-fg, canvas)` |

## Theme matching

Set by the app embed from the matched theme's preset. To change one, set the specific variable it feeds (see [Precedence](#precedence)).

| Variable | Default |
| - | - |
| `--loveful-theme-border-width` | `1px` |
| `--loveful-theme-btn-bg` | `canvastext` or `currentColor` |
| `--loveful-theme-btn-fg` | `canvas` |
| `--loveful-theme-font` | `inherit` |
| `--loveful-theme-image-radius` | `0.25rem` |
| `--loveful-theme-radius` | `var(--style-border-radius-buttons-primary, var(--buttons-radius, 0.25rem))` |

## Save button

| Variable | Default |
| - | - |
| `--loveful-btn-bg` | `var(--loveful-all-btn-bg, transparent)` |
| `--loveful-btn-border` | `currentColor` or `var(--loveful-all-btn-border, currentColor)` |
| `--loveful-btn-border-width` | `var(--loveful-theme-border-width, 1px)` |
| `--loveful-btn-fg` | `var(--loveful-all-btn-fg, inherit)` |
| `--loveful-btn-font-size` | `inherit` |
| `--loveful-btn-gap` | `0.5rem` |
| `--loveful-btn-icon-size` | `1.1em` |
| `--loveful-btn-padding` | `0.75rem 1.25rem` |
| `--loveful-btn-radius` | `var(--loveful-theme-radius, var(--style-border-radius-buttons-primary, var(--buttons-radius, 0.25rem)))` |
| `--loveful-btn-saved-bg` | `var(--loveful-theme-btn-bg, canvastext)` |
| `--loveful-btn-saved-border` | `var(--loveful-btn-border, currentColor)` |
| `--loveful-btn-saved-fg` | `var(--loveful-theme-btn-fg, canvas)` |
| `--loveful-btn-width` | `auto` |

## Product card heart (snippet)

| Variable | Default |
| - | - |
| `--loveful-card-bg` | `rgba(255, 255, 255, 0.9)` |
| `--loveful-card-color` | `#111` |
| `--loveful-card-heart-offset` | `0.5rem` |
| `--loveful-card-saved-color` | `#e0245e` |
| `--loveful-card-size` | `22px` |

## Wishlist cards

| Variable | Default |
| - | - |
| `--loveful-card-align` | `start` |
| `--loveful-card-compare-color` | `inherit` |
| `--loveful-card-compare-opacity` | `0.6` |
| `--loveful-card-gap` | `0.375rem` |
| `--loveful-card-image-bg` | `rgba(127, 127, 127, 0.08)` |
| `--loveful-card-image-radius` | `var(--loveful-theme-image-radius, 0.25rem)` |
| `--loveful-card-meta-size` | `0.875em` |
| `--loveful-card-price-size` | `inherit` |
| `--loveful-card-ratio` | `1 / 1` |
| `--loveful-card-side-columns` | `minmax(0, 2fr) minmax(0, 3fr)` |
| `--loveful-card-side-gap` | `1rem` |
| `--loveful-card-stock-color` | `inherit` |
| `--loveful-card-stock-weight` | `500` |
| `--loveful-card-title-size` | `inherit` |
| `--loveful-card-title-weight` | `500` |
| `--loveful-placeholder-opacity` | `0.35` |
| `--loveful-rating-color` | `currentColor` (filled stars) |
| `--loveful-rating-empty-color` | `rgb(128 128 128 / 0.3)` |
| `--loveful-rating-fill` | set on each card from its rating |
| `--loveful-rating-gap` | `0.25rem` |
| `--loveful-rating-size` | `1em` |
| `--loveful-rating-spacing` | `0.05em` |

## Wishlist page

| Variable | Default |
| - | - |
| `--loveful-columns` | `4` |
| `--loveful-columns-mobile` | `2` |
| `--loveful-columns-tablet` | `3` |
| `--loveful-gap` | `1.25rem` |

## Add to cart

| Variable | Default |
| - | - |
| `--loveful-add-bg` | `var(--loveful-all-btn-bg, transparent)` or `var(--loveful-theme-btn-fg, canvas)` |
| `--loveful-add-border` | `var(--loveful-all-btn-border, currentColor)` |
| `--loveful-add-border-width` | `var(--loveful-theme-border-width, 1px)` |
| `--loveful-add-fg` | `var(--loveful-all-btn-fg, inherit)` or `var(--loveful-theme-btn-bg, canvastext)` |
| `--loveful-add-padding` | `0.625rem 1rem` |
| `--loveful-add-radius` | `var(--loveful-theme-radius, var(--style-border-radius-buttons-primary, var(--buttons-radius, 0.25rem)))` |

## Remove button

| Variable | Default |
| - | - |
| `--loveful-remove-bg` | `canvas` |
| `--loveful-remove-fg` | `canvastext` |
| `--loveful-remove-font-size` | `1.25rem` |
| `--loveful-remove-offset` | `0.5rem` |
| `--loveful-remove-radius` | `999px` |
| `--loveful-remove-shadow` | `0 1px 3px rgba(0, 0, 0, 0.15)` |
| `--loveful-remove-size` | `2rem` |

## Share buttons

| Variable | Default |
| - | - |
| `--loveful-share-align` | `flex-start` |
| `--loveful-share-btn-bg` | `var(--loveful-all-btn-bg, transparent)` |
| `--loveful-share-btn-border` | `var(--loveful-all-btn-border, currentColor)` |
| `--loveful-share-btn-border-width` | `var(--loveful-theme-border-width, 1px)` |
| `--loveful-share-btn-fg` | `var(--loveful-all-btn-fg, inherit)` |
| `--loveful-share-btn-padding` | `0.625rem 1rem` |
| `--loveful-share-gap` | `0.5rem` |

## Dialogs

| Variable | Default |
| - | - |
| `--loveful-dialog-actions-gap` | `0.75rem` |
| `--loveful-dialog-backdrop` | `rgba(0, 0, 0, 0.4)` |
| `--loveful-dialog-bg` | `canvas` |
| `--loveful-dialog-btn-bg` | `var(--loveful-all-btn-bg, var(--loveful-theme-btn-bg, canvastext))` |
| `--loveful-dialog-btn-border` | `var(--loveful-all-btn-border, currentColor)` |
| `--loveful-dialog-btn-border-width` | `var(--loveful-theme-border-width, 1px)` |
| `--loveful-dialog-btn-fg` | `var(--loveful-all-btn-fg, var(--loveful-theme-btn-fg, canvas))` |
| `--loveful-dialog-btn-padding` | `0.5rem 1rem` |
| `--loveful-dialog-btn-radius` | `var(--loveful-theme-radius, var(--style-border-radius-buttons-primary, var(--buttons-radius, 0.25rem)))` |
| `--loveful-dialog-fg` | `canvastext` |
| `--loveful-dialog-padding` | `1.5rem` |
| `--loveful-dialog-radius` | `0.75rem` |
| `--loveful-dialog-shadow` | `0 10px 40px rgba(0, 0, 0, 0.25)` |
| `--loveful-dialog-title-size` | `1.125rem` |
| `--loveful-dialog-width` | `30rem` |
| `--loveful-motion-duration` | `180ms` |
| `--loveful-sheet-duration` | `260ms` |

## Change options

| Variable | Default |
| - | - |
| `--loveful-modal-btn-bg` | `var(--loveful-all-btn-bg, var(--loveful-theme-btn-bg, canvastext))` |
| `--loveful-modal-btn-border` | `var(--loveful-all-btn-border, currentColor)` |
| `--loveful-modal-btn-fg` | `canvas` or `var(--loveful-all-btn-fg, var(--loveful-theme-btn-fg, canvas))` |
| `--loveful-modal-btn-radius` | `var(--loveful-theme-radius, var(--style-border-radius-buttons-primary, var(--buttons-radius, 0.25rem)))` |
| `--loveful-modal-radius` | `var(--loveful-dialog-radius, 0.75rem)` |
| `--loveful-notice-bg` | `#fff1c2` |
| `--loveful-notice-fg` | `#4f3b00` |
| `--loveful-notice-icon` | `#b98900` |
| `--loveful-notice-radius` | `0.75rem` |
| `--loveful-pill-border` | `var(--loveful-input-border, rgba(127, 127, 127, 0.5))` |
| `--loveful-pill-gap` | `0.5rem` |
| `--loveful-pill-min-width` | `3rem` |
| `--loveful-pill-padding` | `0.5rem 0.875rem` |
| `--loveful-pill-selected-bg` | `var(--loveful-theme-btn-bg, canvastext)` or `var(--loveful-theme-btn-bg, currentColor)` |
| `--loveful-pill-selected-fg` | `var(--loveful-theme-btn-fg, canvas)` |
| `--loveful-unavailable-opacity` | `0.5` |
| `--loveful-variant-image-size` | `4.5rem` |
| `--loveful-variant-label-weight` | `500` |

## Form fields

| Variable | Default |
| - | - |
| `--loveful-input-bg` | `transparent` |
| `--loveful-input-border` | `rgba(127, 127, 127, 0.5)` |
| `--loveful-input-padding` | `0.625rem 0.75rem` |
| `--loveful-input-radius` | `0.25rem` |

## Empty wishlist

| Variable | Default |
| - | - |
| `--loveful-empty-btn-bg` | `var(--loveful-all-btn-bg, transparent)` |
| `--loveful-empty-btn-border` | `var(--loveful-all-btn-border, currentColor)` |
| `--loveful-empty-btn-border-width` | `var(--loveful-theme-border-width, 1px)` |
| `--loveful-empty-btn-fg` | `var(--loveful-all-btn-fg, inherit)` |
| `--loveful-empty-btn-padding` | `0.625rem 1.25rem` |
| `--loveful-empty-btn-radius` | `var(--loveful-theme-radius, var(--style-border-radius-buttons-primary, var(--buttons-radius, 0.25rem)))` |

## Saved count

| Variable | Default |
| - | - |
| `--loveful-count-color` | `inherit` |
| `--loveful-count-gap` | `0.375rem` |
| `--loveful-count-icon-size` | `1em` |
| `--loveful-count-size` | `0.875em` |

## Header link and icon

| Variable | Default |
| - | - |
| `--loveful-count-bg` | `#111111` |
| `--loveful-count-fg` | `#ffffff` |
| `--loveful-header-count-bg` | `currentColor` or `rgb(from currentColor r g b / 1)` |
| `--loveful-header-count-fg` | `#fff` |
| `--loveful-header-count-size` | `0.75rem` |
| `--loveful-icon-color` | `currentColor` |
| `--loveful-icon-size` | `24px` |

## Shared

| Variable | Default |
| - | - |
| `--loveful-muted-opacity` | `0.7` |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.