atm

Atomix

v0.4.6

    1. Home
    2. Guides
    3. Theme Inspector

Getting Started
  • Introduction
  • Installation
  • Quick Start
  • Migration Guide
  • CLI Reference
Design Tokens
  • Overview
  • All Tokens
  • Colors
  • Spacing
  • Typography
  • Grid
  • Elevation
Styles System
  • Architecture
  • Customization
  • Utilities
  • API Reference
Layouts
  • Grid System
  • Masonry Grid
  • Responsive Patterns
  • Customization
  • Performance
Components
  • Overview
  • Guidelines
  • Accordion
  • AtomixGlass
  • Avatar
  • Badge
  • Breadcrumb
  • Button
  • ButtonGroup
  • Card
  • Checkbox
  • Date Picker
  • Dropdown
  • Form
  • Input
  • Modal
  • Progress
  • Radio
  • Rating
  • Select
  • Slider
  • Spinner
  • Tab
  • Textarea
  • Toggle
  • Tooltip
  • Upload
  • Block
  • Callout
  • Countdown
  • Hero
  • Icon
  • List
  • Messages
  • Navbar
  • Pagination
  • Popover
  • Steps
  • SectionIntro
  • Container
  • Grid
  • GridCol
  • Row
  • River
  • MasonryGrid
  • DataTable
  • EdgePanel
  • SideMenu
  • Nav
  • NavItem
  • NavDropdown
  • VirtualizedGrid
Guides
  • Theming Guide
  • AtomixGlass Performance
  • AtomixGlass Theming
  • Theme Studio
  • Devtools
  • Theme Inspector
  • Theme Preview
  • Theme Comparator
  • Live Editor
  • CLI Tool
  • Try Live Editor
  • Try Inspector
  • Try Preview
  • Try Comparator
  • AtomixGlass Playground
Examples
  • Common Patterns
  • Landing Page
API Reference
  • React API
  • JavaScript API
  • CSS API
CLI
  • Overview
  • User Guide
  • API Reference
  • Migration Guide
  • Security Guide
Resources
  • Roadmap
  • Changelog
  • Contributing

Atomix Design System

A comprehensive design system for building modern, accessible, and performant web applications with React and vanilla JavaScript.
GitHubTwitterDiscordNPM

Getting Started

IntroductionInstallationQuick StartTheming Guide

Documentation

ComponentsDesign TokensStyles SystemLayouts

Resources

GitHub Repository↗NPM Package↗Storybook↗API Reference

Community

ContributingRoadmapChangelogReport Issue↗

© 2026 Atomix Design System. Built with ❤️ by the Shohojdhara.

Deep inspection and validation for theme development

Theme Inspector

Detailed inspection and debugging information for themes. Validate structure, check accessibility, and review generated CSS variables.

Theme Inspector Component

ThemeInspector provides comprehensive analysis of your theme configuration, including validation, accessibility checks, and CSS variable generation preview.

Overview

The ThemeInspector component is a powerful debugging tool that provides detailed insights into your theme's structure, validates configuration, checks for accessibility issues, and shows how your theme will be transformed into CSS variables.

✨ Try it now: Interactive Inspector Example — Analyze and validate a sample theme directly in your browser.

Key Features

  • Theme Metadata - Display theme name, version, and statistics
  • Validation - Comprehensive error and warning reporting
  • Accessibility Checks - Contrast ratio analysis and WCAG compliance
  • CSS Variables Preview - See generated CSS custom properties
  • Structure Visualization - Interactive theme structure tree

Basic Usage

Simple Inspector

TSX
1import { ThemeInspector } from '@shohojdhara/atomix/theme/devtools'; 2import { createTheme } from '@shohojdhara/atomix/theme'; 3 4const theme = createTheme({ 5 name: 'My Theme', 6 palette: { 7 primary: { main: '#7AFFD7' }, 8 secondary: { main: '#FF5733' }, 9 }, 10}); 11 12function App() { 13 return ( 14 <ThemeInspector 15 theme={theme} 16 showValidation={true} 17 showCSSVariables={true} 18 showStructure={true} 19 /> 20 ); 21}
21 lines434 characters

With Custom Styling

TSX
1<ThemeInspector 2 theme={theme} 3 showValidation={true} 4 className="my-inspector" 5 style={{ maxWidth: '800px', margin: '0 auto' }} 6/>
6 lines135 characters

Props API

PropTypeDefaultDescription
themeThemeRequiredTheme object to inspect
showValidationbooleanfalseShow validation results with errors and warnings
showCSSVariablesbooleanfalseShow generated CSS custom properties
showStructurebooleanfalseShow theme structure tree visualization
classNamestring-Custom CSS class name
styleCSSProperties-Inline styles object

Advanced Examples

Development Dashboard

Integrate inspector into a development dashboard:

TSX
1import { ThemeInspector } from '@shohojdhara/atomix/theme/devtools'; 2import { useState } from 'react'; 3 4function ThemeDevelopmentDashboard() { 5 const [theme, setTheme] = useState(myTheme); 6 const [activeTab, setActiveTab] = useState('validation'); 7 8 return ( 9 <div className="dashboard"> 10 <div className="tabs"> 11 <button onClick={() => setActiveTab('validation')}> 12 Validation 13 </button> 14 <button onClick={() => setActiveTab('css')}> 15 CSS Variables 16 </button> 17 <button onClick={() => setActiveTab('structure')}> 18 Structure 19 </button> 20 </div> 21 22 <ThemeInspector 23 theme={theme} 24 showValidation={activeTab === 'validation'} 25 showCSSVariables={activeTab === 'css'} 26 showStructure={activeTab === 'structure'} 27 /> 28 </div> 29 ); 30}
30 lines847 characters

Testing Integration

Use inspector programmatically in tests:

TSX
1import { ThemeValidator } from '@shohojdhara/atomix/theme'; 2 3describe('Theme Validation', () => { 4 it('should validate theme structure', () => { 5 const theme = createTheme({ 6 palette: { primary: { main: '#7AFFD7' } }, 7 }); 8 9 const validator = new ThemeValidator(); 10 const result = validator.validate(theme); 11 12 expect(result.valid).toBe(true); 13 expect(result.errors).toHaveLength(0); 14 }); 15 16 it('should detect accessibility issues', () => { 17 const theme = createTheme({ 18 palette: { 19 primary: { main: '#FFFF00' }, // Poor contrast 20 background: { default: '#FFFFFF' }, 21 }, 22 }); 23 24 const validator = new ThemeValidator(); 25 const result = validator.validate(theme); 26 27 expect(result.warnings).toContain( 28 expect.objectContaining({ 29 type: 'accessibility', 30 message: expect.stringContaining('contrast'), 31 }) 32 ); 33 }); 34});
34 lines903 characters

Storybook Addon

Create a Storybook addon for theme inspection:

TSX
1// .storybook/addons/ThemeInspectorAddon.tsx 2import { ThemeInspector } from '@shohojdhara/atomix/theme/devtools'; 3import { useGlobals } from '@storybook/manager-api'; 4 5export function ThemeInspectorAddon() { 6 const [{ theme }] = useGlobals(); 7 8 return ( 9 <div className="storybook-addon"> 10 <ThemeInspector 11 theme={theme} 12 showValidation={true} 13 showCSSVariables={true} 14 /> 15 </div> 16 ); 17}
17 lines426 characters

Validation Features

What Gets Validated

  • Required Properties - Ensures all required theme properties are present
  • Type Checking - Validates property types and formats
  • Color Formats - Checks for valid hex, RGB, or HSL colors
  • Contrast Ratios - Analyzes text/background contrast for WCAG compliance
  • Font Families - Validates font family declarations
  • Spacing Values - Ensures valid spacing scale values

Tip: Validation runs once on mount and is memoized for performance. Results are cached until the theme object changes.

Error Levels

Errors (Red)

Critical issues that will prevent the theme from working correctly. Must be fixed before using the theme in production.

Warnings (Yellow)

Non-critical issues that may cause problems or accessibility concerns. Should be reviewed and addressed when possible.

Info (Blue)

Suggestions for improvements or best practices. Optional but recommended.

Best Practices

Use During Development

Always keep ThemeInspector open during theme development to catch issues as you make changes. Enable all inspection features for comprehensive feedback.

Check Accessibility

Pay special attention to accessibility warnings. Ensure all text/background combinations meet WCAG AA standards (4.5:1 for normal text, 3:1 for large text).

Review CSS Variables

Use the CSS variables view to verify that your theme generates the expected custom properties. This helps debug issues with theme application.

Development Only

ThemeInspector is designed for development environments. Remove it from production builds to reduce bundle size and improve performance.

Related Tools

Combine ThemeInspector with other devtools for a complete development workflow:

→ Theme Preview - Test themes with sample components→ Theme Comparator - Compare theme versions→ Live Editor - Edit themes in real-time← Back to Devtools Overview