Materials
A material is the full look of a control’s surface: a background gradient, an edge, a shadow and a text colour. Republic has two. Use this page to choose between them.
- Primary is for the one main action on a screen, such as “Save changes” or “Send”. Use it once per view.
- Secondary is for every other action, such as “Cancel” or “Export”.
Apply a material with its class. The class sets background, border, shadow and text colour only. Size, padding and radius come from the component that uses it.
<button class="rp-material-primary">Save changes</button><button class="rp-material-secondary">Cancel</button>The values live in the --rp-material-primary-* and --rp-material-secondary-* tokens, so a theme can change them. Both materials meet 4.5:1 for their text in both themes, at every stop of the gradient.
Disabled
Section titled “Disabled”A disabled control keeps its material and drops to 40% opacity (--rp-opacity-disabled). It is exempt from contrast rules. Do not rely on a disabled control to explain itself: say what the person must do first, near the control.
Samples
Section titled “Samples”Each panel shows primary and secondary, then the same pair disabled. Touch density makes controls taller, so they are easier to tap. See Density.