Skip to content

Commit 446b9a1

Browse files
Subtle visual enhancements
1 parent c86777f commit 446b9a1

File tree

9 files changed

+106
-27
lines changed

9 files changed

+106
-27
lines changed

src/elements/components/card.module.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,8 @@
44
.card {
55
@include themed using($t) {
66
border: 1px solid t($t, $n-200, $n-800);
7+
box-shadow: t($t, 0 1px 2px rgb(0 0 0 / 4%), 0 1px 2px rgb(0 0 0 / 12%));
78
}
9+
10+
transition: box-shadow 0.2s ease-out;
811
}
Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
11
.textLink {
22
color: var(--link-color);
3+
text-decoration: underline;
4+
text-decoration-color: transparent;
5+
text-underline-offset: 2px;
6+
transition: text-decoration-color 0.15s ease, color 0.15s ease;
37

48
&:hover {
5-
text-decoration: underline;
9+
text-decoration-color: currentcolor;
610
}
711

812
.externalIcon {
913
margin-bottom: -0.125em;
1014
margin-left: 0.1em;
1115
margin-right: 0.1em;
16+
opacity: 0.7;
17+
transition: opacity 0.15s ease;
18+
}
19+
20+
&:hover .externalIcon {
21+
opacity: 1;
1222
}
1323
}

src/elements/components/model-card.module.scss

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,22 @@
99
border-radius: 0.5rem;
1010
border-width: 1px;
1111
border-style: solid;
12-
transition: transform 0.3s ease, box-shadow 0.3s ease;
12+
transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
1313
z-index: 1;
1414

1515
--inner-radius: calc(0.5rem - 1px);
1616

17+
@include themed using($t) {
18+
box-shadow: t($t, 0 1px 3px rgb(0 0 0 / 5%), 0 1px 3px rgb(0 0 0 / 15%));
19+
}
20+
1721
&:hover {
18-
transform: scale(1.02);
22+
transform: translateY(-4px);
1923
z-index: 10;
24+
25+
@include themed using($t) {
26+
box-shadow: t($t, 0 12px 24px -8px rgb(0 0 0 / 15%), 0 12px 24px -8px rgb(0 0 0 / 40%));
27+
}
2028
}
2129

2230
&.overflowHidden {

src/elements/components/scroll-to-top.module.scss

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,31 @@
1414
// design
1515
cursor: pointer;
1616
border: none;
17-
background: none;
17+
background: var(--page-bg);
1818
border-radius: 100%;
19-
padding: 0.25rem;
20-
opacity: 0.3;
21-
transition: opacity 0.5s ease-in-out;
19+
padding: 0.5rem;
20+
opacity: 0.5;
21+
transition: opacity 0.2s ease-out, transform 0.2s ease-out, box-shadow 0.2s ease-out;
22+
box-shadow: 0 2px 8px rgb(0 0 0 / 15%);
2223

2324
@media screen and (max-width: 1600px) {
24-
opacity: 0.5;
25+
opacity: 0.7;
2526
}
2627

2728
&:hover {
2829
opacity: 1;
29-
transition-duration: 0.2s;
30+
transform: translateY(-2px);
31+
box-shadow: 0 4px 12px rgb(0 0 0 / 20%);
32+
}
33+
34+
&:active {
35+
transform: translateY(0);
3036
}
3137

3238
svg {
33-
width: 2rem;
34-
height: 2rem;
39+
width: 1.75rem;
40+
height: 1.75rem;
3541
border-radius: 100%;
42+
display: block;
3643
}
3744
}

src/elements/components/switch.module.scss

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
width: calc(var(--switch-inner-height) * var(--switch-ratio));
1010
box-sizing: content-box;
1111
background-color: hsl(0deg 0% 40% / 50%);
12-
transition: background-color 200ms linear;
12+
transition: background-color 200ms ease-out, box-shadow 200ms ease-out;
1313
padding: calc(var(--switch-inner-height) * 0.125);
1414
flex-shrink: 0;
1515
border: none;
@@ -21,20 +21,29 @@
2121
outline: none;
2222
}
2323

24+
&:hover {
25+
box-shadow: 0 0 0 2px hsl(0deg 0% 50% / 20%);
26+
}
27+
2428
.circle {
2529
background-color: white;
2630
display: inline-block;
2731
pointer-events: none;
2832
border-radius: 100%;
2933
width: var(--switch-inner-height);
3034
height: var(--switch-inner-height);
31-
transition: transform 200ms ease-in-out;
35+
transition: transform 200ms cubic-bezier(0.4, 0, 0.2, 1);
3236
transform: translate(0, 0);
37+
box-shadow: 0 1px 3px rgb(0 0 0 / 20%);
3338
}
3439

3540
&[data-headlessui-state='checked'] {
3641
background-color: var(--accent);
3742

43+
&:hover {
44+
box-shadow: 0 0 0 2px hsl(250deg 50% 50% / 30%);
45+
}
46+
3847
.circle {
3948
transform: translate(calc(var(--switch-inner-height) * (var(--switch-ratio) - 1)), 0);
4049
}

src/elements/header.module.scss

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
.header {
1414
@include themed using ($t) {
1515
background: linear-gradient(t($t, white, $fade-900), transparent)
16-
t($t, color.change(white, $alpha: 0.8), color.change($fade-900, $alpha: 0.85));
16+
t($t, color.change(white, $alpha: 0.85), color.change($fade-900, $alpha: 0.9));
1717
}
1818

19-
transition: background-color linear 0.2s, border-color linear 0.2s;
20-
backdrop-filter: saturate(200%) blur(8px);
19+
transition: background-color 0.25s ease-out, border-color 0.25s ease-out;
20+
backdrop-filter: saturate(180%) blur(12px);
2121
border-bottom: 1px solid var(--line-color);
2222
position: fixed;
2323
z-index: 50;
@@ -97,10 +97,14 @@
9797
border: none;
9898
border-radius: 0.5rem;
9999
padding: 0.5rem 1rem;
100-
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
101-
transition-timing-function: ease-in-out;
102-
transition-duration: 300ms;
100+
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, transform;
101+
transition-timing-function: ease-out;
102+
transition-duration: 150ms;
103103
white-space: nowrap;
104+
105+
&:active {
106+
transform: scale(0.97);
107+
}
104108
}
105109

106110
.iconLink,
@@ -111,13 +115,18 @@
111115
margin: 0.5em;
112116
font-size: 150%;
113117
cursor: pointer;
114-
transition: color 0.1s linear;
118+
transition: color 0.15s ease, transform 0.15s ease;
115119
width: 1em;
116120
height: 1em;
117121
line-height: 1;
118122

119123
&:hover {
120124
color: var(--font-color-hover);
125+
transform: scale(1.1);
126+
}
127+
128+
&:active {
129+
transform: scale(0.95);
121130
}
122131
}
123132

src/elements/markdown.module.scss

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,38 @@
44

55
h2 {
66
margin-top: 1.5em;
7-
margin-bottom: 1em;
7+
margin-bottom: 0.75em;
8+
letter-spacing: -0.01em;
89
}
910

1011
h3 {
1112
margin-top: 1.75em;
12-
margin-bottom: 1em;
13+
margin-bottom: 0.75em;
14+
letter-spacing: -0.01em;
15+
}
16+
17+
p {
18+
margin-bottom: 1.25em;
19+
}
20+
21+
ul,
22+
ol {
23+
margin-bottom: 1.25em;
24+
25+
li {
26+
margin-bottom: 0.25em;
27+
}
1328
}
1429
}
1530

1631
.codeWrapper > code {
1732
background-color: rgb(29 31 33); // color of the theme we use for code blocks
18-
font-size: 90%;
19-
padding: 0.25em 0.5em;
33+
font-size: 87.5%;
34+
padding: 0.2em 0.45em;
2035
white-space: break-spaces !important;
21-
border-radius: 0.25em;
36+
border-radius: 0.375em;
2237
line-height: inherit !important;
38+
font-weight: 500;
2339
}
2440

2541
.linkableHeading {

src/elements/tag-selector.module.scss

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,15 @@
3434
border: none;
3535
display: inline-flex;
3636
overflow: hidden;
37-
transition: all 0.1s linear;
37+
transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
38+
39+
&:hover {
40+
transform: translateY(-1px);
41+
}
42+
43+
&:active {
44+
transform: translateY(0);
45+
}
3846

3947
.icon {
4048
--extra-size: 0.2em;

src/styles/globals.scss

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,14 @@ body {
6666
margin: 0;
6767
font-family: var(--fonts-body);
6868
color: var(--font-color);
69+
-webkit-font-smoothing: antialiased;
70+
-moz-osx-font-smoothing: grayscale;
71+
text-rendering: optimizeLegibility;
6972
}
7073

7174
body {
7275
background-color: var(--page-bg);
73-
transition: background-color linear 0.2s;
76+
transition: background-color 0.25s ease-out;
7477
line-height: 1.6;
7578

7679
// Storybook hacks
@@ -100,6 +103,12 @@ h6 {
100103
a {
101104
color: inherit;
102105
text-decoration: none;
106+
transition: color 0.15s ease;
107+
}
108+
109+
::selection {
110+
background-color: var(--accent);
111+
color: white;
103112
}
104113

105114
.rendering-pixelated {

0 commit comments

Comments
 (0)