Skip to content

Commit

Permalink
Update spacing and sizing classes, and fix CSS shorthand syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
1aron committed Dec 22, 2023
1 parent 3071baf commit d0a44af
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ The spacing and sizing system is constructed using a [base unit](/docs/configura
```html
<div class="m:**1x**">4px, margin: 0.25rem</div>
<div class="p:**2x**">8px, padding: 0.5rem</div>
<div class="gap:**3x**">12px, gap: 0.75rem</div>
<div class="w:**8x**">32px, width: 2rem</div>
<div class="gap:**3x**">12px, gap: 0.75rem</div>
<div class="size:**6x**">24px, width: 1.5rem; height: 1.5rem</div>
```
<Reference />
Expand All @@ -13,7 +13,6 @@ For other common sizes, `0`, `1`, `2`, ..., we tend to use unitless tokens:
<div class="m:**0**">0px, margin: 0rem</div>
<div class="p:**1**">1px, padding: 0.0625rem</div>
<div class="w:**2**">2px, width: 0.125rem</div>
...
```
(x) It's no longer necessary to define the spacing scale one by one as in the traditional way.
```js name=master.css.js
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const code1 = `<p class="**padding-top:1rem** **padding-bottom:1rem** **padding-left:2rem** **padding-right:2rem** **border-width:.0625rem** **border-color:red** **border-style:solid**">`
export const code2 = `<p class="**padding:16|32** **border:1|solid|red**">`
export const code3 = `<p class="**p:16|32** **b:1|solid|red**">`
export const code3 = `<p class="**p:16|32** **b:1|red**">`

Syntax: <code><span className="token value mcss language-mcss"><span className="token Mroot"><span className="token Mkey">property</span><span className="token Mvalueroot"><span className="token Mcolon">:</span><span className="token Mvalue"><span className="token Mnumber_unit"><span className="token Mnumber">value</span></span><span className="token Mspace">|</span><span className="token Mnumber_unit"><span className="token Mnumber">value</span></span><span className="token Mspace">|</span><span className="token Mnumber_unit"><span className="token Mnumber">value</span></span><span className="token Mspace">…</span></span></span></span></span></code>

Expand All @@ -19,7 +19,7 @@ Inherit native CSS shorthands to reduce the frequency of duplication of style na
{code3}
</Code>

You can't use CSS whitespace in class attributes because it's used to separate different class names, use instead:
You can't use CSS whitespace in class attributes because it's used to separate different class names; use instead:

(o) Use `|` delimiters instead of whitespaces between CSS parameter values.
```html
Expand Down

0 comments on commit d0a44af

Please sign in to comment.