Skip to main content brightness_auto motion_photos_off palette download more_vert
toc

Theming

Material Design theming creates unique branded products with familiar patterns and accessible interactions.

collage of views of a mobile UI that show a user's setting and preference for
a green primary color flows through system UI
harmoniously

Material is expressed in design tokens, which are the building blocks of all UI elements.

In 3.0, the md-gb-* elements are themed with system tokens, which map roles to concrete reference values. Load them once for the document with adoptStyles(), then override any token with CSS.

HTMLJS
<md-gb-button color="filled">Save</md-gb-button>

System tokens are CSS custom properties in the md.sys.* cascade layers, so unlayered CSS always wins and they can be scoped with any selector.

Save
HTMLCSS
<div class="square-corners">
  <md-gb-button color="filled">Save</md-gb-button>
</div>

System tokens define the decisions and roles that give the design system its character: color, typography, shape, elevation, space, and motion.

--md-sys-color tokens define the dynamic color roles. They use light-dark(), so they follow color-scheme. See the color guide.

Save
HTMLCSS
<md-gb-button color="filled">Save</md-gb-button>

--md-sys-typescale tokens define the type scale, including the emphasized styles. See the typography guide.

Your draft was saved to the inbox.

HTMLCSS
<p class="body">Your draft was saved to the inbox.</p>

--md-sys-shape tokens define the corner scale, including single-corner values. See the shape guide.

Medium corners
HTMLCSS
<div class="box">Medium corners</div>

--md-sys-motion tokens define the motion scheme: spring tokens (--md-sys-motion-spring-<speed>-<spatial|effects>, each with a matching -duration), easing curves, and durations. Springs are linear() easings. The standard scheme applies to elements inside .md-motion-standard.

HTMLCSSJS
<md-gb-button id="slide" color="filled">Slide</md-gb-button>
<div id="panel" class="panel">Panel</div>

The md-gb-* elements do not expose per-component tokens. Change how a component looks by changing the system tokens it uses (color roles, typescale styles, shape corners, motion), by scoping them to a selector, or with the component's attributes such as variant and size.

Delete
HTMLCSS
<md-gb-button class="error" color="filled">Delete</md-gb-button>
Install Material Web 3.0

Your browser did not offer to install the docs as an app. Install them from the browser instead:

Close
Send feedback
Bug Documentation Idea

Opens a new GitHub issue for material-components/material-web in a new tab, with this filled in.

Cancel Open issue