Skip to content
This repository was archived by the owner on Jul 31, 2025. It is now read-only.

Commit dc72ec8

Browse files
committed
refactor: Changed the reset file to a much more modern approach
1 parent 2a06089 commit dc72ec8

File tree

5 files changed

+147
-85
lines changed

5 files changed

+147
-85
lines changed

dist/css/blower.css

Lines changed: 69 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -25,54 +25,81 @@
2525
[dir=rtl] {
2626
--flow-direction: -1;
2727
}
28-
*, *::before, *::after {
28+
/* Box sizing rules */
29+
*,
30+
*::before,
31+
*::after {
2932
box-sizing: border-box;
3033
}
34+
/* Prevent font size inflation */
3135
html {
32-
line-height: 1.3;
33-
-webkit-text-size-adjust: 100%;
36+
-moz-text-size-adjust: none;
37+
-webkit-text-size-adjust: none;
38+
text-size-adjust: none;
3439
}
35-
body {
40+
/* Remove default margin in favour of better control in authored CSS */
41+
body, h1, h2, h3, h4, p,
42+
figure, blockquote {
3643
margin: 0;
44+
}
45+
/* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
46+
ul[role=list],
47+
ol[role=list] {
48+
list-style: none;
49+
}
50+
/* Set core body defaults */
51+
body {
3752
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
53+
line-height: 1.5;
3854
min-height: 100vh;
3955
min-height: 100svh;
4056
}
41-
pre,
42-
code,
43-
kbd,
44-
samp {
45-
font-family: monospace, monospace;
46-
font-size: 1em;
57+
/* Set shorter line heights on headings and interactive elements */
58+
h1, h2, h3, h4,
59+
button, input, label {
60+
line-height: 1.1;
4761
}
48-
button,
49-
input,
50-
optgroup,
51-
select,
52-
textarea {
53-
font-family: inherit;
54-
font-size: 100%;
55-
line-height: 1.15;
62+
/* Balance text wrapping on headings */
63+
h1, h2,
64+
h3, h4 {
65+
text-wrap: balance;
5666
}
57-
textarea {
58-
resize: vertical;
67+
/* A elements that don't have a class get default styles */
68+
a:not([class]) {
69+
-webkit-text-decoration-skip: ink;
70+
text-decoration-skip-ink: auto;
71+
color: currentColor;
5972
}
60-
button,
61-
select {
62-
text-transform: none;
73+
/* Make images easier to work with */
74+
img,
75+
picture,
76+
svg {
77+
max-width: 100%;
78+
display: block;
79+
vertical-align: middle;
6380
}
64-
button,
65-
[type=button],
66-
[type=reset],
67-
[type=submit] {
68-
-webkit-appearance: button;
81+
/* Inherit fonts for inputs and buttons */
82+
input, button,
83+
textarea, select {
84+
font: inherit;
6985
}
86+
/* Make sure textareas without a rows attribute are not tiny and change the resize direction to only vertical */
87+
textarea:not([rows]) {
88+
min-height: 10em;
89+
resize: vertical;
90+
}
91+
/* Anything that has been anchored to should have extra scroll margin */
92+
:target {
93+
scroll-margin-block: 5ex;
94+
}
95+
/* Add pointer cursor to buttons */
7096
button:not(:disabled),
7197
[type=button]:not(:disabled),
7298
[type=reset]:not(:disabled),
7399
[type=submit]:not(:disabled) {
74100
cursor: pointer;
75101
}
102+
/* Unify the sub and sup stylings */
76103
sub,
77104
sup {
78105
font-size: 75%;
@@ -86,23 +113,18 @@
86113
sup {
87114
top: -0.5em;
88115
}
89-
img,
90-
svg {
91-
vertical-align: middle;
92-
}
93-
button:focus:not(:focus-visible) {
94-
outline: 0;
95-
}
96116
iframe {
97117
border: 0;
98118
}
99-
iframe,
100-
img {
101-
max-width: 100%;
102-
display: block;
103-
}
104119
}
105120
@layer base {
121+
pre,
122+
code,
123+
kbd,
124+
samp {
125+
font-family: monospace, monospace;
126+
font-size: 1em;
127+
}
106128
code, pre {
107129
background-color: #e2e8f0;
108130
border-radius: 4px;
@@ -151,6 +173,11 @@
151173
background: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.1));
152174
z-index: -1;
153175
}
176+
.theme-dashboard .layout-sidebar .page-title {
177+
margin-block-end: 1rem;
178+
font-size: 2rem;
179+
color: #f0faf5;
180+
}
154181
.theme-dashboard .layout-sidebar .section-title {
155182
margin-block: 1.5rem 0.25rem;
156183
font-size: 1.25rem;
@@ -169,10 +196,10 @@
169196
grid-area: footer;
170197
padding: var(--spacing-segments);
171198
}
172-
.theme-dashboard.has-no-header, .theme-dashboard:not(:has(.layout-header)) {
199+
.theme-dashboard.has-no-header, .theme-dashboard:not(:has(.layout-header:not(:empty))) {
173200
--area-row-first: "sidebar main";
174201
}
175-
.theme-dashboard.has-no-footer, .theme-dashboard:not(:has(.layout-footer)) {
202+
.theme-dashboard.has-no-footer, .theme-dashboard:not(:has(.layout-footer:not(:empty))) {
176203
--area-row-last: "sidebar main";
177204
}
178205
.navigation {

dist/css/blower.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scss/_reset.scss

Lines changed: 61 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/// CSS Reset based on Andy Bell's (more) modern CSS reset
2+
/// @see https://andy-bell.co.uk/a-more-modern-css-reset/
13
@use 'variables/font';
24

35
@use 'mixins' as mx;
@@ -10,90 +12,109 @@
1012
--flow-direction: -1;
1113
}
1214

13-
*, *::before, *::after {
15+
/* Box sizing rules */
16+
*,
17+
*::before,
18+
*::after {
1419
box-sizing: border-box;
1520
}
1621

22+
/* Prevent font size inflation */
1723
html {
18-
line-height: 1.3;
19-
-webkit-text-size-adjust: 100%;
24+
-moz-text-size-adjust: none;
25+
-webkit-text-size-adjust: none;
26+
text-size-adjust: none;
2027
}
2128

22-
body {
29+
/* Remove default margin in favour of better control in authored CSS */
30+
body, h1, h2, h3, h4, p,
31+
figure, blockquote {
2332
margin: 0;
33+
}
34+
35+
/* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
36+
ul[role='list'],
37+
ol[role='list'] {
38+
list-style: none;
39+
}
40+
41+
/* Set core body defaults */
42+
body {
2443
font-family: font.$fallback;
44+
line-height: 1.5;
2545
@include mx.viewport-height(100, 'min');
2646
}
2747

28-
pre,
29-
code,
30-
kbd,
31-
samp {
32-
font-family: monospace, monospace;
33-
font-size: 1em;
48+
/* Set shorter line heights on headings and interactive elements */
49+
h1, h2, h3, h4,
50+
button, input, label {
51+
line-height: 1.1;
3452
}
3553

36-
button,
37-
input,
38-
optgroup,
39-
select,
40-
textarea {
41-
font-family: inherit;
42-
font-size: 100%;
43-
line-height: 1.15;
54+
/* Balance text wrapping on headings */
55+
h1, h2,
56+
h3, h4 {
57+
text-wrap: balance;
58+
}
59+
60+
/* A elements that don't have a class get default styles */
61+
a:not([class]) {
62+
text-decoration-skip-ink: auto;
63+
color: currentColor;
64+
}
65+
66+
/* Make images easier to work with */
67+
img,
68+
picture,
69+
svg {
70+
max-width: 100%;
71+
display: block;
72+
vertical-align: middle;
4473
}
4574

46-
textarea {
75+
/* Inherit fonts for inputs and buttons */
76+
input, button,
77+
textarea, select {
78+
font: inherit;
79+
}
80+
81+
/* Make sure textareas without a rows attribute are not tiny and change the resize direction to only vertical */
82+
textarea:not([rows]) {
83+
min-height: 10em;
4784
resize: vertical;
4885
}
4986

50-
button,
51-
select {
52-
text-transform: none;
87+
/* Anything that has been anchored to should have extra scroll margin */
88+
:target {
89+
scroll-margin-block: 5ex;
5390
}
5491

92+
/* Add pointer cursor to buttons */
5593
button,
5694
[type='button'],
5795
[type='reset'],
5896
[type='submit'] {
59-
-webkit-appearance: button;
6097

6198
&:not(:disabled) {
6299
cursor: pointer;
63100
}
64101
}
65102

103+
/* Unify the sub and sup stylings */
66104
sub,
67105
sup {
68106
font-size: 75%;
69107
line-height: 0;
70108
position: relative;
71109
vertical-align: baseline;
72110
}
73-
74111
sub {
75112
bottom: -0.25em;
76113
}
77-
78114
sup {
79115
top: -0.5em;
80116
}
81117

82-
img,
83-
svg {
84-
vertical-align: middle;
85-
}
86-
87-
button:focus:not(:focus-visible) {
88-
outline: 0;
89-
}
90-
91118
iframe {
92119
border: 0;
93120
}
94-
95-
iframe,
96-
img {
97-
max-width: 100%;
98-
display: block;
99-
}

scss/base/_code.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33

44
@use '../functions' as fn;
55

6+
pre,
7+
code,
8+
kbd,
9+
samp {
10+
font-family: monospace, monospace;
11+
font-size: 1em;
12+
}
13+
614
code, pre {
715
background-color: color.$gray-200;
816
border-radius: base.$corner-radius;

scss/layout/themes/_dashboard.scss

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@
3535
z-index: -1;
3636
}
3737

38+
.page-title {
39+
margin-block-end: fn.spacing(2);
40+
font-size: 2rem;
41+
color: color.$text-light;
42+
}
43+
3844
.section-title {
3945
margin-block: fn.spacing(3) fn.spacing(.5);
4046
font-size: 1.25rem;
@@ -58,11 +64,11 @@
5864
padding: var(--spacing-segments);
5965
}
6066

61-
&.has-no-header, &:not(:has(.layout-header)) {
67+
&.has-no-header, &:not(:has(.layout-header:not(:empty))) {
6268
--area-row-first: 'sidebar main';
6369
}
6470

65-
&.has-no-footer, &:not(:has(.layout-footer)) {
71+
&.has-no-footer, &:not(:has(.layout-footer:not(:empty))) {
6672
--area-row-last: 'sidebar main';
6773
}
6874
}

0 commit comments

Comments
 (0)