Helper classes for scratch framework. They use Scratch as a base. It's purpose of using is to write them inline in HTML for just easy markup.
We can use them instead of {color-name} placeholder below, and we'll be able to use it inline in HTML to give color and background color to any element.
.primary.secondary.tertiary.quaternary.quinary
.color-success.color-warning.color-info.color-error
.color-facebook.color-twitter.color-google.color-youtube.color-vimeo.color-rss.color-pinterest
Use .color- prefix for those, to not to be confused with naming conflicts.
Let's use {color-name} as a placeholder for this table.
| Name | Color | Background |
|---|---|---|
.{color-name} |
--{color-name}-inverse |
--{color-name} |
.{color-name}-contrast |
--{color-name} |
--{color-name}-contrast |
.{color-name}-color |
--{color-name} |
|
.{color-name}-color-contrast |
--{color-name}-contrast |
|
.{color-name}-background |
--{color-name} |
|
.{color-name}-background-contrast |
--{color-name}-contrast |
For example, {color-name} is primary, --primary itself is green and contrast color for it - --primary-contrast is white. As we see in the table, We can use .primary class to apply white color on the green background. .primary-contrast to opposite, like green on white. .primary-background for applying only green background and etc.
Don't get confused about color helpers starting with .color- prefix. As for only color usage, it can repeat color word like .color-facebook-color-inverse. It's the same structure, just starts with that prefix.
--
.font-family-primary.font-family-secondary.font-family-tertiary.font-family-quaternary
Also, families can be divided by type, as they may have serif, sans-serif or monospace options.
-
Sans Serif
.font-family-sans-serif-primary.font-family-sans-serif-secondary
-
Serif
.font-family-serif-primary.font-family-serif-secondary
-
Monospace (using of this is very rare, so I don't think we need priorities)
.font-family-monospace
.font-size-h1.font-size-h2.font-size-h3.font-size-h4.font-size-h5.font-size-h6.font-size-h7.font-size-h8.font-size-h9.font-size-h10
.font-thin.font-extralight.font-light.font-regular.font-medium.font-semibold.font-bold.font-extrabold.font-black
.text-transform-reset.text-uppercase.text-lowercase.text-capitalize
.text- prefix applies here, since it just matches CSS naming.
--
-
Align
.align-left.align-center.align-right
-
Flexbox
.flex-center- vertical and horizontal centering (affects on a child element)..flex-center-x- horizontal centering..flex-center-y- vertical centering..flex-stretch- stretches child elements.- Directions
.flex-row.flex-row-reverse.flex-column.flex-column-reverse
-
Position
.position-absolute.position-relative.position-static
-
Display
.display-flex.display-inline-flex.display-none.display-block.display-inline.display-inline-block.display-table.display-table-row.display-table-cell
-
Sizing
.full-size- full width and height dependent on parent container (100%withvhandvwfallbacks)..full-width.full-height.full-viewport-size- full width and height dependent on document size (usingvhandvwwith percent fallbacks)..full-viewport-width.full-viewport-height
-
Transition
.transition- default duration, which is defined in Scratch config..shorter.short.long.longer
.transition.delay- default delay, which is defined in Scratch config..delay-shorter.delay-short.delay-long.delay-longer
For more complex UI components you can check UIkit library. For animations, check Animations library.
--
<main class="flex-center | full-viewport-size | position-absolute">
<article class="primary-background-inverse">
<h1 class="text-uppercase">Title</h1>
<p class="margin-bottom-gutter-large">Lorem ipsum dolor sit amet</p>
<a class="primary-color | text-underline">Learn More</a>
</article>
</main>