Developers · Gutenberg

Color Tokens block for WordPress

Design-system colour token reference. Displays named colour swatches grouped into palettes (Primary, Neutral, Semantic, etc.) with hex/RGB values. Visitors can click any swatch to copy its hex code.

Get Blockenberg

Free Gutenberg block in Blockenberg. The inspector controls and front-end behavior on this page come from this block’s source, not a shared stub.

Get Blockenberg

What it actually does

Design-system colour token reference. Displays named colour swatches grouped into palettes (Primary, Neutral, Semantic, etc.) with hex/RGB values. Visitors can click any swatch to copy its hex code.

Inspector panels on this block: Content, Swatch Size, Palette Groups (' + a.groups.length +, Spacing & Style. Those titles come from index.js, not from a shared template.

Where to find it

Gutenberg inserter → Developers → search “Color Tokens” (block name `blockenberg/color-tokens` in block.json). Style it in the sidebar after insert.

How to use Color Tokens block for WordPress

  1. Install Blockenberg. Install from WordPress.org and activate the plugin.
  2. Insert the block. Edit a page, click +, search for “Color Tokens”, insert it. Category: Developers.
  3. Configure inspector controls that exist on this block. Open Content. Set “Content — Title”, “Show title”, “Subtitle”, “Show subtitle”.
  4. Check the published page. The view script reads HTML data attributes: data-ct-ready, data-hex. The block editor preview may not run the same view script.

Inspector controls from this block’s code

ControlWhat the code does
Content — TitleText field in the inspector. block.json default: Color System. Saved as `title`.
Show titleOn/off toggle in the inspector. On by default. Saved as `showTitle`.
SubtitleText field in the inspector. block.json default: Our full design-system colour palette with token names and hex values. Saved as `subtitle`.
Show subtitleOn/off toggle in the inspector. On by default. Saved as `showSubtitle`.
Show swatch nameOn/off toggle in the inspector. On by default. Saved as `showName`.
Show hex valueOn/off toggle in the inspector. On by default. Saved as `showHex`.
Show RGB valueOn/off toggle in the inspector. Off by default. Saved as `showRGB`.
Show copy icon on hoverOn/off toggle in the inspector. On by default. Saved as `showCopyHint`.
Swatch size (px)Numeric range control in the inspector. Range 40–160. block.json default: 80. Saved as `swatchSize`.
Swatch radius (px)Numeric range control in the inspector. Range 0–24. block.json default: 10. Saved as `swatchRadius`.
Group nameText field in the inspector. Saved as `groups`.
Border radiusNumeric range control in the inspector. Range 0–32. block.json default: 16. Saved as `borderRadius`.
Padding topNumeric range control in the inspector. Range 0–120. block.json default: 48. Saved as `paddingTop`.
Padding bottomNumeric range control in the inspector. Range 0–120. block.json default: 48. Saved as `paddingBottom`.
Typography — TitleShared Blockenberg typography popover (family, size, weight, spacing). Saved as `typoTitle`.
Subtitle (Typo Subtitle)Shared Blockenberg typography popover (family, size, weight, spacing). Saved as `typoSubtitle`.
LabelShared Blockenberg typography popover (family, size, weight, spacing). Saved as `typoLabel`.
Colors — BackgroundColor control in the inspector. block.json default: #ffffff. Saved as `bgColor`.
Colors — TitleColor control in the inspector. block.json default: #0f172a. Saved as `titleColor`.
SubtitleColor control in the inspector. block.json default: #64748b. Saved as `subtitleColor`.
Group nameColor control in the inspector. block.json default: #374151. Saved as `groupNameColor`.
Swatch nameColor control in the inspector. block.json default: #374151. Saved as `swatchNameColor`.
Swatch metaColor control in the inspector. block.json default: #6b7280. Saved as `swatchMetaColor`.
Swatch card BGColor control in the inspector. block.json default: #f8fafc. Saved as `swatchBg`.
Swatch borderColor control in the inspector. block.json default: #e2e8f0. Saved as `borderColor`.

What the front-end script actually does

When this is the right block

Notes from the implementation

viewScript: this folder’s frontend.js is enqueued on the front end for this block.

FAQ

How do I add the Color Tokens block in WordPress?

Install Blockenberg from WordPress.org, edit a page in the block editor, click +, and search for “Color Tokens”. It sits under Developers. After insert, open Content and set “Content — Title”, “Show title”, “Subtitle”, “Show subtitle”.

What makes Color Tokens different from other Blockenberg blocks?

Design-system colour token reference. Displays named colour swatches grouped into palettes (Primary, Neutral, Semantic, etc.) with hex/RGB values. Visitors can click any swatch to copy its hex code. Inspector labels on this block include “Content — Title”, “Show title”, “Subtitle”, “Show subtitle”.

Is the Color Tokens Gutenberg block free?

Yes. Color Tokens ships inside Blockenberg. Get the plugin from WordPress.org — no paid add-on is required for this block.

Can I style Color Tokens to match my theme?

Yes. Blockenberg’s shared typography and color panels apply here, plus any block-specific style controls listed on this page (panels: Content, Swatch Size, Palette Groups (' + a.groups.length +, Spacing & Style).

Related developers blocks

Get Blockenberg

Install Blockenberg from WordPress.org, then insert Color Tokens from the Gutenberg inserter.

Get Blockenberg