Understanding
Forced colors is a particularly important consideration for users with visual impairments or other color vision deficiencies. As designers and developers working with Horizon, it's crucial to ensure that products align with our design system's approach to forced colors, providing a consistent and accessible experience for our users.
CSS4 provides forced color keywords that map to specific colors defined by the user's operating system or browser settings. These keywords are grouped into pairs or triplets to ensure proper contrast and differentiation between various types of components and states.
Designing
When designing components and layouts, use the following practices to ensure alignment with forced colors best practices and with the Horizon design system’s techniques.
The main keyword groupings are:
- Static content: Canvas, CanvasText
- Interactive content (text-based): LinkText, VisitedText, ActiveText,
- Interactive content (target-based): ButtonFace, ButtonText, ButtonBorder
- Input fields: Field, FieldText, ButtonBorder
- States and Emphasis content: Highlight, HighlightText, SelectedItem, SelectedItemText, GrayText, Mark, MarkText
Annotating
Next Experience Components are carefully annotated in Figma using assets that communicate which parts of a component are mapped to specific forced color keywords. Our accessibility specification template includes a sample forced color theme that you may use to examine how each component will render under a specific forced color scheme. By referring to these annotated components in Figma, designers can conceptualize the appropriate color pairings and apply them consistently across their designs, and developers and quality testers can better understand and visualize the required result.