Simple Scss Utilities
Overview of the Classes with Colors
And how they react to element states
Just about any class with color reacts to element state and comes with pseudo classes. The default colors are Red, Green, Blue, Default (which I use for text), Background (not shown because it would blend into the background), and Magenta, each generated with 4 other shades in addition to the base color.
By default, the colors for Background and Default are overridden for dark-mode. Use the in the navbar to see switching modes. Any color can be overridden by adding/removing/changing name/changing value in the colors map in variables.scss
. See the Customize section for more details.
Text Color
The text color classes have the form .text-[color]
or .text-[color]-[shade]
, where the shades are dk
(dark), dkr
(darker), lt
(light), and ltr
(lighter)
Class Example | CSS rule | Example |
---|---|---|
.text-red | color: #cb3810; | Text |
.text-default | color: #252832; | Text |
.text-green | color: #589f50; | Text |
.text-blue-dkr | color: #1d5470; | Text |
.text-blue-lt | color: #498cae; | Text |
.text-magenta-dk | color: #a2366e; | Text |
.text-magenta-ltr | color: #d279a7; | Text |
Using the Pseudo Class with Text Color Examples:
Example | Html | Result |
---|---|---|
Color with Hover |
| Hover Me |
Color with Active |
| Press Me |
Color with Focus |
|
Background Color
The background color classes have the form .bg-[color]
or .bg-[color]-[shade]
, where the shades are dk
(dark), dkr
(darker), lt
(light), and ltr
(lighter)
Class Example | CSS rule | Example |
---|---|---|
.bg-red | background-color: #cb3810; | |
.bg-default | background-color: #252832; | |
.bg-green | background-color: #589f50; | |
.bg-blue-dkr | background-color: #1d5470; | |
.bg-blue-lt | background-color: #498cae; | |
.bg-magenta-dk | background-color: #a2366e; | |
.bg-magenta-ltr | background-color: #d279a7; |
Using the Pseudo Class with Background Color:
Example | Html | Result |
---|---|---|
Background Color with Hover |
| Hover Me |
Background Color with Active |
| Press Me |
Background Color with Focus |
|
Border Color
The border color classes have the form .border-[color]
or .border-[color]-[shade]
, where the shades are dk
(dark), dkr
(darker), lt
(light), and ltr
(lighter).
Also note that borders also havo to have a width to show up with a class like border-sm
or border-lg
, for example.
Class Example | CSS rule | Example |
---|---|---|
.border-red | border-color: #cb3810; | |
.border-default | border-color: #252832; | |
.border-green | border-color: #589f50; | |
.border-blue-dkr | border-color: #1d5470; | |
.border-blue-lt | border-color: #498cae; | |
.border-magenta-dk | border-color: #a2366e; | |
.border-magenta-ltr | border-color: #d279a7; |
Using the Pseudo Classes with Border Color:
Example | Html | Result |
---|---|---|
Border Color with Hover |
| Hover Me |
Border Color with Active |
| Press Me |
Border Color with Focus |
|
Outline Color
The outline color classes have the form .outline-[color]
or .outline-[color]-[shade]
, where the shades are dk
(dark), dkr
(darker), lt
(light), and ltr
(lighter).
Also note that outline also havo to have a width AND a style to show up with a classes like outline-sm
or outline-lg
for the width, and outline-solid
for the style, for example.
Class Example | CSS rule | Example |
---|---|---|
.outline-red | outline-color: #cb3810; | |
.outline-default | outline-color: #252832; | |
.outline-green | outline-color: #589f50; | |
.outline-blue-dkr | outline-color: #1d5470; | |
.outline-blue-lt | outline-color: #498cae; | |
.outline-magenta-dk | outline-color: #a2366e; | |
.outline-magenta-ltr | outline-color: #d279a7; |
Using the Pseudo Classes with Outline Color:
Example | Html | Result |
---|---|---|
Outline Color with Hover |
| Hover Me |
Outline Color with Active |
| Press Me |
Outline Color with Focus |
|
Text Decoration Color
(ToDo: Fix Text Decloration conflicts with style and property)
The text-decoration color classes have the form .decoration-[color]
or .decoration-[color]-[shade]
, where the shades are dk
(dark), dkr
(darker), lt
(light), and ltr
(lighter).
Sometimes if you switch a decoration style with a pseudo class from underline to overline for example, it won't inherit the color on all browsers. But that is a really rare use case that can be solved with some custom scss however.
Class Example | CSS rule | Example |
---|---|---|
.decoration-red | text-decoration-color: #cb3810; | Text |
.decoration-default | text-decoration-color: #252832; | Text |
.decoration-green | text-decoration-color: #589f50; | Text |
.decoration-blue-dkr | text-decoration-color: #1d5470; | Text |
.decoration-blue-lt | text-decoration-color: #498cae; | Text |
.decoration-magenta-dk | text-decoration-color: #a2366e; | Text |
.decoration-magenta-ltr | text-decoration-color: #d279a7; | Text |
Using the Pseudo Classes with Decoration Color:
Example | Html | Result |
---|---|---|
Outline Color with Hover |
| Hover Me! |
Outline Color with Active |
| Press Me! |
Outline Color with Focus |
|
Selection Color
The selections color classes have the form .decoration-[color]
or .decoration-[color]-[shade]
, where the shades are dk
(dark), dkr
(darker), lt
(light), and ltr
(lighter).
Sometimes if you switch a decoration style with a pseudo class from underline to overline for example, it won't inherit the color on all browsers. But that is a really rare use case that can be solved with some custom scss however.
Selection Text Color
Class Example | CSS rule | Example |
---|---|---|
.selection-color-red | color: #cb3810; | Select Me |
.selection-color-default | color: #252832; | Select Me |
.selection-color-green | color: #589f50; | Select Me |
.selection-color-blue-dkr | color: #1d5470; | Select Me |
.selection-color-blue-lt | color: #498cae; | Select Me |
.selection-color-magenta-dk | color: #a2366e; | Select Me |
.selection-color-magenta-ltr | color: #d279a7; | Select Me |
Selection Text Background
In addition to the color, the background can be changed
Class Example | CSS rule | Example |
---|---|---|
.selection-bg-red | background-color: #cb3810; | Select Me |
.selection-bg-default | background-color: #252832; | Select Me |
.selection-bg-green | background-color: #589f50; | Select Me |
.selection-bg-blue-dkr | background-color: #1d5470; | Select Me |
.selection-bg-blue-lt | background-color: #498cae; | Select Me |
.selection-bg-magenta-dk | background-color: #a2366e; | Select Me |
.selection-bg-magenta-ltr | background-color: #d279a7; | Select Me |
For best results, combine the two! Try selecting the large text below
Select Me!
Here is the Html:
Html
<pclass="text-2xl py-xl font-header align-center selection-bg-magenta selection-color-white"value="Focus Me"/>
Using the Pseudo Classes with Selection Color:
Example | Html | Result |
---|---|---|
Selection with Hover |
| Select some text and Hover |
Selection with Active |
| Select some text and Press! |
Focus works too I guess haha |
|
A natural next topic would be transitions! (todo: transitions section)