Skip to main content

Theming & Styling

eSheet uses Tailwind CSS v4 with a scoped ms: prefix and semantic color tokens. This ensures styles don't leak into or conflict with your host application.

How Styling Works

All eSheet components use Tailwind utility classes prefixed with ms:. For example:

<!-- eSheet internal markup -->
<div class="ms:flex ms:gap-2 ms:p-4 ms:bg-mssurface ms:text-mstext"></div>

This means eSheet styles are fully isolated from your app's styles. You don't need to configure Tailwind in your own project to use eSheet.

Semantic Color Tokens

eSheet uses semantic color tokens instead of hardcoded color values. These tokens are defined as CSS custom properties and can be overridden:

TokenDefaultUsage
msprimaryBlue (#2563eb)Primary actions, selected states, active elements
mssecondaryGraySecondary elements
msaccentGreenSuccess states
msdangerRed (#ef4444)Destructive actions, errors, validation
mswarningOrangeWarning indicators
mssurfaceWhiteCard/panel backgrounds
msborderGray-200Border colors
msborderinactiveGray-400Unchecked input borders
mstextGray-900Primary text
mstextsecondarySlate-50Text on primary backgrounds
mstextmutedGray-500Secondary/muted text
msbackgroundGray-50Page/section backgrounds
msbackgroundsecondaryGray-100Section backgrounds
msbackgroundhoverGray-150Hover states
msoverlayBlack/50Modal backdrop overlay

Customizing Colors

Override the CSS custom properties in your stylesheet:

/* Override eSheet's primary color to green */
:root {
--ms-color-primary: #059669;
--ms-color-danger: #dc2626;
--ms-color-surface: #fefefe;
}

Responsive Design

eSheet is responsive out of the box:

  • Desktop (lg+): Builder shows 3-column layout (Toolbox | Canvas | Editor)
  • Tablet/Mobile: Builder collapses to single-column with bottom-sheet drawers for the toolbox and editor
  • Renderer: Single-column layout that adapts to available width (max-width: 42rem)

Container Requirements

Builder

The builder fills its parent container. Ensure the parent has explicit dimensions:

{/* [OK] Good -- explicit height */}
<div style={{ height: '100vh' }}>
<EsheetBuilder ... />
</div>

{/* [X] Bad -- no height means builder collapses */}
<div>
<EsheetBuilder ... />
</div>

Renderer

The renderer is self-sizing and flows naturally in document layout. It constrains itself to max-width: 42rem and centers horizontally.