Skip to content

Commit 868ceca

Browse files
committed
Bring back box-shadow
1 parent 2fdd461 commit 868ceca

File tree

2 files changed

+22
-8
lines changed

2 files changed

+22
-8
lines changed

src/sass/site/_colors.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
--site-accent: hsl(0, 0%, 100%);
3434

3535
// https://mozilla.design/firefox/color/
36-
background: linear-gradient(to right, hsl(21, 99%, 61%) 0%, hsl(349, 100%, 62%) 100%);
36+
--site-bg: linear-gradient(to right, hsl(21, 99%, 61%) 0%, hsl(349, 100%, 62%) 100%);
3737
}
3838

3939
.mdn {
@@ -45,7 +45,7 @@
4545
--site-primary: hsla(0, 0%, 100%, .85);
4646

4747
// https://webkit.org/wp-content/themes/webkit/images/webkit.svg
48-
background: linear-gradient(to bottom, hsl(198, 71%, 53%) 0%, hsl(211, 100%, 50%) 100%);
48+
--site-bg: linear-gradient(to bottom, hsl(198, 71%, 53%) 0%, hsl(211, 100%, 50%) 100%);
4949
}
5050

5151
.whocanuse {

src/sass/site/_ctn.scss

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
position: relative;
55
padding: 2rem;
66

7-
background: v(site-bg, v(primary));
87
border-radius: v(site-radius);
98
color: v(site-primary, v(bg));
109

@@ -35,21 +34,36 @@
3534
--site-radius: 1.2rem;
3635
}
3736

38-
// Light theme shadow, visible on hover and focus
39-
37+
&::before,
4038
&::after {
41-
@include position (absolute, 0 0 0 0);
39+
@include position (absolute, 0);
4240

4341
pointer-events: none;
44-
45-
background: inherit;
4642
border-radius: v(site-radius);
43+
}
44+
45+
// Background color
46+
47+
&::before {
48+
content: '';
49+
z-index: -1;
50+
51+
background: v(site-bg, v(primary));
52+
}
53+
54+
// Light theme shadow, visible on hover and focus
55+
56+
&::after {
4757
box-shadow:
4858
hsl(0, 0%, 0%, .2) 0 .3rem 1.6rem 0,
4959
hsl(0, 0%, 0%, .08) 0 .1rem .4rem 0;
5060
opacity: 0;
5161

5262
transition: opacity .65s $out-cubic;
63+
64+
@media (--light) {
65+
content: '';
66+
}
5367
}
5468
}
5569

0 commit comments

Comments
 (0)