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
| Mechanism | Attribute | Control level | Requires Arena Support? |
|---|---|---|---|
| Theme switch | data-theme | Light or dark palette | No |
| Accent color | data-customized-color | Brand color on key interactive elements | No |
| Custom CSS | data-custom-styles | Any CSS property on any element | Yes (file deployment) |
All three mechanisms can be combined. See Combining methods for precedence rules.
Scope:
data-customized-coloranddata-custom-stylesare supported on the main Comments widget only (arena-comments-widget). Thecomments-anchorwidget supportsdata-themeonly.
1. Theme Switch (data-theme)
data-theme)Sets the widget's overall color palette to light or dark mode.
Values
| Value | Effect |
|---|---|
"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)
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 property | Derivation | Applied to |
|---|---|---|
--cs-accent | The color itself | Send button background, avatar icon, links in thread header, "Show More" button |
--cs-accent-soft | 12% of the color over transparent | Avatar background |
--cs-accent-border | 40% of the color over transparent | Avatar ring/border |
--cs-accent-hover | Color blended 85% with black | Send button hover state |
--cs-accent-ghost-hover-bg | transparent | Disables 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)
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
- Add
data-custom-stylesto your embed div. - The widget fetches
{ARENA_STATIC_API}/v1/sites/{siteSlug}/custom.css. - The CSS is injected into both
document.headand each<comments-web-component>shadow root, so it applies inside the widget's encapsulated DOM. - Because the custom stylesheet is injected last, its rules override all built-in styles.
Deployment workflow
- Write your
custom.cssusing the CSS variables reference below. - Send the file to Arena Support at [email protected] with your site slug.
- 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;
}| Variable | Default (no data-customized-color) | Used for |
|---|---|---|
--cs-accent | Blue-500 (#3b82f6) | Send button bg, avatar icon, header links |
--cs-accent-soft | Blue-500 at 12% | Avatar background |
--cs-accent-border | Blue-500 at 40% | Avatar ring |
--cs-accent-hover | Blue-600 (#2563eb) | Send button hover bg |
--cs-accent-ghost-hover-bg | Grey (button default) | Login/Account button hover bg |
Surface & background
Override inside .ar82zL-light-variables or .ar82zL-dark-variables to change per-theme.
| Variable | Light default | Dark 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
| Variable | Light default | Dark 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
| Variable | Light default | Dark 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
| Variable | Light default | Dark 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
| Variable | Light default | Dark default |
|---|---|---|
--color-avatar-bg | #ffffff | #1d1d20 (mate-black-800) |
--color-avatar-text | #475569 (slate-600) | #a3a3a9 (mate-black-200) |
Dialog
| Variable | Light default | Dark 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
| Variable | Light default | Dark 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)
| Variable | Light default | Dark 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.
| Variable | Default | Notes |
|---|---|---|
--radius | 8px | Base — change this to rescale all others |
--radius-sm | 4px (--radius - 4px) | Small elements (badges, chips) |
--radius-md | 6px (--radius - 2px) | Medium elements |
--radius-lg | 8px (--radius) | Standard cards, inputs |
--radius-xl | 12px (--radius + 4px) | Dialogs, large cards |
--radius-2xl | 16px (--radius + 8px) | Sheets, overlays |
--radius-rounded | 9999px | Pills 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:
- Theme variables (
.ar82zL-light-variables/.ar82zL-dark-variables) — set at initialization and ondata-themechanges - Accent color (
data-customized-color) — sets--cs-accent*on the host element; overrides theme for those five properties - 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?
Ensuredata-custom-stylesis on the.arena-comments-widgetdiv (not on<comments-web-component>),data-site-slugis 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-colorhas 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 settingelement.style.color = 'your-value'and reading it back.
Theme not switching in auto mode?
Auto mode readsdocument.documentElement[data-theme]. Confirm your page setsdata-themeon<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-variablesand.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 — targetcomments-web-componentin your CSS.
Still not working? Contact Arena Support at [email protected].
Updated about 2 hours ago