Simple Scss Utilities
Overview of the Additional pseudo-classes
Other Classes that respond to Pseudo States
The additional Classes that respond to pseudo states are
- Font Size
- Font Family
- Font Weight
- Text Decoration
- Border and Outline Classes
Not all of these can be transitioned, although maybe some can be faked - for example you can fake smooth font weight transtitions by getting creative with text shadow - (but that's kind of weird for a framework I think, but maybe a good opportunity to write some custom SCSS if you want it). But some of these can, I'll try to include transitions for the transitionable properties in the examples.
Of course everything on this page can be customized for your own theme in the _variables.scss
and see the (Customize)[/customize/] section of the docs for more details!
Let's start with Font Size!
Font Size
Font size is supported by pseudo classes, although it's a bit of a special use case. I thought it was useful enough to include, although be careful going too wild because they might conflict with any responsive font size styles. Going wild with font size and pseudo classes would likely be best handeled by writing some custom SCSS for most cases I can imagine, although utility classes probably still come in handy if you just need some styles that aren't gonna be too eclectic:
Class Example | CSS rule | Example |
---|---|---|
.text-xs | font-size: 0.375rem; | Font Size XS |
.text-sm | font-size: 0.625rem; | Font Size SM |
.text-md | font-size: 0.875rem; | Font Size Med |
.text-base | font-size: 1rem; | Font Size Base |
.text-lg | font-size: 1.25rem; | Font Size Large |
.text-xl | font-size: 1.5rem; | Size XL |
.text-2xl | font-size: 1.75rem; | Size 2XL |
.text-3xl | font-size: 3rem; | 3XL |
.text-4xl | font-size: 4rem; | 4xL |
.text-5xl | font-size: 5rem; | 5XL |
Pseudo Class Examples:
Example | Html | Result |
---|---|---|
Font Size with Hover |
| Hover Me |
Font Size with Active |
| Press Me |
Text Size with Focus |
|
Font Family
Font family can also respond to Pseudo States. The framework comes with 3 default font families, probably one of the first things one would want to do when starting a project is change the fonts to their theme, which can be done in the _variables.scss
file (see Customize section). I purposefully choose a basic font that one would probably want to edit to drive this point home haha (although I it works good for this site!)
Class Example | CSS rule | Example |
---|---|---|
.font-default | font-family: "Lato", sans-serif; | Font Default |
.font-large | font-family: "Francois One", sans-serif; | Font Large |
.font-header | font-family: "Bebas Neue", sans-serif; | Font Header |
Examples:
Example | Html | Result |
---|---|---|
Font Family with Hover |
| Hover Me |
Font Family with Active |
| Press Me |
Font Family with Focus |
|
Font Weight
Font weight can't be transitioned, although it can be faked with a text shadow. However, this framework provides these three classes by default. Not all fonts support weights, some support more than 3 weights, but again that all can be editied in the _variables.scss
file.
Class Example | CSS rule | Example |
---|---|---|
.font-light | font-weight: 200; | Font Light |
.font-normal | font-weight: 400; | Font Normal |
.font-bold | font-weight: 700; | Font Bold |
And here are some Examples:
Example | Html | Result |
---|---|---|
Font Weight with Hover |
| Hover Me |
Font Weight with Active |
| Press Me |
Font Weight with Focus |
|
Text Decoration and Style
Here are the classes for text decoration and text decoration style. Text decoration can also have a width and color, but notice that for each element state the thickness needs to be specified or it'll revert to the default thickness for that particular state. Also, not every style will work with every type of decoration. Hey, that's CSS, what can I say! But these are all kind of rarely used edge cases, just demonstrated here.
First, the Classes.
Text Decoration:
Class Example | CSS rule | Example |
---|---|---|
.text-none | text-decoration: none; | Font Light |
.text-underline | text-decoration: underline; | Font Normal |
.text-overline | text-decoration: overline; | Font Bold |
.text-underover | text-decoration: underline overline; | Font Bold |
.text-line-through | text-decoration: line-through; | Font Bold |
Text Decoration Style:
Class Example | CSS rule | Example |
---|---|---|
.decoration-solid | text-decoration-style: solid; | Font Light |
.decoration-double | text-decoration-style: double; | Font Normal |
.decoration-dotted | text-decoration-style: dotted; | Font Bold |
.decoration-dashed | text-decoration-style: dashed; | Font Bold |
.decoration-wavy | text-decoration-style: wavy; | Font Bold |
Decoration Examples:
Example | Html | Result |
---|---|---|
Decoration with Hover |
| Hover Me |
Decoration with Active |
| Press Me |
Decoration Style Examples:
Example | Html | Result |
---|---|---|
Decoration Style with Hover |
| Hover Me |
Decoration Style with Focus |
|
Border Width and Style
Border width classes cover every direction, while border style does not. While it is possible to want borders with different styles in different directions, and because responsive styles can conflect with element states, these are specific cases I felt are probably best handled with custom SCSS. Otherwise, I feel like these classes will cover the vast majority of use cases.
For more info on responsivity and customization, see the Responsive and Customize sections. The default values are as follows:
Border Width:
Class Example | CSS rule | Example |
---|---|---|
.border-0 | border-width: 0; | No Border |
.border-sm | border-width: 1px; | Border Small |
.border-md | border-width: 3px; | Border Mdd |
.border-lg | border-width: 5px; | Border Large |
.border-xl | border-width: 7px; | Border Xl |
.bx-0 | border-left-width: 0; : ;border-left-width: 0; : ; | No X Border |
.bx-sm | border-left-width: 1px; : ;border-left-width: 1px; : ; | Border x Small |
.bx-md | border-left-width: 3px; : ;border-left-width: 3px; : ; | Border x Med |
.bx-lg | border-left-width: 5px; : ;border-left-width: 5px; : ; | Border x Large |
.bx-xl | border-left-width: 7px; : ;border-left-width: 7px; : ; | Border x Xl |
.by-0 | border-top-width: 0; : ;border-top-width: 0; : ; | No Y Border |
.by-sm | border-top-width: 1px; : ;border-top-width: 1px; : ; | Border y Small |
.by-md | border-top-width: 3px; : ;border-top-width: 3px; : ; | Border y Med |
.by-lg | border-top-width: 5px; : ;border-top-width: 5px; : ; | Border y Large |
.by-xl | border-top-width: 7px; : ;border-top-width: 7px; : ; | Border y Xl |
.bt-0 | border-top-width: 0px; | No top Border |
.bt-sm | border-top-width: 1px; | Border Top Sm |
.bt-md | border-top-width: 3px; | Border Top Med |
.bt-lg | border-top-width: 5px; | Border Top Large |
.bt-xl | border-top-width: 7px; | Border Top XL |
.bb-0 | border-bottom-width: 0px; | No bottom Border |
.bb-sm | border-bottom-width: 1px; | Border Bottom Sm |
.bb-md | border-bottom-width: 3px; | Border Bottom Med |
.bb-lg | border-bottom-width: 5px; | Border Bottom Large |
.bb-xl | border-bottom-width: 7px; | Border Bottom XL |
.bl-0 | border-left-width: 0px; | No left Border |
.bl-sm | border-left-width: 1px; | Border Left Sm |
.bl-md | border-left-width: 3px; | Border Left Med |
.bl-lg | border-left-width: 5px; | Border Left Large |
.bl-xl | border-left-width: 7px; | Border Left XL |
.br-0 | border-right-width: 0px; | No Right Border |
.br-sm | border-right-width: 1px; | Border Right Sm |
.br-md | border-right-width: 3px; | Border Right Med |
.br-lg | border-right-width: 5px; | Border Right Large |
.br-xl | border-right-width: 7px; | Border Right XL |
Border Style:
Class Example | CSS rule | Example |
---|---|---|
.border-solid | border-style: solid; | Border Solid |
.border-dashed | border-style: dashed; | Border Dashed |
.border-dotted | border-style: dotted; | Border Dotted |
.border-groove | border-style: groove; | Border Groove |
.border-inset | border-style: inset; | Border Inset |
Border Width Pseudo Class Examples:
Example | Html | Result |
---|---|---|
Border width with hover |
| Hover Me |
Border width with Active |
| Press Me |
Border Style Pseudo Class Examples:
Example | Html | Result |
---|---|---|
Decoration Style with Hover |
| Hover Me |
Decoration Style with Focus |
|
Outline Width and Style
Like border, outlines have widths and styles. Unlike border, outline classes can't be applied per direction, making them a bit less time consuming to generate and document haha. Also notice that in the examples, the style has to be included or it won't show up. I did include pseudo classes with outline, so they can respond to hover, focus, etc.
Outline WIdth
Class Example | CSS rule | Example |
---|---|---|
.outline-0 | outline-width: 0; | |
.outline-sm | outline-width: 1px; | |
.outline-md | outline-width: 3px; | |
.outline-lg | outline-width: 5px; | |
.outline-xl | outline-width: 7px; |
Outline Style
(I addded the blue-ltr
color and made the width outline-xl
to make it a bit easier to see)
Class Example | CSS rule | Example |
---|---|---|
.outline-none | outline-style: none; | |
.outline-dotted | outline-style: dotted; | |
.outline-solid | outline-style: solid; | |
.outline-groove | outline-style: groove; | |
.outline-inset | outline-style: inset; |
Outline Width Pseudo Class Examples:
Example | Html | Result |
---|---|---|
Outline width with hover |
| Hover Me |
Border width with Active |
| Press Me |
Outline Style Pseudo Class Examples:
Example | Html | Result |
---|---|---|
Decoration Style with Hover |
| Hover Me |
Decoration Style with Focus |
|