Skip to content

Commit b00f797

Browse files
chore: spacing tweaks (#698)
* chore: spacing tweaks - make paragraph breaks less spacey - move `ul` closer to the preceeding paragraph which gives more visual clarity of where it belongs to - give code blocks a bit more space at the top/bottom on larger screens - give blockquotes more space at the top/bottom on larger screens Combined, these changes give more visual clarity of which things belong together, which stand on its own, etc * Update packages/site-kit/src/lib/styles/base.css Co-authored-by: Rich Harris <[email protected]> * line height-dependent top/bubble calculation * i get best results with this * rhythm * we no longer need these, because of the changes to p/ol/ul * simplify --------- Co-authored-by: Rich Harris <[email protected]>
1 parent ceb315a commit b00f797

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

packages/site-kit/src/lib/components/Text.svelte

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,13 @@
116116
border: 1px solid var(--sk-back-5);
117117
border-radius: var(--sk-border-radius);
118118
overflow: hidden;
119-
margin: 2rem 0;
119+
margin: calc(0.5 * var(--sk-line-height-body)) 0;
120120
/* background: var(--sk-back-3); */
121121
122+
@media (min-width: 767px) {
123+
margin: var(--sk-line-height-body) 0;
124+
}
125+
122126
.controls {
123127
--height: 3.6rem;
124128
display: flex;
@@ -376,11 +380,11 @@
376380
li::before {
377381
content: '';
378382
position: absolute;
379-
top: 1.43rem;
383+
top: 0.65em;
380384
left: -1.8rem;
381385
background-color: var(--sk-text-4);
382-
width: 0.6rem;
383-
height: 0.6rem;
386+
width: 0.3em;
387+
height: 0.3em;
384388
border-radius: 50%;
385389
opacity: 0.7;
386390
}

packages/site-kit/src/lib/styles/base.css

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ p,
4545
ul,
4646
ol {
4747
font: var(--sk-font-body);
48-
margin: 1lh 0;
48+
margin: 0.5lh 0;
4949

5050
&:first-child {
5151
margin-top: 0;
@@ -136,8 +136,7 @@ header {
136136
/* opinionated styles --------------------- */
137137
blockquote {
138138
position: relative;
139-
margin: 2.4rem 0;
140-
padding: 2rem 2.4rem 1.8rem 2.4rem;
139+
margin: var(--sk-line-height-body) 0;
141140
max-width: var(--sk-page-content-width);
142141
}
143142

packages/site-kit/src/lib/styles/tokens.css

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@
3939
--sk-font-size-ui-large: 3rem;
4040
--sk-font-size-mono: 1.4rem;
4141

42-
--sk-line-height-body: 1.5;
42+
/* doing it this way (rather than just `1.5`) means it has a unit, and can be used elsewhere */
43+
--sk-line-height-body: calc(1.5 * var(--sk-font-size-body));
44+
--sk-line-height-body-small: calc(1.5 * var(--sk-font-size-body-small));
4345

4446
--sk-font-h1: 500 var(--sk-font-size-h1) / 1.2 var(--sk-font-family-heading);
4547
--sk-font-h2: 500 var(--sk-font-size-h2) / 1.2 var(--sk-font-family-heading);

0 commit comments

Comments
 (0)