tangled
alpha
login
or
join now
finxol.io
/
portfolio
0
fork
atom
Personal site
staging.colinozanne.co.uk
portfolio
astro
0
fork
atom
overview
issues
pulls
pipelines
chore: add css layers
finxol.io
4 months ago
e2461898
5c7b4ff6
verified
This commit was signed with the committer's
known signature
.
finxol.io
SSH Key Fingerprint:
SHA256:olFE3asYdoBMScuJOt60UxXdJ0RFdGv5kVKrdOtIcPI=
+178
-161
3 changed files
expand all
collapse all
unified
split
src
assets
styles
index.css
main.css
reset.css
+52
-43
src/assets/styles/index.css
···
61
61
}
62
62
63
63
&.content-projects {
64
64
-
--container-color: var(--fuchsia-400);
65
65
-
66
64
grid-area: content-projects;
67
65
}
68
66
}
69
67
70
70
-
section.container.layout {
71
71
-
display: grid;
72
72
-
grid-template-columns: auto auto 1fr;
73
73
-
grid-template-areas:
74
74
-
"aside h3 intro"
75
75
-
". body body";
76
76
-
align-items: center;
77
77
-
justify-content: start;
78
78
-
padding: calc(var(--spacing) * 2) var(--spacing) calc(var(--spacing) * 3);
79
79
-
grid-column-gap: var(--spacing);
68
68
+
section.container.content-projects {
69
69
+
--container-color: var(--rose-100);
80
70
81
81
-
@media screen and (max-width: 768px) {
82
82
-
grid-template-areas:
83
83
-
"aside h3"
84
84
-
". intro"
85
85
-
". body";
71
71
+
& > div {
72
72
+
display: grid;
86
73
}
74
74
+
}
87
75
88
88
-
& > aside {
89
89
-
grid-area: aside;
90
90
-
margin-inline: 1.5rem;
91
91
-
font-size: 3rem;
92
92
-
font-weight: bold;
76
76
+
@layer components {
77
77
+
section.container.layout {
78
78
+
display: grid;
79
79
+
grid-template-columns: auto auto 1fr;
80
80
+
grid-template-areas:
81
81
+
"aside h3 intro"
82
82
+
". body body";
83
83
+
align-items: center;
84
84
+
justify-content: start;
85
85
+
padding: calc(var(--spacing) * 2) var(--spacing)
86
86
+
calc(var(--spacing) * 3);
87
87
+
grid-column-gap: var(--spacing);
93
88
94
89
@media screen and (max-width: 768px) {
90
90
+
grid-template-areas:
91
91
+
"aside h3"
92
92
+
". intro"
93
93
+
". body";
94
94
+
}
95
95
+
96
96
+
& > aside {
97
97
+
grid-area: aside;
98
98
+
margin-inline: 1.5rem;
99
99
+
font-size: 3rem;
100
100
+
font-weight: bold;
101
101
+
102
102
+
@media screen and (max-width: 768px) {
103
103
+
font-size: 2rem;
104
104
+
margin-inline: 0.5rem;
105
105
+
}
106
106
+
}
107
107
+
108
108
+
& > h3 {
109
109
+
grid-area: h3;
110
110
+
margin: 0;
111
111
+
margin-inline-end: 2rem;
112
112
+
font-family: "Spagetty";
95
113
font-size: 2rem;
96
96
-
margin-inline: 0.5rem;
114
114
+
font-weight: bold;
97
115
}
98
98
-
}
99
116
100
100
-
& > h3 {
101
101
-
grid-area: h3;
102
102
-
margin: 0;
103
103
-
margin-inline-end: 2rem;
104
104
-
font-family: "Spagetty";
105
105
-
font-size: 2rem;
106
106
-
font-weight: bold;
107
107
-
}
117
117
+
& > p {
118
118
+
grid-area: intro;
119
119
+
margin: 0;
120
120
+
font-size: 1.2rem;
121
121
+
}
108
122
109
109
-
& > p {
110
110
-
grid-area: intro;
111
111
-
margin: 0;
112
112
-
font-size: 1.2rem;
113
113
-
}
114
114
-
115
115
-
& > div {
116
116
-
grid-area: body;
117
117
-
display: flex;
118
118
-
flex-direction: column;
119
119
-
gap: var(--spacing);
123
123
+
& > div {
124
124
+
grid-area: body;
125
125
+
display: flex;
126
126
+
flex-direction: column;
127
127
+
gap: var(--spacing);
128
128
+
}
120
129
}
121
130
}
+45
-39
src/assets/styles/main.css
···
13
13
@import url("@/assets/fonts/easycoast.css");
14
14
@import url("@/assets/fonts/scorekard.css");
15
15
16
16
+
@layer base, layout, components, utilities;
17
17
+
16
18
:root {
17
19
--radius: 0.75rem;
18
20
--spacing: 0.75rem;
19
21
}
20
22
21
21
-
.container {
22
22
-
padding: var(--spacing);
23
23
-
width: calc(100% - 2rem * var(--spacing));
24
24
-
border-radius: var(--radius);
25
25
-
color: var(--container-text-color, var(--emerald-950, black));
26
26
-
background-color: var(--container-color, var(--emerald-500, red));
27
27
-
}
23
23
+
@layer components {
24
24
+
svg[data-icon] {
25
25
+
--size: 1.5rem;
28
26
29
29
-
svg[data-icon] {
30
30
-
--size: 1.5rem;
31
31
-
32
32
-
width: var(--size);
33
33
-
height: var(--size);
27
27
+
width: var(--size);
28
28
+
height: var(--size);
29
29
+
}
34
30
}
35
31
36
36
-
@media (max-width: 768px) {
37
37
-
.desktop-only {
38
38
-
display: none;
32
32
+
@layer utilities {
33
33
+
.container {
34
34
+
padding: var(--spacing);
35
35
+
width: calc(100% - 2rem * var(--spacing));
36
36
+
border-radius: var(--radius);
37
37
+
color: var(--container-text-color, var(--emerald-950, black));
38
38
+
background-color: var(--container-color, var(--emerald-500, red));
39
39
}
40
40
-
}
41
40
42
42
-
.content-grid {
43
43
-
--padding-inline: min(2%, 1.5rem);
41
41
+
@media (max-width: 768px) {
42
42
+
.desktop-only {
43
43
+
display: none;
44
44
+
}
45
45
+
}
44
46
45
45
-
display: grid;
46
46
-
grid-template-columns:
47
47
-
[full-width-start] var(--padding-inline)
48
48
-
[breakout-start] var(--padding-inline)
49
49
-
[content-start] 1fr
50
50
-
[content-end]
51
51
-
var(--padding-inline) [breakout-end]
52
52
-
var(--padding-inline) [full-width-end];
53
53
-
justify-content: start;
54
54
-
align-content: start;
55
55
-
row-gap: calc(var(--spacing) * 4);
56
56
-
}
47
47
+
.content-grid {
48
48
+
--padding-inline: min(2%, 1.5rem);
57
49
58
58
-
.content-grid > :not(.breakout, .full-width),
59
59
-
.full-width > :not(.breakout, .full-width) {
60
60
-
grid-column: content;
61
61
-
}
50
50
+
display: grid;
51
51
+
grid-template-columns:
52
52
+
[full-width-start] var(--padding-inline)
53
53
+
[breakout-start] var(--padding-inline)
54
54
+
[content-start] 1fr
55
55
+
[content-end]
56
56
+
var(--padding-inline) [breakout-end]
57
57
+
var(--padding-inline) [full-width-end];
58
58
+
justify-content: start;
59
59
+
align-content: start;
60
60
+
row-gap: calc(var(--spacing) * 4);
61
61
+
}
62
62
63
63
-
.content-grid > .breakout {
64
64
-
grid-column: breakout;
65
65
-
}
63
63
+
.content-grid > :not(.breakout, .full-width),
64
64
+
.full-width > :not(.breakout, .full-width) {
65
65
+
grid-column: content;
66
66
+
}
67
67
+
68
68
+
.content-grid > .breakout {
69
69
+
grid-column: breakout;
70
70
+
}
66
71
67
67
-
.content-grid > .full-width {
68
68
-
grid-column: full-width;
72
72
+
.content-grid > .full-width {
73
73
+
grid-column: full-width;
74
74
+
}
69
75
}
+81
-79
src/assets/styles/reset.css
···
1
1
/* CSS Reset by Andy Bell : https://piccalil.li/blog/a-more-modern-css-reset/ */
2
2
3
3
-
/* Box sizing rules */
4
4
-
*,
5
5
-
*::before,
6
6
-
*::after {
7
7
-
box-sizing: border-box;
8
8
-
}
3
3
+
@layer base {
4
4
+
/* Box sizing rules */
5
5
+
*,
6
6
+
*::before,
7
7
+
*::after {
8
8
+
box-sizing: border-box;
9
9
+
}
9
10
10
10
-
/* Prevent font size inflation */
11
11
-
html {
12
12
-
-moz-text-size-adjust: none;
13
13
-
-webkit-text-size-adjust: none;
14
14
-
text-size-adjust: none;
15
15
-
}
11
11
+
/* Prevent font size inflation */
12
12
+
html {
13
13
+
-moz-text-size-adjust: none;
14
14
+
-webkit-text-size-adjust: none;
15
15
+
text-size-adjust: none;
16
16
+
}
16
17
17
17
-
/* Remove default margin in favour of better control in authored CSS */
18
18
-
body,
19
19
-
h1,
20
20
-
h2,
21
21
-
h3,
22
22
-
h4,
23
23
-
p,
24
24
-
figure,
25
25
-
blockquote,
26
26
-
dl,
27
27
-
dd {
28
28
-
margin-block-end: 0;
29
29
-
}
18
18
+
/* Remove default margin in favour of better control in authored CSS */
19
19
+
body,
20
20
+
h1,
21
21
+
h2,
22
22
+
h3,
23
23
+
h4,
24
24
+
p,
25
25
+
figure,
26
26
+
blockquote,
27
27
+
dl,
28
28
+
dd {
29
29
+
margin-block-end: 0;
30
30
+
}
30
31
31
31
-
/* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
32
32
-
ul[role="list"],
33
33
-
ol[role="list"] {
34
34
-
list-style: none;
35
35
-
}
32
32
+
/* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
33
33
+
ul[role="list"],
34
34
+
ol[role="list"] {
35
35
+
list-style: none;
36
36
+
}
36
37
37
37
-
/* Set core body defaults */
38
38
-
body {
39
39
-
line-height: 1.3;
40
40
-
padding: 0;
41
41
-
margin: 0;
42
42
-
}
38
38
+
/* Set core body defaults */
39
39
+
body {
40
40
+
line-height: 1.3;
41
41
+
padding: 0;
42
42
+
margin: 0;
43
43
+
}
43
44
44
44
-
/* Set shorter line heights on headings and interactive elements */
45
45
-
h1,
46
46
-
h2,
47
47
-
h3,
48
48
-
h4,
49
49
-
button,
50
50
-
input,
51
51
-
label {
52
52
-
line-height: 1.1;
53
53
-
}
45
45
+
/* Set shorter line heights on headings and interactive elements */
46
46
+
h1,
47
47
+
h2,
48
48
+
h3,
49
49
+
h4,
50
50
+
button,
51
51
+
input,
52
52
+
label {
53
53
+
line-height: 1.1;
54
54
+
}
54
55
55
55
-
/* Balance text wrapping on headings */
56
56
-
h1,
57
57
-
h2,
58
58
-
h3,
59
59
-
h4 {
60
60
-
text-wrap: balance;
61
61
-
}
56
56
+
/* Balance text wrapping on headings */
57
57
+
h1,
58
58
+
h2,
59
59
+
h3,
60
60
+
h4 {
61
61
+
text-wrap: balance;
62
62
+
}
62
63
63
63
-
/* A elements that don't have a class get default styles */
64
64
-
a:not([class]) {
65
65
-
text-decoration-skip-ink: auto;
66
66
-
color: currentColor;
67
67
-
}
64
64
+
/* A elements that don't have a class get default styles */
65
65
+
a:not([class]) {
66
66
+
text-decoration-skip-ink: auto;
67
67
+
color: currentColor;
68
68
+
}
68
69
69
69
-
/* Make images easier to work with */
70
70
-
img,
71
71
-
picture {
72
72
-
max-width: 100%;
73
73
-
display: block;
74
74
-
}
70
70
+
/* Make images easier to work with */
71
71
+
img,
72
72
+
picture {
73
73
+
max-width: 100%;
74
74
+
display: block;
75
75
+
}
75
76
76
76
-
/* Inherit fonts for inputs and buttons */
77
77
-
input,
78
78
-
button,
79
79
-
textarea,
80
80
-
select {
81
81
-
font-family: inherit;
82
82
-
font-size: inherit;
83
83
-
}
77
77
+
/* Inherit fonts for inputs and buttons */
78
78
+
input,
79
79
+
button,
80
80
+
textarea,
81
81
+
select {
82
82
+
font-family: inherit;
83
83
+
font-size: inherit;
84
84
+
}
84
85
85
85
-
/* Make sure textareas without a rows attribute are not tiny */
86
86
-
textarea:not([rows]) {
87
87
-
min-height: 10em;
88
88
-
}
86
86
+
/* Make sure textareas without a rows attribute are not tiny */
87
87
+
textarea:not([rows]) {
88
88
+
min-height: 10em;
89
89
+
}
89
90
90
90
-
/* Anything that has been anchored to should have extra scroll margin */
91
91
-
:target {
92
92
-
scroll-margin-block: 5ex;
91
91
+
/* Anything that has been anchored to should have extra scroll margin */
92
92
+
:target {
93
93
+
scroll-margin-block: 5ex;
94
94
+
}
93
95
}