Skip to content

Commit 506a08f

Browse files
Merge pull request #4 from cipherdothost/alan/fix-styling-issues
Alan/fix styling issues
2 parents a0306e4 + 0eba8e4 commit 506a08f

File tree

18 files changed

+152
-183
lines changed

18 files changed

+152
-183
lines changed

static/assets/scss/global/_index.scss

Lines changed: 37 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -57,22 +57,25 @@ main {
5757
width: 100%;
5858
max-width: none;
5959
justify-content: center;
60+
padding: 0;
6061
border-bottom: 1px solid $borderSecondary;
6162
background: $bgPrimary;
62-
padding-block: 12px;
63+
padding-block: 0.75rem;
6364

6465
&__inner {
6566
display: flex;
6667
width: 100%;
6768
max-width: $layoutWidth;
6869
align-items: center;
69-
gap: 16px;
70+
gap: 1rem;
7071
padding-inline: $layoutPadding;
7172
}
7273

7374
&__logo {
7475
position: relative;
76+
z-index: 1;
7577
display: block;
78+
aspect-ratio: 1/1;
7679
color: $fgPrimary;
7780

7881
&::after {
@@ -151,33 +154,42 @@ main {
151154
display: flex;
152155
flex-wrap: wrap;
153156
justify-content: center;
157+
font-size: 1rem;
154158
gap: 1rem;
155159
padding-block: 1rem;
156-
157-
&__link {
158-
159-
@extend %link;
160-
}
161160
}
162161

163162
.pageDescription {
164-
padding-left: 16px;
165-
border-radius: 8px;
166-
border-left: 12px solid $fgPrimary;
167-
margin-bottom: $layoutPadding;
168-
padding-block: 6px;
169163

170-
&__title {
164+
&__text:not(:last-child) {
165+
margin-bottom: #{calc($layoutPadding / 2)};
166+
}
171167

172-
@extend %h1;
168+
&.mNoCard {
169+
padding-left: 1rem;
170+
border-radius: 0.5rem;
171+
border-left: 0.75rem solid $fgPrimary;
172+
margin-bottom: $layoutPadding;
173+
padding-block: 0.25rem;
173174
}
174175

175-
&__text {
176-
color: $fgPrimary;
177-
font-size: 1.125rem;
176+
&.mCard {
177+
178+
@extend %uSurface;
179+
position: relative;
180+
padding-left: 2.5rem;
181+
margin-bottom: calc($layoutPadding / 2);
182+
padding-block: 1rem;
178183

179-
&:not(:last-child) {
180-
margin-bottom: #{calc($layoutPadding / 2)};
184+
&::before {
185+
position: absolute;
186+
top: 0;
187+
left: 0;
188+
width: 1rem;
189+
height: 100%;
190+
border-radius: 1rem 0 0 1rem;
191+
background: $fgPrimary;
192+
content: "";
181193
}
182194
}
183195
}
@@ -186,6 +198,7 @@ main {
186198
display: flex;
187199
flex-wrap: wrap;
188200
justify-content: space-between;
201+
font-size: 1rem;
189202

190203
&__item {
191204
display: flex;
@@ -228,23 +241,22 @@ main {
228241
&__links {
229242
display: flex;
230243
flex-wrap: wrap;
231-
232-
@include media("<tablet") {
233-
column-gap: 1em;
234-
}
244+
gap: 0 1em;
235245
}
236246

237247
&__link {
238248
position: relative;
239249
padding: 0.5em;
240250
border: 1px solid transparent;
241251
border-radius: 8px;
252+
margin: -0.5em;
242253
text-decoration: underline;
243-
--_icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23000' d='M9.75 4h.516A3.74 3.74 0 0 1 14 7.75c0 2.003-1.565 3.641-3.53 3.745l-.197.005l-.516.005a.75.75 0 0 1-.115-1.493l.101-.007l.523-.005A2.24 2.24 0 0 0 12.5 7.75c0-1.192-.92-2.166-2.081-2.245l-.153-.005H9.75a.75.75 0 0 1-.102-1.493zh.516zM5.752 4h.498a.75.75 0 0 1 .102 1.493L6.25 5.5h-.498a2.252 2.252 0 0 0-.154 4.5l.154.005h.498a.75.75 0 0 1 .102 1.493l-.102.007h-.498a3.752 3.752 0 0 1-.199-7.5zh.497zM5.75 7h4.5a.75.75 0 0 1 .102 1.493l-.102.007h-4.5a.75.75 0 0 1-.102-1.493zh4.5z'/%3E%3C/svg%3E");
244254
transition: border-color 0.12s, background-color 0.12s, color 0.12s;
255+
--_icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23000' d='M9.75 4h.516A3.74 3.74 0 0 1 14 7.75c0 2.003-1.565 3.641-3.53 3.745l-.197.005l-.516.005a.75.75 0 0 1-.115-1.493l.101-.007l.523-.005A2.24 2.24 0 0 0 12.5 7.75c0-1.192-.92-2.166-2.081-2.245l-.153-.005H9.75a.75.75 0 0 1-.102-1.493zh.516zM5.752 4h.498a.75.75 0 0 1 .102 1.493L6.25 5.5h-.498a2.252 2.252 0 0 0-.154 4.5l.154.005h.498a.75.75 0 0 1 .102 1.493l-.102.007h-.498a3.752 3.752 0 0 1-.199-7.5zh.497zM5.75 7h4.5a.75.75 0 0 1 .102 1.493l-.102.007h-4.5a.75.75 0 0 1-.102-1.493zh4.5z'/%3E%3C/svg%3E");
245256

246257
@include media("<tablet") {
247-
padding-inline: 0;
258+
padding: 0;
259+
margin: 0;
248260
}
249261

250262
@include media(">tablet") {

static/assets/scss/global/_reset.scss

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,13 @@
88
*::before,
99
*::after {
1010
box-sizing: border-box;
11-
padding: 0;
1211
border: none;
1312
border-radius: 0;
1413
margin: 0;
1514
background: transparent;
1615
font-family: inherit;
1716
font-size: inherit;
1817
line-height: inherit;
19-
list-style: none;
2018
text-align: inherit;
2119
text-transform: inherit;
2220
}
@@ -54,6 +52,16 @@ a:where([class]:visited) {
5452
text-decoration: none;
5553
}
5654

55+
/* Reset styles on lists with classes. */
56+
ul:where([class]),
57+
ol:where([class]) {
58+
padding: 0;
59+
}
60+
61+
li:where([class]) {
62+
list-style: none;
63+
}
64+
5765
/* Add the correct font size in all browsers. */
5866
small {
5967
font-size: 80%;

static/assets/scss/global/_text.scss

Lines changed: 37 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66

77
@use "variables" as *;
88

9-
html {
9+
body {
1010
color: $fgSecondary;
1111
font-family: system-ui, sans-serif;
12-
font-size: 1rem;
12+
font-size: 1.125rem;
1313
line-height: 1.5;
1414
}
1515

@@ -27,23 +27,46 @@ h6,
2727
.h6 {
2828
margin-bottom: 0.25em;
2929
color: $fgPrimary;
30-
line-height: 1.1;
30+
line-height: 1;
3131
text-wrap: balance;
3232
}
3333

34+
h1,
35+
.h1,
36+
%h1 {
37+
font-size: 2rem;
38+
}
39+
40+
h2,
41+
.h2,
42+
%h2 {
43+
font-size: 1.5rem;
44+
}
45+
46+
h3,
47+
.h3,
48+
%h3 {
49+
font-size: 1.25rem;
50+
}
51+
3452
.uRichText {
35-
max-width: 65ch;
3653
line-height: 1.5;
3754
text-wrap: pretty;
3855

39-
:where(p),
40-
:where(img),
41-
:where(picture) {
42-
margin-bottom: 1em;
56+
:where(p) {
57+
margin-top: 0.75em;
58+
}
4359

44-
&:last-child {
45-
margin-bottom: 0;
46-
}
60+
:where(ul, ol, pre, img, picture) {
61+
margin-top: 0.25em;
62+
}
63+
64+
:where(h1, h2, h3, h4, h5, h6) {
65+
margin-top: 1.5em;
66+
}
67+
68+
> :where(:first-child) {
69+
margin-top: 0;
4770
}
4871
}
4972

@@ -61,23 +84,11 @@ code {
6184
}
6285

6386
a:where(:not([class])),
64-
%link {
65-
color: $fgSecondary;
87+
.a {
88+
color: $fgPrimary;
6689
text-decoration: underline;
6790

6891
&:hover {
69-
color: $fgPrimary;
92+
color: $fgSecondary;
7093
}
7194
}
72-
73-
%h1 {
74-
font-size: 2rem;
75-
}
76-
77-
%h2 {
78-
font-size: 1.5rem;
79-
}
80-
81-
%h3 {
82-
font-size: 1.25rem;
83-
}

static/assets/scss/global/_utility.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,11 @@
3434
.uDisabled {
3535
pointer-events: none;
3636
}
37+
38+
%uSurface,
39+
.uSurface {
40+
padding: 1.5rem;
41+
border: 1px solid $borderPrimary;
42+
border-radius: 1rem;
43+
background: $bgPrimary;
44+
}

static/assets/scss/global/_variables.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
$layoutWidth: 750px;
8-
$layoutPadding: 32px;
8+
$layoutPadding: min(5%, 2rem);
99

1010
$fgPrimary: hsl(0deg 0% 14%);
1111
$fgSecondary: hsl(0deg 0% 30%);

static/assets/scss/highlight.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66

77
.chroma code {
88
width: 100%;
9-
border-radius: 8px;
10-
margin-bottom: 1rem;
9+
border-radius: 6px;
1110
background-color: #242424;
1211
color: #fff;
1312
padding-block: 0.5em;

static/assets/scss/main.scss

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,5 @@
55
*/
66

77
@use "./pages/index";
8-
@use "./pages/package";
9-
@use "./pages/privacy";
108
@use "./pages/search";
119
@use "./pages/404" as *;

static/assets/scss/pages/_404.scss

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@
4040
}
4141

4242
&__link {
43-
44-
@extend %link;
4543
display: block;
4644
margin-top: 1rem;
4745
}

static/assets/scss/pages/_index.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
}
5050

5151
&__description {
52-
margin-bottom: 1em;
52+
margin-bottom: 1.5em;
53+
font-size: 1rem;
5354
}
5455
}

static/assets/scss/pages/_package.scss

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)