The style macro supports a constrained set of values per property that conform to Spectrum 2.
Colors
All Spectrum 2 color tokens are available across color properties (e.g., backgroundColor, color, borderColor).
Values
The backgroundColor property supports the following values, in addition to the semantic and global colors. These colors are specifically chosen to be used as backgrounds, so prefer them over global colors where possible.
The following values are available across all color properties. Prefer to use semantic colors over global colors when they represent a specific meaning.
The following values are available across all color properties.
These colors are useful for overlays or transparent effects.
These colors map to system colors when forced colors mode is active.
BackgroundButtonBorderButtonFaceButtonTextFieldHighlightHighlightTextGrayTextMarkLinkText
Values
The following values are available across all color properties. Prefer to use semantic colors over global colors when they represent a specific meaning.
The following values are available across all color properties.
These colors are useful for overlays or transparent effects.
These colors map to system colors when forced colors mode is active.
BackgroundButtonBorderButtonFaceButtonTextFieldHighlightHighlightTextGrayTextMarkLinkText
Values
The color property supports the following values, in addition to the semantic and global colors. These colors are specifically chosen to be used as text colors, so prefer them over global colors where possible.
The following values are available across all color properties. Prefer to use semantic colors over global colors when they represent a specific meaning.
The following values are available across all color properties.
These colors are useful for overlays or transparent effects.
These colors map to system colors when forced colors mode is active.
BackgroundButtonBorderButtonFaceButtonTextFieldHighlightHighlightTextGrayTextMarkLinkText
Values
'none'currentColor
The following values are available across all color properties. Prefer to use semantic colors over global colors when they represent a specific meaning.
The following values are available across all color properties.
These colors are useful for overlays or transparent effects.
These colors map to system colors when forced colors mode is active.
BackgroundButtonBorderButtonFaceButtonTextFieldHighlightHighlightTextGrayTextMarkLinkText
Values
The following values are available across all color properties. Prefer to use semantic colors over global colors when they represent a specific meaning.
The following values are available across all color properties.
These colors are useful for overlays or transparent effects.
These colors map to system colors when forced colors mode is active.
BackgroundButtonBorderButtonFaceButtonTextFieldHighlightHighlightTextGrayTextMarkLinkText
Values
'none'currentColor
The following values are available across all color properties. Prefer to use semantic colors over global colors when they represent a specific meaning.
The following values are available across all color properties.
These colors are useful for overlays or transparent effects.
These colors map to system colors when forced colors mode is active.
BackgroundButtonBorderButtonFaceButtonTextFieldHighlightHighlightTextGrayTextMarkLinkText
Dimensions
Values
auto'square'1:1 aspect ratio.'video'16:9 aspect ratio.'number / number'
Values
0 | 1 | 2 | 4Values
0 | 1 | 2 | 4Values
baseSpacingBase spacing values in pixels, following a 4px grid. Will be converted to rem.0 | 2 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 56 | 64 | 80 | 96
Values
0 | 1 | 2 | 4Values
0 | 1 | 2 | 4Maps to
borderTopWidth, borderBottomWidth, borderStartWidth, borderEndWidthValues
0 | 1 | 2 | 4Maps to
borderStartWidth, borderEndWidthValues
0 | 1 | 2 | 4Maps to
borderTopWidth, borderBottomWidthValues
0 | 1 | 2 | 4Values
auto'full'Resolves to100%.baseSpacingBase spacing values in pixels, following a 4px grid. Will be converted to rem.0 | 2 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 56 | 64 | 80 | 96negativeSpacingNegative spacing values in pixels, following a 4px grid. Will be converted to rem.-2 | -4 | -8 | -12 | -16 | -20 | -24 | -28 | -32 | -36 | -40 | -44 | -48 | -56 | -64 | -80 | -96lengthPercentageA CSS length value with percentage or viewport units. e.g.'50%','100vw','50vh'
Values
'text-to-control'Default spacing between text and a control (e.g., label and input). Scales with font size.'text-to-visual'Default spacing between text and a visual element (e.g., icon). Scales with font size.'edge-to-text'Default spacing between the edge of a control and its text. Relative to control height.'pill'Default spacing between the edge of a pill-shaped control and its text. Relative to control height.baseSpacingBase spacing values in pixels, following a 4px grid. Will be converted to rem.0 | 2 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 56 | 64 | 80 | 96
Values
auto'full'Resolves to100%.numberA numeric value in pixels e.g.20. Will be converted to rem and scaled on touch devices.lengthPercentageA CSS length value with percentage or viewport units. e.g.'50%','100vw','50vh'
Maps to
rowGap, columnGapValues
'text-to-control'Default spacing between text and a control (e.g., label and input). Scales with font size.'text-to-visual'Default spacing between text and a visual element (e.g., icon). Scales with font size.'edge-to-text'Default spacing between the edge of a control and its text. Relative to control height.'pill'Default spacing between the edge of a pill-shaped control and its text. Relative to control height.baseSpacingBase spacing values in pixels, following a 4px grid. Will be converted to rem.0 | 2 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 56 | 64 | 80 | 96
Maps to
top, bottom, insetStart, insetEndValues
'auto''full'Resolves to100%.baseSpacingBase spacing values in pixels, following a 4px grid. Will be converted to rem.0 | 2 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 56 | 64 | 80 | 96negativeSpacingNegative spacing values in pixels, following a 4px grid. Will be converted to rem.-2 | -4 | -8 | -12 | -16 | -20 | -24 | -28 | -32 | -36 | -40 | -44 | -48 | -56 | -64 | -80 | -96lengthPercentageA CSS length value with percentage or viewport units. e.g.'50%','100vw','50vh'
Values
auto'full'Resolves to100%.baseSpacingBase spacing values in pixels, following a 4px grid. Will be converted to rem.0 | 2 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 56 | 64 | 80 | 96negativeSpacingNegative spacing values in pixels, following a 4px grid. Will be converted to rem.-2 | -4 | -8 | -12 | -16 | -20 | -24 | -28 | -32 | -36 | -40 | -44 | -48 | -56 | -64 | -80 | -96lengthPercentageA CSS length value with percentage or viewport units. e.g.'50%','100vw','50vh'
Values
auto'full'Resolves to100%.baseSpacingBase spacing values in pixels, following a 4px grid. Will be converted to rem.0 | 2 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 56 | 64 | 80 | 96negativeSpacingNegative spacing values in pixels, following a 4px grid. Will be converted to rem.-2 | -4 | -8 | -12 | -16 | -20 | -24 | -28 | -32 | -36 | -40 | -44 | -48 | -56 | -64 | -80 | -96lengthPercentageA CSS length value with percentage or viewport units. e.g.'50%','100vw','50vh'
Maps to
insetStart, insetEndValues
'auto''full'Resolves to100%.baseSpacingBase spacing values in pixels, following a 4px grid. Will be converted to rem.0 | 2 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 56 | 64 | 80 | 96negativeSpacingNegative spacing values in pixels, following a 4px grid. Will be converted to rem.-2 | -4 | -8 | -12 | -16 | -20 | -24 | -28 | -32 | -36 | -40 | -44 | -48 | -56 | -64 | -80 | -96lengthPercentageA CSS length value with percentage or viewport units. e.g.'50%','100vw','50vh'
Maps to
top, bottomValues
'auto''full'Resolves to100%.baseSpacingBase spacing values in pixels, following a 4px grid. Will be converted to rem.0 | 2 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 56 | 64 | 80 | 96negativeSpacingNegative spacing values in pixels, following a 4px grid. Will be converted to rem.-2 | -4 | -8 | -12 | -16 | -20 | -24 | -28 | -32 | -36 | -40 | -44 | -48 | -56 | -64 | -80 | -96lengthPercentageA CSS length value with percentage or viewport units. e.g.'50%','100vw','50vh'
Values
auto'full'Resolves to100%.baseSpacingBase spacing values in pixels, following a 4px grid. Will be converted to rem.0 | 2 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 56 | 64 | 80 | 96negativeSpacingNegative spacing values in pixels, following a 4px grid. Will be converted to rem.-2 | -4 | -8 | -12 | -16 | -20 | -24 | -28 | -32 | -36 | -40 | -44 | -48 | -56 | -64 | -80 | -96lengthPercentageA CSS length value with percentage or viewport units. e.g.'50%','100vw','50vh'
Maps to
marginTop, marginBottom, marginStart, marginEndValues
'auto'baseSpacingBase spacing values in pixels, following a 4px grid. Will be converted to rem.0 | 2 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 56 | 64 | 80 | 96negativeSpacingNegative spacing values in pixels, following a 4px grid. Will be converted to rem.-2 | -4 | -8 | -12 | -16 | -20 | -24 | -28 | -32 | -36 | -40 | -44 | -48 | -56 | -64 | -80 | -96lengthPercentageA CSS length value with percentage or viewport units. e.g.'50%','100vw','50vh'
Values
autobaseSpacingBase spacing values in pixels, following a 4px grid. Will be converted to rem.0 | 2 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 56 | 64 | 80 | 96negativeSpacingNegative spacing values in pixels, following a 4px grid. Will be converted to rem.-2 | -4 | -8 | -12 | -16 | -20 | -24 | -28 | -32 | -36 | -40 | -44 | -48 | -56 | -64 | -80 | -96lengthPercentageA CSS length value with percentage or viewport units. e.g.'50%','100vw','50vh'
Values
autobaseSpacingBase spacing values in pixels, following a 4px grid. Will be converted to rem.0 | 2 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 56 | 64 | 80 | 96negativeSpacingNegative spacing values in pixels, following a 4px grid. Will be converted to rem.-2 | -4 | -8 | -12 | -16 | -20 | -24 | -28 | -32 | -36 | -40 | -44 | -48 | -56 | -64 | -80 | -96lengthPercentageA CSS length value with percentage or viewport units. e.g.'50%','100vw','50vh'
Values
autobaseSpacingBase spacing values in pixels, following a 4px grid. Will be converted to rem.0 | 2 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 56 | 64 | 80 | 96negativeSpacingNegative spacing values in pixels, following a 4px grid. Will be converted to rem.-2 | -4 | -8 | -12 | -16 | -20 | -24 | -28 | -32 | -36 | -40 | -44 | -48 | -56 | -64 | -80 | -96lengthPercentageA CSS length value with percentage or viewport units. e.g.'50%','100vw','50vh'
Values
autobaseSpacingBase spacing values in pixels, following a 4px grid. Will be converted to rem.0 | 2 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 56 | 64 | 80 | 96negativeSpacingNegative spacing values in pixels, following a 4px grid. Will be converted to rem.-2 | -4 | -8 | -12 | -16 | -20 | -24 | -28 | -32 | -36 | -40 | -44 | -48 | -56 | -64 | -80 | -96lengthPercentageA CSS length value with percentage or viewport units. e.g.'50%','100vw','50vh'
Maps to
marginStart, marginEndValues
'auto'baseSpacingBase spacing values in pixels, following a 4px grid. Will be converted to rem.0 | 2 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 56 | 64 | 80 | 96negativeSpacingNegative spacing values in pixels, following a 4px grid. Will be converted to rem.-2 | -4 | -8 | -12 | -16 | -20 | -24 | -28 | -32 | -36 | -40 | -44 | -48 | -56 | -64 | -80 | -96lengthPercentageA CSS length value with percentage or viewport units. e.g.'50%','100vw','50vh'
Maps to
marginTop, marginBottomValues
'auto'baseSpacingBase spacing values in pixels, following a 4px grid. Will be converted to rem.0 | 2 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 56 | 64 | 80 | 96negativeSpacingNegative spacing values in pixels, following a 4px grid. Will be converted to rem.-2 | -4 | -8 | -12 | -16 | -20 | -24 | -28 | -32 | -36 | -40 | -44 | -48 | -56 | -64 | -80 | -96lengthPercentageA CSS length value with percentage or viewport units. e.g.'50%','100vw','50vh'
Maps to
paddingTop, paddingBottom, paddingStart, paddingEndValues
'text-to-control'Default spacing between text and a control (e.g., label and input). Scales with font size.'text-to-visual'Default spacing between text and a visual element (e.g., icon). Scales with font size.'edge-to-text'Default spacing between the edge of a control and its text. Relative to control height.'pill'Default spacing between the edge of a pill-shaped control and its text. Relative to control height.baseSpacingBase spacing values in pixels, following a 4px grid. Will be converted to rem.0 | 2 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 56 | 64 | 80 | 96lengthPercentageA CSS length value with percentage or viewport units. e.g.'50%','100vw','50vh'
Values
'text-to-control'Default spacing between text and a control (e.g., label and input). Scales with font size.'text-to-visual'Default spacing between text and a visual element (e.g., icon). Scales with font size.'edge-to-text'Default spacing between the edge of a control and its text. Relative to control height.'pill'Default spacing between the edge of a pill-shaped control and its text. Relative to control height.baseSpacingBase spacing values in pixels, following a 4px grid. Will be converted to rem.0 | 2 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 56 | 64 | 80 | 96lengthPercentageA CSS length value with percentage or viewport units. e.g.'50%','100vw','50vh'
Values
'text-to-control'Default spacing between text and a control (e.g., label and input). Scales with font size.'text-to-visual'Default spacing between text and a visual element (e.g., icon). Scales with font size.'edge-to-text'Default spacing between the edge of a control and its text. Relative to control height.'pill'Default spacing between the edge of a pill-shaped control and its text. Relative to control height.baseSpacingBase spacing values in pixels, following a 4px grid. Will be converted to rem.0 | 2 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 56 | 64 | 80 | 96lengthPercentageA CSS length value with percentage or viewport units. e.g.'50%','100vw','50vh'
Values
'text-to-control'Default spacing between text and a control (e.g., label and input). Scales with font size.'text-to-visual'Default spacing between text and a visual element (e.g., icon). Scales with font size.'edge-to-text'Default spacing between the edge of a control and its text. Relative to control height.'pill'Default spacing between the edge of a pill-shaped control and its text. Relative to control height.baseSpacingBase spacing values in pixels, following a 4px grid. Will be converted to rem.0 | 2 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 56 | 64 | 80 | 96lengthPercentageA CSS length value with percentage or viewport units. e.g.'50%','100vw','50vh'
Values
'text-to-control'Default spacing between text and a control (e.g., label and input). Scales with font size.'text-to-visual'Default spacing between text and a visual element (e.g., icon). Scales with font size.'edge-to-text'Default spacing between the edge of a control and its text. Relative to control height.'pill'Default spacing between the edge of a pill-shaped control and its text. Relative to control height.baseSpacingBase spacing values in pixels, following a 4px grid. Will be converted to rem.0 | 2 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 56 | 64 | 80 | 96lengthPercentageA CSS length value with percentage or viewport units. e.g.'50%','100vw','50vh'
Maps to
paddingStart, paddingEndValues
'text-to-control'Default spacing between text and a control (e.g., label and input). Scales with font size.'text-to-visual'Default spacing between text and a visual element (e.g., icon). Scales with font size.'edge-to-text'Default spacing between the edge of a control and its text. Relative to control height.'pill'Default spacing between the edge of a pill-shaped control and its text. Relative to control height.baseSpacingBase spacing values in pixels, following a 4px grid. Will be converted to rem.0 | 2 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 56 | 64 | 80 | 96lengthPercentageA CSS length value with percentage or viewport units. e.g.'50%','100vw','50vh'
Maps to
paddingTop, paddingBottomValues
'text-to-control'Default spacing between text and a control (e.g., label and input). Scales with font size.'text-to-visual'Default spacing between text and a visual element (e.g., icon). Scales with font size.'edge-to-text'Default spacing between the edge of a control and its text. Relative to control height.'pill'Default spacing between the edge of a pill-shaped control and its text. Relative to control height.baseSpacingBase spacing values in pixels, following a 4px grid. Will be converted to rem.0 | 2 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 56 | 64 | 80 | 96lengthPercentageA CSS length value with percentage or viewport units. e.g.'50%','100vw','50vh'
Values
auto'full'Resolves to100%.baseSpacingBase spacing values in pixels, following a 4px grid. Will be converted to rem.0 | 2 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 56 | 64 | 80 | 96negativeSpacingNegative spacing values in pixels, following a 4px grid. Will be converted to rem.-2 | -4 | -8 | -12 | -16 | -20 | -24 | -28 | -32 | -36 | -40 | -44 | -48 | -56 | -64 | -80 | -96lengthPercentageA CSS length value with percentage or viewport units. e.g.'50%','100vw','50vh'
Values
number'${number}deg''${number}rad''${number}grad''${number}turn'
Values
'text-to-control'Default spacing between text and a control (e.g., label and input). Scales with font size.'text-to-visual'Default spacing between text and a visual element (e.g., icon). Scales with font size.'edge-to-text'Default spacing between the edge of a control and its text. Relative to control height.'pill'Default spacing between the edge of a pill-shaped control and its text. Relative to control height.baseSpacingBase spacing values in pixels, following a 4px grid. Will be converted to rem.0 | 2 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 56 | 64 | 80 | 96
Values
number'${number}%'
Values
number'${number}%'
Maps to
scrollMarginTop, scrollMarginBottom, scrollMarginStart, scrollMarginEndValues
baseSpacingBase spacing values in pixels, following a 4px grid. Will be converted to rem.0 | 2 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 56 | 64 | 80 | 96
Values
baseSpacingBase spacing values in pixels, following a 4px grid. Will be converted to rem.0 | 2 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 56 | 64 | 80 | 96
Values
baseSpacingBase spacing values in pixels, following a 4px grid. Will be converted to rem.0 | 2 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 56 | 64 | 80 | 96
Values
baseSpacingBase spacing values in pixels, following a 4px grid. Will be converted to rem.0 | 2 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 56 | 64 | 80 | 96
Values
baseSpacingBase spacing values in pixels, following a 4px grid. Will be converted to rem.0 | 2 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 56 | 64 | 80 | 96
Maps to
scrollMarginStart, scrollMarginEndValues
baseSpacingBase spacing values in pixels, following a 4px grid. Will be converted to rem.0 | 2 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 56 | 64 | 80 | 96
Maps to
scrollMarginTop, scrollMarginBottomValues
baseSpacingBase spacing values in pixels, following a 4px grid. Will be converted to rem.0 | 2 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 56 | 64 | 80 | 96
Maps to
scrollPaddingTop, scrollPaddingBottom, scrollPaddingStart, scrollPaddingEndValues
baseSpacingBase spacing values in pixels, following a 4px grid. Will be converted to rem.0 | 2 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 56 | 64 | 80 | 96
Values
baseSpacingBase spacing values in pixels, following a 4px grid. Will be converted to rem.0 | 2 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 56 | 64 | 80 | 96
Values
baseSpacingBase spacing values in pixels, following a 4px grid. Will be converted to rem.0 | 2 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 56 | 64 | 80 | 96
Values
baseSpacingBase spacing values in pixels, following a 4px grid. Will be converted to rem.0 | 2 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 56 | 64 | 80 | 96
Values
baseSpacingBase spacing values in pixels, following a 4px grid. Will be converted to rem.0 | 2 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 56 | 64 | 80 | 96
Maps to
scrollPaddingStart, scrollPaddingEndValues
baseSpacingBase spacing values in pixels, following a 4px grid. Will be converted to rem.0 | 2 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 56 | 64 | 80 | 96
Maps to
scrollPaddingTop, scrollPaddingBottomValues
baseSpacingBase spacing values in pixels, following a 4px grid. Will be converted to rem.0 | 2 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 56 | 64 | 80 | 96
Values
0 | 1 | 2Values
baseSpacingBase spacing values in pixels, following a 4px grid. Will be converted to rem.0 | 2 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 56 | 64 | 80 | 96lengthPercentageA CSS length value with percentage or viewport units. e.g.'50%','100vw','50vh'
Values
auto'full'Resolves to100%.baseSpacingBase spacing values in pixels, following a 4px grid. Will be converted to rem.0 | 2 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 56 | 64 | 80 | 96negativeSpacingNegative spacing values in pixels, following a 4px grid. Will be converted to rem.-2 | -4 | -8 | -12 | -16 | -20 | -24 | -28 | -32 | -36 | -40 | -44 | -48 | -56 | -64 | -80 | -96lengthPercentageA CSS length value with percentage or viewport units. e.g.'50%','100vw','50vh'
Values
Maps to
translateX, translateYValues
'full'Resolves to100%.baseSpacingBase spacing values in pixels, following a 4px grid. Will be converted to rem.0 | 2 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 56 | 64 | 80 | 96negativeSpacingNegative spacing values in pixels, following a 4px grid. Will be converted to rem.-2 | -4 | -8 | -12 | -16 | -20 | -24 | -28 | -32 | -36 | -40 | -44 | -48 | -56 | -64 | -80 | -96lengthPercentageA CSS length value with percentage or viewport units. e.g.'50%','100vw','50vh'
Values
'full'Resolves to100%.baseSpacingBase spacing values in pixels, following a 4px grid. Will be converted to rem.0 | 2 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 56 | 64 | 80 | 96negativeSpacingNegative spacing values in pixels, following a 4px grid. Will be converted to rem.-2 | -4 | -8 | -12 | -16 | -20 | -24 | -28 | -32 | -36 | -40 | -44 | -48 | -56 | -64 | -80 | -96lengthPercentageA CSS length value with percentage or viewport units. e.g.'50%','100vw','50vh'
Values
'full'Resolves to100%.baseSpacingBase spacing values in pixels, following a 4px grid. Will be converted to rem.0 | 2 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 56 | 64 | 80 | 96negativeSpacingNegative spacing values in pixels, following a 4px grid. Will be converted to rem.-2 | -4 | -8 | -12 | -16 | -20 | -24 | -28 | -32 | -36 | -40 | -44 | -48 | -56 | -64 | -80 | -96lengthPercentageA CSS length value with percentage or viewport units. e.g.'50%','100vw','50vh'
Text
Spectrum 2 typography can be applied via the font shorthand, which sets fontFamily, fontSize, fontWeight, lineHeight, and color. You can override any of these individually.
Note that font should be applied on a per element basis rather than globally so as to properly conform with Spectrum designs.
<main>
<h1 className={style({font: 'heading-xl'})}>Heading</h1>
<p className={style({font: 'body'})}>Body</p>
<ul className={style({font: 'body-sm', fontWeight: 'bold'})}>
<li>List item</li>
</ul>
</main>
Maps to
fontFamily, fontSize, fontWeight, lineHeight, colorThere are several different type scales.
- UI – use within interactive UI components.
- Body – use for the content of pages that are primarily text.
- Heading – use for headings in content pages.
- Title – use for titles within UI components such as cards or panels.
- Detail – use for less important metadata.
- Code – use for source code.
Each type scale has a default size, and several t-shirt size modifiers for additional sizes.
- ui-xs
- ui-sm
- ui
- ui-lg
- ui-xl
- ui-2xl
- ui-3xl
- body-2xs
- body-xs
- body-sm
- body
- body-lg
- body-xl
- body-2xl
- body-3xl
- heading-2xs
- heading-xs
- heading-sm
- heading
- heading-lg
- heading-xl
- heading-2xl
- heading-3xl
- title-xs
- title-sm
- title
- title-lg
- title-xl
- title-2xl
- title-3xl
- detail-sm
- detail
- detail-lg
- detail-xl
- code-sm
- code
- code-lg
- code-xl
Values
'sans''serif''code'
There are several different type scales.
- UI – use within interactive UI components.
- Body – use for the content of pages that are primarily text.
- Heading – use for headings in content pages.
- Title – use for titles within UI components such as cards or panels.
- Detail – use for less important metadata.
- Code – use for source code.
Each type scale has a default size, and several t-shirt size modifiers for additional sizes.
- ui-xs
- ui-sm
- ui
- ui-lg
- ui-xl
- ui-2xl
- ui-3xl
- body-2xs
- body-xs
- body-sm
- body
- body-lg
- body-xl
- body-2xl
- body-3xl
- heading-2xs
- heading-xs
- heading-sm
- heading
- heading-lg
- heading-xl
- heading-2xl
- heading-3xl
- title-xs
- title-sm
- title
- title-lg
- title-xl
- title-2xl
- title-3xl
- detail-sm
- detail
- detail-lg
- detail-xl
- code-sm
- code
- code-lg
- code-xl
Values
'normal''medium''bold''extra-bold''black''heading'Use for headings in content pages.'title'Use for titles within UI components such as cards or panels.'detail'Use for less important metadata.
Values
Values
'ui'Use within interactive UI components.'heading'Use for headings in content pages.'title'Use for titles within UI components such as cards or panels.'body'Use for the content of pages that are primarily text.'detail'Use for less important metadata.'code'Use for source code.
Values
Maps to
overflowX, overflowY, textOverflow, whiteSpaceValues
'boolean'
Effects
Maps to
animation, animationDuration, animationTimingFunctionValues
Values
string'LinearGradient'
Values
'none''sm''default''lg''xl''full'Resolves to9999pxfor fully rounded corners.'pill'Default spacing between the edge of a pill-shaped control and its text. Relative to control height.
Maps to
borderBottomStartRadius, borderBottomEndRadiusValues
'none''sm''default''lg''xl''full'Resolves to9999pxfor fully rounded corners.'pill'Default spacing between the edge of a pill-shaped control and its text. Relative to control height.
Values
'none''sm''default''lg''xl''full'Resolves to9999pxfor fully rounded corners.'pill'Default spacing between the edge of a pill-shaped control and its text. Relative to control height.
Maps to
borderTopEndRadius, borderBottomEndRadiusValues
'none''sm''default''lg''xl''full'Resolves to9999pxfor fully rounded corners.'pill'Default spacing between the edge of a pill-shaped control and its text. Relative to control height.
Maps to
borderTopStartRadius, borderTopEndRadius, borderBottomStartRadius, borderBottomEndRadiusValues
'none''sm''default''lg''xl''full'Resolves to9999pxfor fully rounded corners.'pill'Default spacing between the edge of a pill-shaped control and its text. Relative to control height.
Maps to
borderTopStartRadius, borderBottomStartRadiusValues
'none''sm''default''lg''xl''full'Resolves to9999pxfor fully rounded corners.'pill'Default spacing between the edge of a pill-shaped control and its text. Relative to control height.
Values
'none''sm''default''lg''xl''full'Resolves to9999pxfor fully rounded corners.'pill'Default spacing between the edge of a pill-shaped control and its text. Relative to control height.
Maps to
borderTopStartRadius, borderTopEndRadiusValues
'none''sm''default''lg''xl''full'Resolves to9999pxfor fully rounded corners.'pill'Default spacing between the edge of a pill-shaped control and its text. Relative to control height.
Values
'none''sm''default''lg''xl''full'Resolves to9999pxfor fully rounded corners.'pill'Default spacing between the edge of a pill-shaped control and its text. Relative to control height.
Values
'emphasized'Shadow for emphasized states.'elevated'Shadow for elevated surfaces.'dragged'Shadow for elements being dragged.none
Values
Values
'emphasized'Shadow for emphasized states.'elevated'Shadow for elevated surfaces.'dragged'Shadow for elements being dragged.none
Values
Values
Values
0 | 1 | 2 | 4Maps to
transition, transitionDuration, transitionTimingFunctionValues
'default'Sets transition property to color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, translate, scale, rotate, filter, and backdrop-filter.'colors'Sets transition property to color, background-color, border-color, text-decoration-color, fill, and stroke.'opacity'Sets transition property to opacity.'shadow'Sets transition property to box-shadow.'transform'Sets transition property to transform, translate, scale, and rotate properties.'all'Sets transition to all animatable properties.'none'
Layout
Values
Values
Values
Values
Maps to
gridColumnStart, gridColumnEnd, gridRowStart, gridRowEndValues
Values
automin-contentmax-content'${number}fr''minmax(${string}, ${string})'stringbaseSpacingBase spacing values in pixels, following a 4px grid. Will be converted to rem.0 | 2 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 56 | 64 | 80 | 96
Values
automin-contentmax-content'${number}fr''minmax(${string}, ${string})'stringbaseSpacingBase spacing values in pixels, following a 4px grid. Will be converted to rem.0 | 2 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 56 | 64 | 80 | 96
Values
Values
Values
Values
Values
Values
automin-contentmax-content'${number}fr''minmax(${string}, ${string})'nonesubgridstringbaseSpacingBase spacing values in pixels, following a 4px grid. Will be converted to rem.0 | 2 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 56 | 64 | 80 | 96
Values
automin-contentmax-content'${number}fr''minmax(${string}, ${string})'nonesubgridstringbaseSpacingBase spacing values in pixels, following a 4px grid. Will be converted to rem.0 | 2 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 56 | 64 | 80 | 96
Values
Maps to
overflowX, overflowYValues
'auto''hidden''clip''visible''scroll'
Maps to
overscrollBehaviorX, overscrollBehaviorYValues
'auto''contain''none'
Maps to
alignContent, justifyContentValues
'normal''center''start''end''space-between''space-around''space-evenly''stretch'
Maps to
alignItems, justifyItemsValues
'start''end''center''stretch'
Maps to
alignSelf, justifySelfValues
'auto''start''end''center''stretch'
Misc
Values
Values
'true'
Values
Conditions
Values
'@media (forced-colors: active)'
Values
'@media not ((hover: hover) and (pointer: fine))'
Values
'@media (min-width: ${pxToRem(640)})'
Values
'@media (min-width: ${pxToRem(768)})'
Values
'@media (min-width: ${pxToRem(1024)})'
Values
'@media (min-width: ${pxToRem(1280)})'
Values
'@media (min-width: ${pxToRem(1536)})'