Skip to content

Elements

Every element is a set of ms-* classes. Write them by hand (plain HTML, server templates, any framework) or get them from a recipe. React components render the same classes, see the @mainset/react components.

All element rules have zero specificity (:where()), or (0,0,1) where a tag is part of the selector (h2:where(.ms-heading)). So utility classes and your own CSS always win, in any load order. Customize through the tokens, not by copying rules.

Props and classes

Props with a prefix (spc*, flx*, lay*, grd*, ctn*, txt*, lnk*, ctl*, spn*, btn*, crd*, lst*, sgc*, ovr*, dlg*, tbs*, nav*) map to modifier classes: ctlSize: 'lg' → ms-control--size-lg. Props marked responsive also take a per-breakpoint object, see Responsive props.

import { buttonRecipe } from '@mainset/ui-core';

buttonRecipe({ srfVariant: 'outlined', srfTheme: 'error', ctlSize: 'sm' });
// → "ms-background ms-border ms-surface ms-surface--hover-all ms-surface--variant-outlined
//    ms-control ms-control--size-sm ms-button ms-tone-error"

Layers

Each element's CSS is two files: a normalize layer (mechanics, never themed) and a theme layer (the mainset look). See Layers and direction.