Custom Theming

ply's theming system is CSS custom properties. Override --ply-* tokens in a [data-theme="your-name"] block, then set that attribute on <html>. No Sass, no build step, no JavaScript framework.

How it works

<!-- 1. Define your theme in CSS -->
<style>
  [data-theme="brand"] {
    --ply-bg-body: #fefce8;
    --ply-color-body: #1a1a1a;
    --ply-color-link: #b45309;
    /* ... override as many tokens as you need */
  }
</style>

<!-- 2. Activate it -->
<html data-theme="brand">

<!-- 3. Or switch at runtime -->
<script>
  document.documentElement.setAttribute('data-theme', 'brand');
</script>

Components adapt automatically

Info alert — adapts to your theme colors.
Success alert.
Ghost alert — transparent background.

Elevation adapts too

Layer 0
Layer 1
Layer 2
Layer 3

Available tokens

TokenPurpose
--ply-bg-bodyPage background
--ply-bg-surfaceCard/panel background
--ply-bg-surface-altAlternating surface
--ply-bg-mutedMuted/disabled background
--ply-color-bodyPrimary text
--ply-color-headingsHeading text
--ply-color-secondarySecondary text
--ply-color-mutedMuted/placeholder text
--ply-color-text-inverseText on dark buttons
--ply-border-colorDefault borders
--ply-border-strongProminent borders
--ply-border-radiusGlobal border radius (inputs, cards, dialogs)
--ply-color-linkLink color
--ply-color-link-hoverLink hover
--ply-color-focusFocus ring
--ply-color-input-bgInput background
--ply-color-input-borderInput border
--ply-btn-default-bgDefault button background
--ply-btn-default-hoverDefault button hover
--ply-nav-bgNavigation background
--ply-nav-colorNavigation text
--ply-layer-0 to --ply-layer-3Elevation backgrounds
--ply-shadow-1 to --ply-shadow-3Elevation shadows