Customizing CSS Variables

Orion UI uses a system of CSS variables defined on the selectors data-orion-theme='light' and data-orion-theme='dark'.
The dark theme only overrides the color variables.
These variables allow you to customize typography, colors, spacings and border radius for all components.
The related file is css-vars.less.

Override styles

It’s easy to override the default CSS variables to adapt the appearance to your desired theme.

The simplest way is to create a file that contains all the overrides you need (ie. orion-override.less) and import it into your style file after importing Orion styles.

main.less
@import "@orion.ui/orion/dist/styles/styles.less";
@import "@orion.ui/orion/dist/styles/packages/index.less";

@import "orion-override.less";

h1 {
  color: var(--grey-light);
}
...

Overriding CSS selectors

orion-override.less
.orion-input {
  &__input {
    border-color: var(--neutral-100);
  }

  // Dark theme modification
  [data-orion-theme="dark"] & {
    background-color: var(--info-100);
  }
}

.orion-sticker {
  align-items: center;
  padding: 1.5rem;
  border-radius: 0.75rem;
  font-size: 0.9rem;

  &__title {
    margin-bottom: 0.25rem;
    font-size: 1rem;
    color: var(--brand);
  }
}

overriding a specific element

Using a <style scoped> block and the :deep() selector, you can locally modify the style of an Orion component

MyComponent.vue
<style lang="less" scoped>

.my-component {
  display: flex;
  justify-content: flex-end;

// local style override only within MyComponent
  :deep(.orion-icon) {
    font-size: 1rem;
  }
}
</style>

Overriding variables

orion-override.less
:root {
  --radius-input: 0.5rem;
  --rgb-brand: 51, 67, 148;
}

Available Variables

Fonts and Text Sizes

VariableDescriptionDefault Value
--font-familyMain font'Source Sans Pro', sans-serif
--font-titleTitle font'Source Sans Pro', sans-serif
--font-paragraphParagraph font'Source Sans Pro', sans-serif
--size-defaultBase size0.875rem
--font-weight-defaultDefault font weight400
--font-weight-titleTitle font weight700
--font-weight-page-titlePage title font weight700
--font-weight-page-subtitlePage subtitle font weight300
--font-weight-section-titleSection title font weight600
--font-weight-section-subtitleSection subtitle font weight300

Border Radius

VariableComponentDefault Value
--radius-cardOrionCard0.5rem
--radius-stickerOrionSticker0.5rem
--radius-popoverOrionPopover0.5rem
--radius-btnOrionButton0.25rem
--radius-labelOrionLabel0.25rem
--radius-alertOrionAlert0.25rem
--radius-notifOrionNotification0.25rem
--radius-asideOrionAside1.25rem
--radius-modalOrionModal1.25rem
--radius-input-rangeOrionInputRange0.5rem
--radius-inputOrionInput0.25rem
--radius-uploadOrionUpload0.25rem

Colors

Base RGB Variables

These variables store colors as RGB triplets and serve as the source for all other CSS variables.
Each color has 3 additional variations (light, dark, alt).

ColorVariableLight Theme ValueDark Theme Value
Primary--rgb-brand112, 39, 250156, 105, 252
--rgb-brand-light242, 233, 255199, 169, 253
--rgb-brand-dark83, 5, 22821, 1, 57
--rgb-brand-alt163, 64, 205163, 64, 205
Gray--rgb-grey-darker56, 61, 71235, 235, 235
--rgb-grey-dark113, 122, 142173, 173, 175
--rgb-grey183, 188, 19871, 71, 77
--rgb-grey-light220, 223, 23042, 44, 47
--rgb-grey-lighter246, 247, 24926, 28, 32
Success--rgb-success0, 214, 11849, 253, 162
--rgb-success-light225, 255, 242137, 254, 201
--rgb-success-dark4, 170, 940, 42, 23
--rgb-success-alt185, 213, 4185, 213, 4
Info--rgb-info0, 120, 25576, 160, 255
--rgb-info-light229, 241, 255153, 201, 255
--rgb-info-dark1, 94, 2040, 24, 51
--rgb-info-alt0, 230, 2440, 230, 244
Warning--rgb-warning253, 151, 73254, 182, 128
--rgb-warning-light255, 233, 219254, 213, 182
--rgb-warning-dark252, 114, 1164, 28, 1
--rgb-warning-alt254, 203, 3254, 203, 3
Danger--rgb-danger247, 53, 104247, 94, 135
--rgb-danger-light253, 215, 225250, 135, 165
--rgb-danger-dark230, 10, 6958, 2, 17
--rgb-danger-alt240, 25, 72240, 25, 72
Pink--rgb-pink247, 149, 237250, 182, 243
--rgb-pink-light253, 234, 251252, 213, 248
--rgb-pink-dark242, 77, 22574, 6, 67
--rgb-pink-alt255, 0, 128255, 0, 128

Derived CSS Variables

These variables use the RGB values to create CSS colors that can be used directly in styles.

ColorCSS Variable
Primary--brand
--brand-light
--brand-dark
--brand-alt
Gray--grey-darker
--grey-dark
--grey
--grey-light
--grey-lighter
Inverse/Base--inverse
--base
Info--info
--info-light
--info-dark
--info-alt
Success--success
--success-light
--success-dark
--success-alt
Warning--warning
--warning-light
--warning-dark
--warning-alt
Danger--danger
--danger-light
--danger-dark
--danger-alt
Pink--pink
--pink-light
--pink-dark
--pink-alt

Best Practices

  1. Always use derived CSS variables (--grey, --brand, etc.) in your styles rather than raw RGB values to ensure theme consistency.
  2. Override colors for dark themes only by modifying the corresponding RGB variables.
  3. Avoid directly modifying derived variables to prevent breaking theme consistency.
  4. Use the -light, -dark, -alt suffixes to manage color shades and variants.

Usage Example

.button {
  background-color: var(--brand);
  color: var(--base);
}

.alert-success {
  background-color: var(--success-light);
  border-color: var(--success);
  color: rgb(var(--rgb-inverse), 0.2); // Example: using opacity
}

Fluid

The --fluid-* variables are used to define padding and maintain consistency throughout the application.

VariableDefault Value
--fluid-5pxcalc(3px + 0.125rem)
--fluid-8pxcalc(5px + 0.1875rem)
--fluid-10pxcalc(5px + 0.3125rem)
--fluid-12pxcalc(8px + 0.25rem)
--fluid-15pxcalc(10px + 0.3rem)
--fluid-18pxcalc(10px + 0.5rem)
--fluid-20pxcalc(12px + 0.5rem)
--fluid-25pxcalc(13px + 0.75rem)
--fluid-30pxcalc(14px + 1rem)
--fluid-35pxcalc(19px + 1rem)
--fluid-40pxcalc(24px + 1rem)
--fluid-45pxcalc(25px + 1.25rem)
--fluid-60pxcalc(36px + 1.5rem)

Spacing

The --space-* variables define standard margins and spacing in the design grid.
They are fixed (in rem) and ensure vertical and horizontal consistency.

VariableDefault ValueRecommended Use
--space-xs0.5remVery small spacing (elements very close)
--space-sm1remSmall spacing
--space-md2remMedium spacing
--space-lg3remLarge spacing
--space-xl4remVery large spacing

Note

These values are ideal for setting gaps between components, sections, or columns.