fix: couple css improvements for webkit-based browsers

introduces a new mixin to handle webkit-based shenanigans.
also adds a mixin to make keyboard navigation easier.
and other small tweaks to css(like accent color and color scheme).
This commit is contained in:
zyachel 2022-12-31 22:10:19 +05:30
parent 57b050f196
commit 81eaf2fd5e
6 changed files with 56 additions and 2 deletions

View File

@ -78,3 +78,21 @@
background-size: 100% $height; background-size: 100% $height;
} }
} }
////////////////////////////////////////////////////////////////
// CHECK IF BROWSER IS SAFARI(it's the new IE)
////////////////////////////////////////////////////////////////
@mixin fix-for-safari {
@supports (-webkit-appearance: none) and (stroke-color: transparent) {
@content;
}
}
////////////////////////////////////////////////////////////////
//
////////////////////////////////////////////////////////////////
@mixin focus-rules {
outline: 3px solid var(--clr-highlight);
outline-offset: 0.2em;
}

View File

@ -34,7 +34,9 @@ $_light: (
transparent 70% transparent 70%
), ),
radial-gradient(at 72% 55%, hsla(344, 79%, 40%, 0.2) 0px, transparent 50%) radial-gradient(at 72% 55%, hsla(344, 79%, 40%, 0.2) 0px, transparent 50%)
) ),
// changes color of native html elemnts, either 'light' or 'dark' must be set.
scheme: light
); );
$_dark: ( $_dark: (
@ -54,6 +56,7 @@ $_dark: (
radial-gradient(at 23% 32%, hsla(344, 79%, 40%, 0.04) 0px, transparent 70%), radial-gradient(at 23% 32%, hsla(344, 79%, 40%, 0.04) 0px, transparent 70%),
radial-gradient(at 72% 55%, hsla(344, 79%, 40%, 0.05) 0px, transparent 50%), radial-gradient(at 72% 55%, hsla(344, 79%, 40%, 0.05) 0px, transparent 50%),
), ),
scheme: dark,
); );
$themes: ( $themes: (

View File

@ -9,11 +9,17 @@ body {
#__next { #__next {
display: grid; display: grid;
grid-template-rows: min-content 1fr min-content; grid-template-rows: min-content 1fr min-content;
&:has(span[role='progressbar']) {
cursor: progress;
}
} }
body { body {
color: var(--clr-text); color: var(--clr-text);
background-color: var(--clr-bg); background-color: var(--clr-bg);
color-scheme: var(--clr-scheme);
accent-color: var(--clr-fill);
} }
// restricting to 1600px width // restricting to 1600px width
@ -22,3 +28,20 @@ body {
width: min(100%, var(--max-width)); width: min(100%, var(--max-width));
margin-inline: auto; margin-inline: auto;
} }
////////////////////////////////////////////////////////
// KEYBOARD NAVIGATION
////////////////////////////////////////////////////////
:focus {
@include helper.focus-rules;
}
@supports selector(:focus-visible) {
:focus {
outline: none;
}
:focus-visible {
@include helper.focus-rules;
}
}

View File

@ -1,5 +1,5 @@
@forward './reset'; @forward './reset';
// @forward './helpers'; @forward './helpers';
@forward './root'; @forward './root';
@forward './base'; @forward './base';
@forward './fonts'; @forward './fonts';

View File

@ -24,4 +24,9 @@
@include helper.bp('bp-700') { @include helper.bp('bp-700') {
@include helper.typescale('mobile'); @include helper.typescale('mobile');
} }
// not using any external fonts on webkit because of many issues
@include helper.fix-for-safari {
--ff-accent: var(--ff-base);
}
} }

View File

@ -96,6 +96,11 @@
content: '+'; content: '+';
font-weight: bold; font-weight: bold;
} }
// fix for webkit(not including blink)
&::-webkit-details-marker {
display: none;
}
} }
&__description { &__description {