Surfaces are intelligent, composite containers that manage background, border, shadow, and spacing. They use a flexible "Smart Mixin" syntax to apply responsive defaults while allowing granular control over density, radius, and depth.
.card { @ds-surface(contained) }.my-element {
@ds-surface(contained primary density(2) radius(2) shadow(1));
}.my-element {
background-color: palette(primary-main);
color: palette(primary-contrast);
padding: density(2);
border-radius: radius(2);
border: none;
box-shadow: shadow(1);
}The @ds-surface mixin is the primary primitive for building containers. It accepts a Variant (structure) and Tone (color), followed by optional granular tokens for Density (padding), Radius, and Shadow.