Colors
Control sitewide colors with the color palette
The OrbitCSS color palette generates a handful of global and module-specific modifiers that enable you to control the background and text color of various elements.
#6e45e2
#ff5e82
#ffdd57
#bfd9fe
#ff2b56
#6e45e2
#393939
#304352
#4e4376
#eef1f5
#ffffff
#d7d2cc
#616161
#495aff
#f7f7f7
Background colors
The has-bg-*
modifier can be used to set the background color of an element.
Modifier | Example |
---|---|
has-bg-primary | |
has-bg-secondary | |
has-bg-warning | |
has-bg-info | |
has-bg-danger | |
has-bg-success | |
has-bg-black | |
has-bg-dark | |
has-bg-night | |
has-bg-light | |
has-bg-white | |
has-bg-light-grey | |
has-bg-dark-grey | |
has-bg-disabled |
Text colors
The has-text-*
modifier can be used to set the text color of an element. As most elements in the framework inherit their color this will apply right down the HTML hierarchy.
Modifier | Example |
---|---|
has-text-primary | Primary |
has-text-secondary | Secondary |
has-text-warning | Warning |
has-text-info | Info |
has-text-danger | Danger |
has-text-success | Success |
has-text-black | Black |
has-text-dark | Dark |
has-text-night | Night |
has-text-light | Light |
has-text-white | White |
has-text-light-grey | Light grey |
has-text-dark-grey | Dark grey |
has-text-disabled | Disabled |
has-text-muted | Muted |
Custom palette
The $custom-palette
variable can extend the existing palette without having to redeclare all of the palettes default values.
$custom-palette : ( "orange": #e28945 );
Colors in the custom palette will then be available in all color modifiers, including module specific modifiers.
has-bg-orange
modifier.is-orange
modifier.<div class="panel has-bg-orange"> A panel using the <code>has-bg-orange</code> modifier. </div> <div class="alert is-orange"> <div> An alert using the <code>is-orange</code> modifier. </div> </div> <button class="button is-orange">An orange button</button>
</> Show code
CSS variables
CSS variables provide four alternatives to each color in the palette, which are used throughout the framework. For example, the --color-*-darker
variable is used for the hover state on buttons. When overriding colors with CSS variables, you will also need to account for these variations.
:root { /* Base color */ --color-primary: hsl(255deg, 73%, 58%, 1); /* Darker version used for the button hover state. 10% darker. */ --color-primary-darker: hsl(255deg, 73%, 48%, 1); /* Not currently used but included for convenience. 10% lighter. */ --color-primary-lighter: hsl(255deg, 73%, 68%, 1); /* Represents the color for text when used over the base color (buttons, tags, etc.). */ --color-primary-text: var(--color-white); /* Transparentized version used for alert backgrounds. */ --color-primary-alert: hsl(255deg, 73%, 58%, 0.2); }
Other CSS variables.
:root { /* Used for the background overlay on elements like the modal. */ --color-black-overlay: hsl(0deg, 0%, 22%, 0.5); /* Other colors. */ --color-link: hsl(234deg, 100%, 64%, 1); --color-muted: hsl(0deg, 0%, 73%, 1); --color-disabled: hsl(0deg, 0%, 97%, 1); }
Sass variables
The default styles can be overridden with the following variables. Set one or more of these variables before you import the framework.
Variable | Type | Default value |
---|---|---|
$primary | color | #6e45e2 |
$secondary | color | #ff5e82 |
$warning | color | #ffdd57 |
$info | color | #bfd9fe |
$danger | color | #ff2b56 |
$success | color | #00e3ae |
$black | color | #393939 |
$dark | color | #304352 |
$night | color | #4e4376 |
$white | color | #ffffff |
$light | color | #eef1f5 |
$light-grey | color | #d7d2cc |
$dark-grey | color | #616161 |
$link | color | #495aff |
$disabled | color | #f7f7f7 |
$muted | color | lighten($dark-grey, 35%) |
$custom-palette | map | (empty) |
$color-palette | map | ( "primary": $primary, "secondary": $secondary "warning": $warning, "info": $info, "danger": $danger, "success": $success, "black": $black, "dark": $dark, "night": $night, "white": $white, "light": $light, "light-grey": $light-grey, "dark-grey": $dark-grey, ) |