Skip to content

Commit 026ddf6

Browse files
committed
fix mix blend mode issues in light mode
1 parent e213c33 commit 026ddf6

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

tbx/static_src/sass/components/_animated-icon.scss

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,24 @@
6262
position: absolute;
6363
width: 44px;
6464
height: 44px;
65-
mix-blend-mode: screen;
6665
left: 18px;
6766
top: 15px;
6867
transition: height $transition;
6968

7069
@include reduced-motion() {
7170
transition: none;
7271
}
72+
73+
.mode-dark & {
74+
mix-blend-mode: screen;
75+
}
76+
77+
// Mix blend mode doesn't work well for light mode
78+
// so emulate it with opacity and z-index
79+
.mode-light & {
80+
z-index: -1;
81+
opacity: 0.5;
82+
}
7383
}
7484

7585
#{$root}__top-beak {
@@ -199,7 +209,16 @@
199209
transform: scale(1);
200210
transition: transform $transition;
201211
transform-origin: 5px 20px;
202-
z-index: -1;
212+
213+
.mode-dark & {
214+
mix-blend-mode: screen;
215+
}
216+
217+
// Mix blend mode doesn't work well for light mode
218+
// so emulate it with z-index
219+
.mode-light & {
220+
z-index: -1;
221+
}
203222

204223
@include reduced-motion() {
205224
transition: none;
@@ -213,7 +232,6 @@
213232
transform: rotate(0);
214233
transition: transform $transition;
215234
transform-origin: 30px 60px;
216-
mix-blend-mode: screen;
217235

218236
@include reduced-motion() {
219237
transition: none;

0 commit comments

Comments
 (0)