From dbb699d57cc0bfa2c7c5f626e307b9a713a481de Mon Sep 17 00:00:00 2001
From: Simon Lecoq <22963968+lowlighter@users.noreply.github.com>
Date: Sun, 2 Jun 2024 03:23:32 +0200
Subject: [PATCH] feat: add new utility classes
---
styles/@utilities/classes.html | 173 +++++++++++++
styles/@utilities/colors.html | 69 +++++-
styles/@utilities/flashes.html | 32 ++-
styles/@utilities/mod.css | 431 +++++++++++++++++++++++++++++++--
styles/@utilities/mod.html | 13 +-
5 files changed, 675 insertions(+), 43 deletions(-)
create mode 100644 styles/@utilities/classes.html
diff --git a/styles/@utilities/classes.html b/styles/@utilities/classes.html
new file mode 100644
index 0000000..542b8f1
--- /dev/null
+++ b/styles/@utilities/classes.html
@@ -0,0 +1,173 @@
+
+ While matcha.css is mostly intended to be used along with semantic styling, it still provides a subset of utility classes for added convenience.
+
+ matcha.css does not aim to become a fully-fledged CSS framework.
+
+ Consider using (or switching to) a utility-first CSS framework if you find the provided utility classes lacking or too limited.
+
- Use one of the following class to alter the element's
+ Classes
+
+
+
+
+
+ .bold
sets font-weight: bold;
.semibold
sets font-weight: 600;
.italic
sets font-style: italic;
.underline
sets text-decoration: underline;
.strikethrough
sets text-decoration: line-through;
.uppercase
sets text-transform: uppercase;
.lowercase
sets text-transform: lowercase;
.capitalize
sets text-transform: capitalize;
.centered
sets text-align: center;
.justified
sets text-align: justify;
.monospace
sets font-family: var(--mono);
+
+ .smaller
sets font-size: .85rem;
.small
sets font-size: .875rem;
.normal
sets font-size: 1rem;
.large
sets font-size: 1.25rem;
.larger
sets font-size: 1.5rem;
+
+ .relative
sets position: relative;
.fixed
sets position: fixed;
.absolute
sets position: absolute;
.sticky
sets position: sticky;
+
+ .hidden
sets display: none;
.inline
sets display: inline;
+
+
+ &.block
sets display: inline-block;
&.flex
sets display: inline-flex;
.block
sets display: block;
.flex
sets display: flex;
+
+
+ &.row
sets flex-direction: row;
&.column
sets flex-direction: column;
&.wrap
sets flex-wrap: wrap;
&.no-wrap
sets flex-wrap: no-wrap;
&.reverse
+
+
+ &.row
sets flex-direction: row-reverse;
&.column
sets flex-direction: column-reverse;
&.wrap
sets flex-wrap: wrap-reverse;
.contents
sets display: contents;
+
+ .flex
+
+
+ &.start
sets justify-content: flex-start;
&.end
sets justify-content: flex-end;
&.center
sets justify-content: center;
&.space-between
sets justify-content: space-between;
&.space-around
sets justify-content: space-around;
&.space-evenly
sets justify-content: space-evenly;
&.stretch
sets justify-content: stretch;
&.align-start
sets align-items: flex-start;
&.align-end
sets align-items: flex-end;
&.align-center
sets align-items: center;
&.align-stretch
sets align-items: stretch;
.grow
sets flex-grow: 1;
.shrink
sets flex-shrink: 1;
+
+ .overflow
sets overflow: auto;
.overflow-x
sets overflow-x: auto;
.overflow-y
sets overflow-y: auto;
.no-overflow
sets overflow: hidden;
+
+ .pointer
sets cursor: pointer;
.wait
sets cursor: wait;
.not-allowed
sets cursor: not-allowed;
+
+ .select-all
sets user-select: all;
.no-select
sets user-select: none;
+
+ .events
sets pointer-events: auto;
.no-events
sets pointer-events: none;
+
+ .width
sets width: 100%;
.height
sets height: 100%;
.border-box
sets box-sizing: border-box;
.content-box
sets box-sizing: content-box;
+
+ .resize
sets resize: both;
.resize-x
sets resize: horizontal;
.resize-y
sets resize: vertical;
.no-resize
sets resize: none;
+
+ .no-shadow
sets box-shadow: none;
.shadow
sets box-shadow: var(--shadow);
<svg>
fill and stroke
+
+
+ svg.fill-current
sets fill: currentColor;
svg.no-fill
sets fill: none;
svg.stroke-current
sets stroke: currentColor;
svg.no-stroke
sets stroke: none;
- Colors
+ Colors, border colors and backgrounds
color
.
+ Use one of the following classes to alter the element's color
, border-color
and background-color
.
-
.default
is in ◉ --default
color..muted
is in ◉ --muted
color..accent
is in ◉ --accent
color..active
is in ◉ --active
color..variant
is in ◉ --variant
color..success
is in ◉ --success
color..attention
is in ◉ --attention
color..severe
is in ◉ --severe
color..danger
is in ◉ --danger
color.
+
+ .default
is in ◉ --default
color..muted
is in ◉ --muted
color..accent
is in ◉ --accent
color..active
is in ◉ --active
color..variant
is in ◉ --variant
color..success
is in ◉ --success
color..attention
is in ◉ --attention
color..severe
is in ◉ --severe
color..danger
is in ◉ --danger
color.
+
+ .bd-default
has a ◉ --default
border..bd-muted
has a ◉ --muted
border..bd-accent
has a ◉ --accent
border..bd-active
has a ◉ --active
border..bd-variant
has a ◉ --variant
border..bd-success
has a ◉ --success
border..bd-attention
has a ◉ --attention
border..bd-severe
has a ◉ --severe
border..bd-danger
has a ◉ --danger
border.
+
+ .bg-default
has a ◉ --bg-default
background..bg-muted
has a ◉ --bg-muted
background..bg-accent
has a ◉ --bg-accent
background..bg-active
has a ◉ --bg-active
background..bg-variant
has a ◉ --bg-variant
background..bg-success
has a ◉ --bg-success
background..bg-attention
has a ◉ --bg-attention
background..bg-severe
has a ◉ --bg-severe
background..bg-danger
has a ◉ --bg-danger
background.
+
+ .fg-default
has a ◉ --default
background..fg-muted
has a ◉ --muted
background..fg-accent
has a ◉ --accent
background..fg-active
has a ◉ --active
background..fg-variant
has a ◉ --variant
background..fg-success
has a ◉ --success
background..fg-attention
has a ◉ --attention
background..fg-severe
has a ◉ --severe
background..fg-danger
has a ◉ --danger
background.
- Use .flash
class to style elements as a flash blocks.
- It can be combined with any color class.
+ Flash blocks can be used to draw attention.
+ They can be combined with any color class.
.flash
styles the element as a flash block..flash.foreground
styles the element as a flash block with a foreground.matcha.css provides utility classes for added convenience.
-- Utilizing utility classes entails patching your document to add classes to your elements. -
++ Utility classes requires that you patch your document to add classes which make it harder to eventually opt-out of matcha.css in the future. +
++ While not neccessarily a bad thing per se, it does diverge from the original intent of matcha.css which aims to be semantic-based. + Use these only if you plan to stay with matcha.css for the long run. +
+