Package org.patternfly.token
package org.patternfly.token
PatternFly design tokens for Java.
This package provides predefined enum constants for all PatternFly design tokens. Design tokens are the visual design atoms of the design system — specifically, they are named entities that store visual design attributes. They are used in place of hard-coded values to ensure flexibility and unity across the design system.
All tokens are defined in the Token enum class. Each token constant has three properties:
name- The CSS custom property name starting with--pf-tvalue- The default value for the custom propertyvar- The property name wrapped invar(), ready to use in styles
Example usage:
import static org.patternfly.style.Classes.modifier;
import static org.patternfly.token.Token.*;
// Access token properties
String name = color_blue_10.name; // "--pf-t--global--color--blue--10"
String value = color_blue_10.value; // "#cfe7ff"
String var = color_blue_10.var; // "var(--pf-t--global--color--blue--10)"
// Use in styles
div().css(modifier("custom"))
.style("color", color_blue_50.var)
.style("background-color", color_blue_10.var);
- See Also:
-
Enum Classes