Simple Web Design
Components Colors Functions
Home Components Colors Functions

Predefined Colors

.primary-color
.secondary-color
.accent-color
.blue-color
.aqua-color
.green-color
.yellow-color
.orange-color
.red-color
.magenta-color
.purple-color
.grey-color
.light-color
.dark-color
.white-color
.black-color
.primary-text .secondary-text .accent-text
.blue-text .aqua-text .green-text .yellow-text .orange-text .red-text .purple-text .magenta-text
.grey-text .light-text .dark-text .white-text .black-text

The colors white and black are not color scheme dependent, while light and dark flip when darkmode is enabled! Text colors are slightly different in darkmode for better contrast.

Green Text
<button class="green-color">Green</button>
<span class="green-text">Green Text</span>

Define Your Own Color

You can simply redefine the theme color variables. The secondary color is used as hover color by the most components. You can create your own class like .rose for some elements or overrite the :root pseudoclass to set the color for the whole theme.

<button class="rose-color">Rose Button</button>
<button class="outline rose-color">Rose Button</button>
.rose-color {
    --theme-primary-color: hsl(320, 100%, 45%);
    --theme-secondary-color: hsl(320, 100%, 35%);
    --theme-element-primary-color: var(--theme-primary-color);
    --theme-element-secondary-color: var(--theme-secondary-color);
    --theme-text-color: #ffffff;
    color: var(--theme-text-color);
}

Color Scheme

The css applies the systems color scheme by default. If you want to force a scheme for an element, you can add the lightmode or darkmode class to your element. You can put this class in your <body> tag if you want to force the scheme to the whole webseite.

Lightmode Example This card is displayed for lightmode

Color Scheme Lightmode
<div class="lightmode">...</div>

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.

Darkmode Example This card is displayed for darkmode

Color Scheme Darkmode
<div class="darkmode">...</div>

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.

Greyscale

Elements with grey background in front of element with grey background can adjust their grey value based on the primary and secondary grey value.

Black Background A card to compare the colors

Background Black
Inner Card

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.

Grey Background A card to compare the colors

Background Grey
Inner Card

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.

You can implement this behavior for your own elements by overwriting the grey variable for child elements while using the primary grey variable as background.

.grey-element {
    background-color: var(--theme-primary-grey-color);
}

.grey-element * {
    --theme-primary-grey-color: var(--theme-secondary-grey-color);
}

Theme Colors

You can define your own main color for the theme by overriding the theme variables in the :root class. The theme color applies to menu, buttons, inputs and other elements.

:root {
    --theme-primary-color: hsl(320, 100%, 45%);
    --theme-secondary-color: hsl(320, 100%, 35%);
}

Default colors

VariablesDefault
--theme-primary-color
hsl(225, 100%, 50%)
--theme-secondary-color
hsl(225, 100%, 30%)
--theme-accent-color
hsl(45, 100%, 50%)
--theme-info-color
hsl(225, 100%, 50%)
--theme-success-color
hsl(112.5, 100%, 35%)
--theme-warning-color
hsl(45, 100%, 50%)
--theme-error-color
hsl(0, 100%, 50%)
Color Scheme Dependent VariablesLightmodeDarkmode
--theme-background-color
white
black
--theme-element-primary-color
--theme-primary-grey-color
--theme-primary-grey-color
--theme-element-secondary-color
--theme-secondary-grey-color
--theme-secondary-grey-color
--theme-primary-grey-color
hsl(0, 0%, 88%)
hsl(0, 0%, 12%)
--theme-secondary-grey-color
hsl(0, 0%, 80%)
hsl(0, 0%, 20%)
--theme-tertiary-grey-color
hsl(0, 0%, 72%)
hsl(0, 0%, 28%)
Color Scheme Dependent Text VariablesLightmodeDarkmode
--theme-text-color
black
white
--theme-text-grey-color
hsl(0, 0%, 40%)
hsl(0, 0%, 60%)
© 2024 Der Zauberer
Imprint Privacy policy