Skip to main content

CSS Variables

Tip Top UI uses CSS variables (custom properties) to define colors, sizes, paddings and other properties. You can customize the CSS variables by defining them in your own stylesheets.

:root {
--tipTop-color-primary: "#209f47";
--tipTop-fontFamily-text: "Comic Sans";
}

Variable naming conventions​

--tipTop-<ComponentName>-<partName>--<componentVariant>-<state>__<propertyGroup>-<propertyName>--<propertyVariant>: <value>;
  • tipTop: Required prefix to avoid naming conflicts with third party CSS variables
  • ComponentName: Pascal cased name of the component. Assumed to be the root or top most element of the component.
  • partName: Part of the component. Examples:
    • child: The inner most element that contains the children prop
    • slot: The container around a slot
    • etc...
  • componentVariant: Variant of the component. Examples:
    • primary
    • secondary
    • success
    • etc...
  • state: State of the component. Examples:
    • hovered
    • focused
    • active
    • disabled
  • propertyGroup: Namespace to group related properties together. Examples:
    • bgColorMix: Group all properties needed for a background color mix function
    • textColorMix: Group all properties needed for a text color mix function
  • property: The required property of the CSS variable. Tends to match the a CSS property name. Examples:
    • color
    • fontSize
    • padding
    • margin
    • borderRadius
    • etc...
  • propertyVariant: Variant of the property. Examples:
    • sm
    • md
    • lg
    • etc...

Only the tipTop prefix and the property are required. All other parts are optional and should only be included if they make sense for the specific CSS variable.

Root CSS Variables​

note

Check the documentation for each component to see the component specific CSS variables that are available.

Colors​

VariableValue
--tipTop__color--primary#0577b4
--tipTop__color--secondaryrgb(143, 69, 188)
--tipTop__color--neutral#7e7e7e
--tipTop__color--danger#9f2020
--tipTop__color--warning#ffb700
--tipTop__color--success#08a900
--tipTop__color--light#fff
--tipTop__color--dark#000
--tipTop__color--text#3d3d3d
--tipTop__color--heading#20299f

Spacing​

VariableValuePX Equivalent
--tipTop__space--11px1px
--tipTop__space--000px
--tipTop__space--0-50.125rem2px
--tipTop__space--10.25rem4px
--tipTop__space--1-50.375rem6px
--tipTop__space--20.5rem8px
--tipTop__space--2-50.625rem10px
--tipTop__space--30.75rem12px
--tipTop__space--3-50.875rem14px
--tipTop__space--41rem16px
--tipTop__space--51.25rem20px
--tipTop__space--61.5rem24px
--tipTop__space--71.75rem28px
--tipTop__space--82rem32px
--tipTop__space--92.25rem36px
--tipTop__space--102.5rem40px
--tipTop__space--112.75rem44px
--tipTop__space--123rem48px
--tipTop__space--143.5rem56px
--tipTop__space--164rem64px
--tipTop__space--205rem80px
--tipTop__space--246rem96px
--tipTop__space--287rem112px
--tipTop__space--328rem128px
--tipTop__space--369rem144px
--tipTop__space--4010rem160px
--tipTop__space--4411rem176px
--tipTop__space--4812rem192px
--tipTop__space--5213rem208px
--tipTop__space--5614rem224px
--tipTop__space--6015rem240px
--tipTop__space--6416rem256px
--tipTop__space--7218rem288px
--tipTop__space--8020rem320px
--tipTop__space--9624rem384px

Border​

Radius​

VariableValue
--tipTop__borderRadius--sm0.125rem
--tipTop__borderRadius--normal0.25rem
--tipTop__borderRadius--md0.375rem
--tipTop__borderRadius--lg0.5rem
--tipTop__borderRadius--xl0.75rem
--tipTop__borderRadius--2xl1rem
--tipTop__borderRadius--3xl1.5rem
--tipTop__borderRadius--full9999px

Width​

VariableValue
--tipTop__borderWidth--normal1px
--tipTop__borderWidth--md2px
--tipTop__borderWidth--lg4px
--tipTop__borderWidth--xl8px

Typography​

Font Family​

VariableValue
--tipTop__fontFamily--headingui-serif, Charter, "Bitstream Charter", "Sitka Text", Cambria, serif
--tipTop__fontFamily--textsystem-ui, Arial, "Helvetica Neue", Helvetica, sans-serif
--tipTop__fontFamily--monoui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, "DejaVu Sans Mono", monospace

Font Size​

VariableValuePX Equivalent
--tipTop__fontSize--2xs0.625rem10px
--tipTop__fontSize--xs0.75rem12px
--tipTop__fontSize--sm0.875rem14px
--tipTop__fontSize--normal1rem16px
--tipTop__fontSize--md1.125rem18px
--tipTop__fontSize--lg1.25rem20px
--tipTop__fontSize--xl1.5rem24px
--tipTop__fontSize--2xl1.875rem30px
--tipTop__fontSize--3xl2.25rem36px
--tipTop__fontSize--4xl3rem48px
--tipTop__fontSize--5xl3.75rem60px
--tipTop__fontSize--6xl4.5rem72px
--tipTop__fontSize--7xl6rem96px
--tipTop__fontSize--8xl8rem128px

Line Height​

VariableValue
--tipTop__lineHeight--3xs.75rem
--tipTop__lineHeight--2xs1rem
--tipTop__lineHeight--xs1.25rem
--tipTop__lineHeight--sm1.375rem
--tipTop__lineHeight--normal1.5rem
--tipTop__lineHeight--md1.625rem
--tipTop__lineHeight--lg1.75rem
--tipTop__lineHeight--xl2.25rem
--tipTop__lineHeight--2xl2.5rem

Font Weight​

VariableValue
--tipTop__fontWeight--thin100
--tipTop__fontWeight--extraLight200
--tipTop__fontWeight--light300
--tipTop__fontWeight--normal400
--tipTop__fontWeight--medium500
--tipTop__fontWeight--semiBold600
--tipTop__fontWeight--bold700
--tipTop__fontWeight--extraBold800
--tipTop__fontWeight--black900

Letter Spacing​

VariableValue
--tipTop__letterSpacing--tighter-0.05em
--tipTop__letterSpacing--tight-0.025em
--tipTop__letterSpacing--normal0em
--tipTop__letterSpacing--wide0.025em
--tipTop__letterSpacing--wider0.05em
--tipTop__letterSpacing--widest0.1em