Fix styling on Safari

This commit is contained in:
Tusooa Zhu 2022-01-19 21:18:02 -05:00 committed by HJ
parent 97951fccfd
commit 11672bc490
6 changed files with 57 additions and 28 deletions

17
src/_mixins.scss Normal file
View File

@ -0,0 +1,17 @@
@mixin unfocused-style {
@content;
&:focus:not(:focus-visible):not(:hover) {
@content;
}
}
@mixin focused-style {
&:hover, &:focus {
@content;
}
&:focus-visible {
@content;
}
}

View File

@ -151,6 +151,7 @@
<style lang="scss"> <style lang="scss">
@import '../../_variables.scss'; @import '../../_variables.scss';
@import '../../_mixins.scss';
.ExtraButtons { .ExtraButtons {
/* override of popover internal stuff */ /* override of popover internal stuff */
@ -168,12 +169,13 @@
color: var(--text, $fallback--text); color: var(--text, $fallback--text);
} }
.focus-marker, @include unfocused-style {
&:focus:not(:focus-visible):not(:hover) .focus-marker { .focus-marker {
visibility: hidden; visibility: hidden;
}
} }
&:hover, &:focus, &:focus-visible { @include focused-style {
.focus-marker { .focus-marker {
visibility: visible; visibility: visible;
} }

View File

@ -53,6 +53,7 @@
<style lang="scss"> <style lang="scss">
@import '../../_variables.scss'; @import '../../_variables.scss';
@import '../../_mixins.scss';
.FavoriteButton { .FavoriteButton {
display: flex; display: flex;
@ -78,19 +79,21 @@
color: var(--cOrange, $fallback--cOrange); color: var(--cOrange, $fallback--cOrange);
} }
.focus-marker, @include unfocused-style {
&:focus:not(:focus-visible):not(:hover) .focus-marker { .focus-marker {
visibility: hidden; visibility: hidden;
}
.active-marker {
visibility: visible;
}
} }
&:focus:not(:focus-visible):not(:hover) .active-marker { @include focused-style {
visibility: visible;
}
&:hover, &:focus, &:focus-visible {
.focus-marker { .focus-marker {
visibility: visible; visibility: visible;
} }
.active-marker { .active-marker {
visibility: hidden; visibility: hidden;
} }

View File

@ -74,6 +74,7 @@
<style lang="scss"> <style lang="scss">
@import '../../_variables.scss'; @import '../../_variables.scss';
@import '../../_mixins.scss';
.ReactButton { .ReactButton {
.reaction-picker-filter { .reaction-picker-filter {
@ -141,12 +142,13 @@
color: var(--text, $fallback--text); color: var(--text, $fallback--text);
} }
.focus-marker, @include unfocused-style {
&:focus:not(:focus-visible):not(:hover) .focus-marker { .focus-marker {
visibility: hidden; visibility: hidden;
}
} }
&:hover, &:focus, &:focus-visible { @include focused-style {
.focus-marker { .focus-marker {
visibility: visible; visibility: visible;
} }

View File

@ -46,6 +46,7 @@
<style lang="scss"> <style lang="scss">
@import '../../_variables.scss'; @import '../../_variables.scss';
@import '../../_mixins.scss';
.ReplyButton { .ReplyButton {
display: flex; display: flex;
@ -67,12 +68,13 @@
color: var(--cBlue, $fallback--cBlue); color: var(--cBlue, $fallback--cBlue);
} }
.focus-marker, @include unfocused-style {
&:focus:not(:focus-visible):not(:hover) .focus-marker { .focus-marker {
visibility: hidden; visibility: hidden;
}
} }
&:hover, &:focus, &:focus-visible { @include focused-style {
.focus-marker { .focus-marker {
visibility: visible; visibility: visible;
} }

View File

@ -60,6 +60,7 @@
<style lang="scss"> <style lang="scss">
@import '../../_variables.scss'; @import '../../_variables.scss';
@import '../../_mixins.scss';
.RetweetButton { .RetweetButton {
display: flex; display: flex;
@ -85,19 +86,21 @@
color: var(--cGreen, $fallback--cGreen); color: var(--cGreen, $fallback--cGreen);
} }
.focus-marker, @include unfocused-style {
&:focus:not(:focus-visible):not(:hover) .focus-marker { .focus-marker {
visibility: hidden; visibility: hidden;
}
.active-marker {
visibility: visible;
}
} }
&:focus:not(:focus-visible):not(:hover) .active-marker { @include focused-style {
visibility: visible;
}
&:hover, &:focus, &:focus-visible {
.focus-marker { .focus-marker {
visibility: visible; visibility: visible;
} }
.active-marker { .active-marker {
visibility: hidden; visibility: hidden;
} }