Buttons are intelligent, interactive elements styled with the @ds-button mixin. They use the same "Smart Mixin" syntax as surfaces, allowing responsive control over density, radius, and depth, with built-in state management.
.btn { @ds-button(contained primary) }.my-button {
@ds-button(contained primary density(2) radius(2) shadow(1));
}.my-button {
background-color: palette(primary-main);
color: palette(primary-contrast);
padding: density(2);
border-radius: radius(2);
border: none;
box-shadow: shadow(1);
&:hover {
background-color: palette(primary-light);
}
&:active {
transform: scale(0.98);
}
&.selected {
box-shadow: inset 0 0 0 2px currentColor;
font-weight: bold;
}
}The @ds-button mixin is the primary primitive for interactive elements. It accepts a Variant (structure) and Tone (color), followed by optional granular tokens for Density (padding), Radius, and Shadow. It automatically generates Hover, Active, and Selected states.