Skip to content

Commit 623413d

Browse files
committed
Spacing: Add margin variables throughout
Attempt to match figma spacing with headings Add variables for ol and ul colours
1 parent 8ebcbb4 commit 623413d

File tree

2 files changed

+78
-36
lines changed

2 files changed

+78
-36
lines changed

assets/css/v2/style.css

Lines changed: 76 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -154,22 +154,65 @@ textarea:not([rows]) {
154154
--color-background: 1 0 0;
155155
--color-foreground: 0 0 0;
156156
--color-shadow: 0.86 0 0;
157+
158+
--color-footer-text: 0 0 0 / 65%;
159+
--color-product-title: 0.64 0 0;
160+
--color-tabs-inactive-border: 0 0 0 / 20%;
161+
162+
/* Typography */
163+
--margin-content-h1: 2.5rem 0 0 0;
164+
--margin-content-h2: 2.5rem 0 0 0;
165+
--margin-content-h3: 1.5rem 0 0 0;
166+
--margin-content-h4: 1rem 0 0 0;
167+
168+
/* Lists */
169+
--margin-list: 0.5rem 0 0.5rem 1.15rem;
170+
--margin-list-item: 0.5rem 0 0.5rem 0;
171+
--color-list-bullet: var(--color-codeblock-border);
172+
--color-list-char: var(--color-codeblock-border);
173+
174+
/* Codeblock */
175+
176+
--margin-codeblock: 1.5rem -1rem;
157177
--color-inline_codeblock-border: 0.85 0 0;
158178
--color-inline_codeblock-background: 0.98 0 0;
159179
--color-codeblock-border: 0.63 0 0;
160180
--color-codeblock-background: 1 0 0;
161181
--color-codeblock-highlight: 0.99 0.0479 105.97;
162-
--color-footer-text: 0 0 0 / 65%;
163-
--color-product-title: 0.64 0 0;
164-
--color-tabs-inactive-border: 0 0 0 / 20%;
182+
--codeblock-comment-diff: 2rem;
183+
--codeblock-comment-space-between: 10px;
184+
--codeblock-horizontal-line-length: 2rem;
185+
--codeblock-horizontal-line-overflow: 0.25rem;
186+
--codeblock-horizontal-padding: 1rem;
187+
--codeblock-border-thickness: 1px;
188+
--codeblock-code-section-padding-left: 1rem;
189+
--codeblock-line-box-side-length: 4px;
190+
191+
/* Callout */
192+
--margin-callout: 1rem -1rem;
165193
--color-callout-warning: 0.65 0.188 24;
166194
--color-callout-warning-shadow: 0.65 0.188 24 / 20%;
167195
--color-callout-caution: 0.8 0.1613 71.21;
168196
--color-callout-caution-shadow: 0.8 0.1613 71.21 / 20%;
169197
--color-callout-important: 0.36 0 0;
170198
--color-callout-important-shadow: 0.23 0 0 / 7.06%;
199+
171200
--color-divider: 0.85 0 0;
172201

202+
/* Table */
203+
--margin-table: 2rem 0;
204+
--table-top-bottom-spacing: 2rem;
205+
--table-row-space-between: 1.5rem;
206+
--table-min-column-spacing-narrow: 1.5rem;
207+
--table-min-column-spacing-wide: 0.75rem;
208+
--table-header-bottom-spacing: 1rem;
209+
--table-line-height: 1px;
210+
211+
/* Details */
212+
--details-margin: 0.5rem 0rem;
213+
214+
--overflow-gutter-extension: 1rem;
215+
173216
/* vars for the primary grid setup */
174217
--grid-sidebar: 24rem;
175218
--grid-sidebar-gutter: 3rem;
@@ -178,32 +221,6 @@ textarea:not([rows]) {
178221
--grid-side-callout: minmax(18rem, 26rem);
179222
--grid-column-gutter: 3.5rem;
180223

181-
--code-copy-icon-height: 1rem;
182-
--code-copy-icon-width: 1rem;
183-
--breadcrumb-max-height: 54px;
184-
--sidebar-margin: 1.5rem;
185-
--sidebar-line-box-side-length: 8px;
186-
--sidebar-line-box-top: 6px;
187-
--sidebar-line-box-left: 12px;
188-
--sidebar-line-width: 11.5px;
189-
--sidebar-mobile-top-displacement: 5rem;
190-
--side-gutter-width: 20rem;
191-
--table-top-bottom-spacing: 1rem;
192-
--table-row-space-between: 1.5rem;
193-
--table-min-column-spacing-narrow: 1.5rem;
194-
--table-min-column-spacing-wide: 0.75rem;
195-
--table-header-bottom-spacing: 1rem;
196-
--table-line-height: 1px;
197-
--codeblock-comment-diff: 2rem;
198-
--codeblock-comment-space-between: 10px;
199-
--codeblock-horizontal-line-length: 2rem;
200-
--codeblock-horizontal-line-overflow: 0.25rem;
201-
--codeblock-horizontal-padding: 1rem;
202-
--codeblock-border-thickness: 1px;
203-
--codeblock-code-section-padding-left: 1rem;
204-
--codeblock-line-box-side-length: 4px;
205-
--overflow-gutter-extension: 1rem;
206-
207224
--flow-gap: 1rem;
208225

209226
/* @link https://utopia.fyi/type/calculator?c=320,14,1.2,1240,16,1.25,5,3,&s=0.75,1.5|2|3|4|6,s-l&g=s,l,xl,12 */
@@ -323,12 +340,20 @@ p {
323340
ul,
324341
ol {
325342
padding: 0;
326-
margin: 0.5rem 0 0.5rem 1rem;
343+
margin: var(--margin-list);
327344
}
328345

329346
ul li,
330347
ol li {
331-
margin: 0.5rem 0 0.5rem 0;
348+
margin: var(--margin-list-item);
349+
}
350+
351+
ul li::marker {
352+
color: oklch(var(--color-list-bullet));
353+
}
354+
355+
ol li::marker {
356+
color: oklch(var(--color-list-char));
332357
}
333358

334359
ul ul,
@@ -865,7 +890,7 @@ nav {
865890
display: grid;
866891
grid-template-columns: minmax(0, 1fr);
867892
/* These gaps determine the spacing between all content. Be careful!! */
868-
gap: var(--space-m) var(--space-m);
893+
gap: var(--flow-gap) var(--space-m);
869894

870895
/* Handles some strangeness where single-line codeblocks caused
871896
horizon */
@@ -1289,6 +1314,7 @@ nav.sidebar.sidebar__mobile-open {
12891314

12901315
/* Details/Summary */
12911316
details summary {
1317+
margin: var(--details-margin);
12921318
color: oklch(var(--color-brand));
12931319
transition: text-decoration-color 0.15s ease-in-out;
12941320
text-decoration: underline;
@@ -1362,13 +1388,24 @@ a:hover {
13621388
*/
13631389

13641390
h1 {
1391+
margin: var(--margin-content-h1);
13651392
font-size: var(--font-step-3);
13661393
}
13671394

13681395
h2 {
1396+
margin: var(--margin-content-h2);
13691397
font-size: var(--font-step-2);
13701398
}
13711399

1400+
h3 {
1401+
margin: var(--margin-content-h3);
1402+
font-size: var(--font-step-1);
1403+
}
1404+
1405+
h4 {
1406+
margin: var(--margin-content-h4);
1407+
}
1408+
13721409
p {
13731410
font-size: var(--font-step-0);
13741411
}
@@ -1605,6 +1642,10 @@ table {
16051642
}
16061643
}
16071644

1645+
.table {
1646+
margin: var(--margin-table);
1647+
}
1648+
16081649
.md-table-scroll-x {
16091650
overflow-x: auto;
16101651
width: 100%;
@@ -1647,7 +1688,7 @@ table hr {
16471688
blockquote {
16481689
border: 1px solid oklch(var(--color-foreground));
16491690
padding: 1rem;
1650-
margin: 0 -1rem;
1691+
margin: var(--margin-callout);
16511692

16521693
/* solid 3px drop shadow */
16531694
box-shadow: 3px 3px 0px oklch(var(--color-shadow));
@@ -1924,6 +1965,7 @@ a:has(code:not(pre code)) {
19241965

19251966
.code-block {
19261967
position: relative;
1968+
margin: var(--margin-codeblock);
19271969

19281970
tr::after {
19291971
display: none;
@@ -2018,7 +2060,7 @@ ul .code-block {
20182060
}
20192061
}
20202062

2021-
/* MARK: Banner
2063+
/* MARK: Banner
20222064
*/
20232065

20242066
.banner {

layouts/partials/table.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
{{ errorf "Invalid variant supplied to <table> shortcode: Received %s. Wanted: 'narrow', 'wide'" .variant }}
33
{{ end }}
44

5-
<div class="md-table-scroll-x {{ .variant }}">
5+
<div class="table md-table-scroll-x {{ .variant }}">
66
{{ .content | markdownify}}
7-
</div>
7+
</div>

0 commit comments

Comments
 (0)