-
Notifications
You must be signed in to change notification settings - Fork 25
Description
OpenCloud Material Design Guideline
This guide aims at making the OpenCloud adaption of material design easy to
understand and usable across all client platforms.
Material Design Concepts
The base concept of material design is that components are being layered on
top of each other, where the highest layer is the one closest to the users eye,
while the furthest layer is the one in the background.
The background is called Surface.
The main design elements in material design are shapes, fonts and color roles.
Color System
The material design color system consists of color roles. These roles are supposed
to express the different layers of components.
Pairing and Layering Colors
Use matching On roles for text and icons on top of surfaces. This ensures visual accessibility (color contrast of 3:1 or better).
Examples:
- Use
OnPrimaryfor text and icons onPrimarycolored elements. - Use
OnSurfaceVariantfor text and icons onSurfaceVariantcolored elements.
Primary
Use primary roles for most prominent components (important buttons, active states).
Primaryfor important fills, text and icons againstSurfacePrimaryContainerfor standout fills againstSurface(rarely or never)
We only use PrimaryContainer for hover and active/focussed states.
Secondary
Use secondary roles for less prominent components (anything that's not a CTA).
Secondaryfor regular fills, text and icons againstSurfaceSecondaryContainerfor recessive components like tonal buttons againstSurface
Tertiary
Use tertiary roles for contrasting accents.
Tertiaryfor complementary fills, text and icons againstSurfaceTertiaryContainerfor complementary container fills againstSurface, like input fields (e.g. the active state of a toggle-switch).
Error
Use error roles for error states (incorrect password, error message, etc).
Errorfor attention-grabbing fills, text and icons againstSurface(-> urgency!)ErrorContainerfor attention-grabbing fills againstSurface(-> less urgent)
Surface
Use surface roles for backgrounds, container roles for components like cards, sheets, dialogs.
Surfacedefault color for backgrounds. Note: In OpenCloud Web thebackgroundlayer is the app content area.- Five container roles expressing different level of emphasis:
SurfaceContainerLowestlowest-emphasis containerSurfaceContainerLowlow-emphasis containerSurfaceContainerdefault containerSurfaceContainerHighhigh-emphasis containerSurfaceContainerHighesthighest-emphasis container- While
SurfaceContaineris the default, others are helpful for creating hierarchy and nested containers.
- Most common combination of surface roles uses
Surfacefor a background area andSurfaceContainerfor a navigation area. - Special: for surfaces there are two different
Onroles:- Use
OnSurfaceby default for text and icons against any surface role - Use
OnSurfaceVariantfor lower emphasis text and icons against any surface role
- Use
Inverse
Use inverse roles for components to achieve reverse of surrounding UI.
InverseSurfacefor background fills (high contrast against surface, e.g. snackbar)InverseOnSurfacefor text and icons againstInverseSurfaceInversePrimaryfor actionable elements, e.g. text buttons (e.g.Xfor closing a snackbar)
Outline
Use for outlines against surface roles.
Outlineimportant boundaries, e.g. text field outline, filter chip outline, etcOutlineVariantdecorative, e.g. dividers, border around cards / multi-element-components
Add-on roles
There are additional color roles with Fixed in their name. Those roles have the same color
independent of the currently active theme variant (light or dark). Because of that, color contrast
ratios are not guaranteed and we don't use them as of now.