Skip to content

Commit b172e58

Browse files
author
ciiay
committed
Add @supports to make sure new features fit into multiple browsers.
1 parent 4d221e6 commit b172e58

File tree

5 files changed

+50
-20
lines changed

5 files changed

+50
-20
lines changed

css/style.css

+24-11
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,7 @@ body {
328328
position: absolute;
329329
top: 0;
330330
left: 0;
331+
-webkit-backface-visibility: hidden;
331332
backface-visibility: hidden;
332333
width: 100%;
333334
border-radius: 3px;
@@ -461,13 +462,17 @@ body {
461462
height: 15rem;
462463
width: 15rem;
463464
float: left;
464-
-webkit-shape-outside: circle(50% at 50% 50%);
465-
shape-outside: circle(50% at 50% 50%);
466-
-webkit-clip-path: circle(50% at 50% 50%);
467-
clip-path: circle(50% at 50% 50%);
468465
transform: translateX(-3rem) skewX(12deg);
469466
position: relative;
470-
overflow: hidden; }
467+
overflow: hidden;
468+
border-radius: 50%; }
469+
@supports (clip-path: polygon(0 0)) or (-webkit-clip-path: polygon(0 0)) {
470+
.story__shape {
471+
-webkit-clip-path: circle(50% at 50% 50%);
472+
clip-path: circle(50% at 50% 50%);
473+
-webkit-shape-outside: circle(50% at 50% 50%);
474+
shape-outside: circle(50% at 50% 50%);
475+
border-radius: none; } }
471476
@media (max-width: 37.5em) {
472477
.story__shape {
473478
transform: translateX(-3rem) skewX(0); } }
@@ -608,6 +613,11 @@ body {
608613
opacity: 0;
609614
visibility: hidden;
610615
transition: all .3s; }
616+
@supports (-webkit-backdrop-filter: blur(10px)) or (backdrop-filter: blur(10px)) {
617+
.popup {
618+
-webkit-backdrop-filter: blur(10px);
619+
backdrop-filter: blur(10px);
620+
background-color: rgba(51, 51, 51, 0.3); } }
611621
.popup__content {
612622
position: absolute;
613623
top: 50%;
@@ -829,16 +839,19 @@ body {
829839
transform: rotate(-135deg); }
830840

831841
.header {
832-
height: 95vh;
842+
height: 85vh;
833843
background-image: linear-gradient(to right bottom, rgba(126, 213, 111, 0.8), rgba(40, 180, 133, 0.8)), url(../img/hero-small.jpg);
834844
background-size: cover;
835845
background-position: top;
836-
position: relative;
837-
-webkit-clip-path: polygon(0 0, 100% 0, 100% 75vh, 0 100%);
838-
clip-path: polygon(0 0, 100% 0, 100% 75vh, 0 100%); }
839-
@media (min-resolution: 192dpi) and (min-width: 37.5em), (min-width: 125em) {
846+
position: relative; }
847+
@supports (clip-path: polygon(0 0)) or (-webkit-clip-path: polygon(0 0)) {
848+
.header {
849+
-webkit-clip-path: polygon(0 0, 100% 0, 100% 75vh, 0 100%);
850+
clip-path: polygon(0 0, 100% 0, 100% 75vh, 0 100%);
851+
height: 95vh; } }
852+
@media (min-resolution: 192dpi) and (min-width: 37.5em), (-webkit-min-device-pixel-ratio: 2) and (min-width: 37.5em), (min-width: 125em) {
840853
.header {
841-
background-image: linear-gradient(to right bottom, rgba(255, 185, 0, 0.8), rgba(255, 119, 48, 0.8)), url(../img/hero.jpg); } }
854+
background-image: linear-gradient(to right bottom, rgba(126, 213, 111, 0.8), rgba(40, 180, 133, 0.8)), url(../img/hero.jpg); } }
842855
@media (max-width: 37.5em) {
843856
.header {
844857
-webkit-clip-path: polygon(0 0, 100% 0, 100% 85vh, 0 100%);

sass/components/_card.scss

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
position: absolute;
1414
top: 0;
1515
left: 0;
16+
-webkit-backface-visibility: hidden;
1617
backface-visibility: hidden;
1718
width: 100%;
1819
border-radius: $border-radius-3;

sass/components/_popup.scss

+6
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@
1212
visibility: hidden;
1313
transition: all .3s;
1414

15+
@supports (-webkit-backdrop-filter: blur(10px)) or (backdrop-filter: blur(10px)) {
16+
-webkit-backdrop-filter: blur(10px);
17+
backdrop-filter: blur(10px);
18+
background-color: rgba($color-grey-dark-3, .3);
19+
}
20+
1521
&__content {
1622

1723
@include center;

sass/components/_story.scss

+9-4
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,18 @@
2323
height: 15rem;
2424
width: 15rem;
2525
float: left;
26-
-webkit-shape-outside: circle(50% at 50% 50%);
27-
shape-outside: circle(50% at 50% 50%);
28-
-webkit-clip-path: circle(50% at 50% 50%);
29-
clip-path: circle(50% at 50% 50%);
3026
transform: translateX(-3rem) skewX(12deg);
3127
position: relative;
3228
overflow: hidden;
29+
border-radius: 50%;
30+
31+
@supports (clip-path: polygon(0 0)) or (-webkit-clip-path: polygon(0 0)) {
32+
-webkit-clip-path: circle(50% at 50% 50%);
33+
clip-path: circle(50% at 50% 50%);
34+
-webkit-shape-outside: circle(50% at 50% 50%);
35+
shape-outside: circle(50% at 50% 50%);
36+
border-radius: none;
37+
}
3338

3439
@include respond(phone) {
3540
transform: translateX(-3rem) skewX(0);

sass/layout/_header.scss

+10-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.header {
2-
height: 95vh;
2+
height: 85vh;
33
background-image: linear-gradient(
44
to right bottom,
55
rgba($color-primary-light, 0.8),
@@ -8,15 +8,20 @@
88
background-size: cover;
99
background-position: top;
1010
position: relative;
11-
-webkit-clip-path: polygon(0 0, 100% 0, 100% 75vh, 0 100%);
12-
clip-path: polygon(0 0, 100% 0, 100% 75vh, 0 100%);
11+
12+
@supports (clip-path: polygon(0 0)) or (-webkit-clip-path: polygon(0 0)) {
13+
-webkit-clip-path: polygon(0 0, 100% 0, 100% 75vh, 0 100%);
14+
clip-path: polygon(0 0, 100% 0, 100% 75vh, 0 100%);
15+
height: 95vh;
16+
}
1317

1418
@media (min-resolution: 192dpi) and (min-width: 37.5em),
19+
(-webkit-min-device-pixel-ratio: 2) and (min-width: 37.5em),
1520
(min-width: 125em) {
1621
background-image: linear-gradient(
1722
to right bottom,
18-
rgba($color-secondary-light, 0.8),
19-
rgba($color-secondary-dark, 0.8)),
23+
rgba($color-primary-light, 0.8),
24+
rgba($color-primary-dark, 0.8)),
2025
url(../img/hero.jpg);
2126
}
2227

0 commit comments

Comments
 (0)