Layout Customization

Comments Widget — Color Customization

The Arena Comments widget supports three levels of color customization, from a simple light/dark switch to full per-property CSS overrides. This guide covers each mechanism, when to use it, and the complete reference of CSS variables available for theming.


Overview

MechanismAttributeControl levelRequires Arena Support?
Theme switchdata-themeLight or dark paletteNo
Accent colordata-customized-colorBrand color on key interactive elementsNo
Custom CSSdata-custom-stylesAny CSS property on any elementYes (file deployment)

All three mechanisms can be combined. See Combining methods for precedence rules.

Scope: data-customized-color and data-custom-styles are supported on the main Comments widget only (arena-comments-widget). The comments-anchor widget supports data-theme only.


1. Theme Switch (data-theme)

Sets the widget's overall color palette to light or dark mode.

Values

ValueEffect
"light"Light palette (default)
"dark"Dark palette
(omitted)Auto mode — mirrors document.documentElement[data-theme]

Attribute changes are applied live — no page reload required.

Examples

<!-- Light theme -->
<div class="arena-comments-widget" data-theme="light">

<!-- Dark theme -->
<div class="arena-comments-widget" data-theme="dark">

<!-- Auto mode: widget mirrors your page's data-theme attribute -->
<div class="arena-comments-widget">

Auto mode details: When data-theme is omitted, the widget watches document.documentElement for a data-theme attribute and mirrors any changes in real time. If your page already manages its own light/dark switch via document.documentElement[data-theme], the widget will follow it automatically with no extra configuration.


2. Accent Color (data-customized-color)

Applies a single brand color to the widget's key interactive elements — buttons, avatars, and links — without touching the rest of the palette.

Format

Any valid CSS color string:

<div class="arena-comments-widget" data-customized-color="#9124ff">
<div class="arena-comments-widget" data-customized-color="rgb(145, 36, 255)">
<div class="arena-comments-widget" data-customized-color="hsl(272, 100%, 57%)">
<div class="arena-comments-widget" data-customized-color="rebeccapurple">

Invalid values (typos, non-color strings) are silently ignored — the widget falls back to its default blue accent.

What it changes

The widget derives five CSS custom properties from the color you provide and applies them to the interactive elements below.

CSS propertyDerivationApplied to
--cs-accentThe color itselfSend button background, avatar icon, links in thread header, "Show More" button
--cs-accent-soft12% of the color over transparentAvatar background
--cs-accent-border40% of the color over transparentAvatar ring/border
--cs-accent-hoverColor blended 85% with blackSend button hover state
--cs-accent-ghost-hover-bgtransparentDisables grey hover fill on Login/Account button (tints the label with the accent color instead)

These properties are set on the web component host element and cascade through the shadow root. You can override any of them individually in a custom CSS file.

Example

<div class="arena-comments-widget"
     data-site-id="site-123"
     data-site-slug="my-publication"
     data-customized-color="#e63946">
</div>

3. Full Custom CSS (data-custom-styles)

For complete control over the widget's appearance — backgrounds, borders, typography, layout — Arena can host a custom CSS file for your site. The widget fetches and injects it at runtime.

How it works

  1. Add data-custom-styles to your embed div.
  2. The widget fetches {ARENA_STATIC_API}/v1/sites/{siteSlug}/custom.css.
  3. The CSS is injected into both document.head and each <comments-web-component> shadow root, so it applies inside the widget's encapsulated DOM.
  4. Because the custom stylesheet is injected last, its rules override all built-in styles.

Deployment workflow

  1. Write your custom.css using the CSS variables reference below.
  2. Send the file to Arena Support at [email protected] with your site slug.
  3. Once Support confirms the file is live, hard-reload your page (Cmd+Shift+R / Ctrl+Shift+R) to see the changes.

No code changes or widget redeployment are required.

Example embed

<div class="arena-comments-widget"
     data-site-id="site-123"
     data-site-slug="my-publication"
     data-custom-styles>
</div>

Example custom.css

/* Override accent color for both themes */
comments-web-component {
  --cs-accent: #e63946;
  --cs-accent-hover: #c1121f;
}

/* Change the main background in light theme */
.ar82zL-light-variables {
  --color-surface-primary: #f5f0eb;
  --color-surface-secondary: #ffffff;
}

/* Change the main background in dark theme */
.ar82zL-dark-variables {
  --color-surface-primary: #121212;
  --color-surface-secondary: #1e1e1e;
}

/* Adjust border radius for a sharper look */
.ar82zL-common-variables {
  --radius: 4px;
}

CSS Variables Reference

All design tokens are CSS custom properties scoped to class selectors applied by the widget. You can override any of them in your custom.css.

The widget applies one of two theme-scoped classes (.ar82zL-light-variables or .ar82zL-dark-variables) alongside .ar82zL-common-variables, which holds shared tokens.

Accent color variables

These are set by data-customized-color and can be overridden in custom.css. Target the web component host to override them:

comments-web-component {
  --cs-accent: #your-color;
  --cs-accent-soft: color-mix(in srgb, #your-color 12%, transparent);
  --cs-accent-border: color-mix(in srgb, #your-color 40%, transparent);
  --cs-accent-hover: color-mix(in srgb, #your-color 85%, black);
  --cs-accent-ghost-hover-bg: transparent;
}
VariableDefault (no data-customized-color)Used for
--cs-accentBlue-500 (#3b82f6)Send button bg, avatar icon, header links
--cs-accent-softBlue-500 at 12%Avatar background
--cs-accent-borderBlue-500 at 40%Avatar ring
--cs-accent-hoverBlue-600 (#2563eb)Send button hover bg
--cs-accent-ghost-hover-bgGrey (button default)Login/Account button hover bg

Surface & background

Override inside .ar82zL-light-variables or .ar82zL-dark-variables to change per-theme.

VariableLight defaultDark default
--color-surface-primary#f8fafc (slate-50)#27272a (mate-black-700)
--color-surface-secondary#ffffff#000000
--color-surface-highlight#e5ccff (purple-100)#4a148c (purple-900)
--color-hover#f1f5f9 (slate-100)#27272a (mate-black-700)
--color-subtle#e2e8f0 (slate-200)#494952 (mate-black-500)
--color-opposite#000000#ffffff

Text

VariableLight defaultDark default
--color-text-primary#000000#f3f3f6 (mate-black-10)
--color-text-secondary#475569 (slate-600)#c2c2c6 (mate-black-100)
--color-text-tertiary#64748b (slate-500)#a3a3a9 (mate-black-200)
--color-text-quaternary#94a3b8 (slate-400)#85858c (mate-black-300)

Borders

VariableLight defaultDark default
--color-border-default#e2e8f0 (slate-200)#494952 (mate-black-500)
--color-border-soft#f1f5f9 (slate-100)#27272a (mate-black-700)
--color-border-focus#cbd5e1 (slate-300)#494952 (mate-black-500)
--color-border-selected#64748b (slate-500)#ffffff
--color-border-highlight#9124ff (arena-purple)#673ab7 (purple-700)

Buttons

VariableLight defaultDark default
--color-button-bg#0f172a (slate-900)#f5f5f5 (mate-black-25)
--color-button-text#f8fafc (slate-50)#131316 (mate-black-900)
--color-ghost-button-text#0f172a (slate-900)#f3f3f6 (mate-black-10)
--color-button-active-bg#334155 (slate-700)#f3f3f6 (mate-black-10)
--color-button-accent#f1f5f9 (slate-100)#494952 (mate-black-500)
--color-button-accent-active#e2e8f0 (slate-200)#27272a (mate-black-700)
--color-button-link#2563eb (blue-600)#3b82f6 (blue-500)
--color-button-disabled-bg#f1f5f9 (slate-100)#a3a3a9 (mate-black-200)
--color-button-disabled-text#94a3b8 (slate-400)#2b2b35 (mate-black-600)

Avatar

VariableLight defaultDark default
--color-avatar-bg#ffffff#1d1d20 (mate-black-800)
--color-avatar-text#475569 (slate-600)#a3a3a9 (mate-black-200)

Dialog

VariableLight defaultDark default
--color-dialog-bg#ffffff#1d1d20 (mate-black-800)
--color-dialog-text#0f172a (slate-900)#c2c2c6 (mate-black-100)
--color-dialog-border#cbd5e1 (slate-300)#1d1d20 (mate-black-800)

UI elements

VariableLight defaultDark default
--color-status-online#16a34a (green-600)#22c55e (green-500)
--color-timeline-line#cbd5e1 (slate-300)#85858c (mate-black-300)
--color-timeline-button#94a3b8 (slate-400)#85858c (mate-black-300)
--color-input-placeholder#64748b (slate-500)#67676f (mate-black-400)
--color-error#dc2626 (red-600)#ef4444 (red-500)
--color-success#16a34a (green-600)#22c55e (green-500)

User profile card (popover)

VariableLight defaultDark default
--color-card-bg#ffffff#1d1d20 (mate-black-800)
--color-card-username#0f172a (slate-900)#ffffff
--color-card-handle#64748b (slate-500)#a3a3a9 (mate-black-200)
--color-card-bio#1e293b (slate-800)#f3f3f6 (mate-black-10)
--color-card-stat-bg#f8fafc (slate-50)#27272a (mate-black-700)
--color-card-stat-value#0f172a (slate-900)#ffffff
--color-card-stat-label#64748b (slate-500)#a3a3a9 (mate-black-200)
--color-card-profile-btn-bg#ffffff#27272a (mate-black-700)
--color-card-profile-btn-hover-bg#f8fafc (slate-50)#1d1d20 (mate-black-800)
--color-card-profile-btn-text#1e293b (slate-800)#ffffff
--color-card-profile-btn-border#e2e8f0 (slate-200)#494952 (mate-black-500)

Border radius (shared)

Override inside .ar82zL-common-variables to change all rounded corners proportionally. All radius tokens are derived from --radius.

VariableDefaultNotes
--radius8pxBase — change this to rescale all others
--radius-sm4px (--radius - 4px)Small elements (badges, chips)
--radius-md6px (--radius - 2px)Medium elements
--radius-lg8px (--radius)Standard cards, inputs
--radius-xl12px (--radius + 4px)Dialogs, large cards
--radius-2xl16px (--radius + 8px)Sheets, overlays
--radius-rounded9999pxPills and circular elements
/* Sharp corners everywhere */
.ar82zL-common-variables {
  --radius: 2px;
}

/* Fully rounded style */
.ar82zL-common-variables {
  --radius: 16px;
}

Combining Methods

All three methods can be used together. When they affect the same property, the last one applied wins. The effective order is:

  1. Theme variables (.ar82zL-light-variables / .ar82zL-dark-variables) — set at initialization and on data-theme changes
  2. Accent color (data-customized-color) — sets --cs-accent* on the host element; overrides theme for those five properties
  3. Custom CSS (data-custom-styles) — injected last; wins over both of the above for any property it declares

Practical precedence: Use data-theme for the base palette, data-customized-color for a quick brand color without sending a file to Support, and data-custom-styles when you need fine-grained control over specific properties.

<!-- All three combined -->
<div class="arena-comments-widget"
     data-site-id="site-123"
     data-site-slug="my-publication"
     data-theme="dark"
     data-customized-color="#e63946"
     data-custom-styles>
</div>

Troubleshooting

Custom styles not loading?
Ensure data-custom-styles is on the .arena-comments-widget div (not on <comments-web-component>), data-site-slug is correct, and the CSS file has been deployed by Arena Support. Hard-reload (Cmd+Shift+R / Ctrl+Shift+R) to bypass the browser cache.

data-customized-color has no effect?
Check that the color value is a valid CSS color string — invalid values are silently ignored and the widget falls back to its default blue accent. Test your value in browser DevTools by setting element.style.color = 'your-value' and reading it back.

Theme not switching in auto mode?
Auto mode reads document.documentElement[data-theme]. Confirm your page sets data-theme on <html> (not <body>) and that the value is exactly "light" or "dark".

CSS variable override not taking effect?
Theme variables are scoped to .ar82zL-light-variables and .ar82zL-dark-variables, not to :root. Target the correct class in your custom CSS. Accent variables (--cs-accent*) are set on the <comments-web-component> host element — target comments-web-component in your CSS.

Still not working? Contact Arena Support at [email protected].


Did this page help you?