mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-14 01:37:26 +00:00
Add focus effects to inputs
Provides better keyboard accessibility for: * Checkboxes * Range Inputs * Copy-over Buttons * Option-reveal Elements Along with some minor design improvements
This commit is contained in:
@@ -2,6 +2,26 @@
|
|||||||
display: inline-block;
|
display: inline-block;
|
||||||
position: relative;
|
position: relative;
|
||||||
--size: 17px;
|
--size: 17px;
|
||||||
|
|
||||||
|
&::before {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
width: 200%;
|
||||||
|
height: 200%;
|
||||||
|
background-color: var(--main-theme-color);
|
||||||
|
border-radius: 999px;
|
||||||
|
opacity: 0.25;
|
||||||
|
|
||||||
|
transform: translate(-50%, -50%) scale(0);
|
||||||
|
transition-property: transform;
|
||||||
|
transition-duration: 250ms;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:focus-within::before {
|
||||||
|
transform: translate(-50%, -50%) scale(1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.real-checkbox {
|
.real-checkbox {
|
||||||
|
|||||||
@@ -47,6 +47,10 @@ range-input::before {
|
|||||||
height: 12px;
|
height: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
range-input:focus-within .thumb {
|
||||||
|
outline: white solid 2px;
|
||||||
|
}
|
||||||
|
|
||||||
.thumb-wrapper {
|
.thumb-wrapper {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 6px;
|
left: 6px;
|
||||||
|
|||||||
@@ -11,6 +11,10 @@
|
|||||||
padding: 3px calc(var(--thumb-size) / 2 + 3px);
|
padding: 3px calc(var(--thumb-size) / 2 + 3px);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.checkbox:focus-within .track {
|
||||||
|
outline: white solid 2px;
|
||||||
|
}
|
||||||
|
|
||||||
.thumb {
|
.thumb {
|
||||||
position: relative;
|
position: relative;
|
||||||
width: var(--thumb-size);
|
width: var(--thumb-size);
|
||||||
|
|||||||
@@ -53,6 +53,16 @@
|
|||||||
composes: option-toggle;
|
composes: option-toggle;
|
||||||
grid-template-columns: auto 1fr;
|
grid-template-columns: auto 1fr;
|
||||||
gap: 1em;
|
gap: 1em;
|
||||||
|
|
||||||
|
border-top: 1px solid #fff4;
|
||||||
|
|
||||||
|
transition-property: background-color;
|
||||||
|
transition-duration: 250ms;
|
||||||
|
}
|
||||||
|
|
||||||
|
.option-reveal:focus-within,
|
||||||
|
.option-reveal:hover {
|
||||||
|
background-color: #fff2;
|
||||||
}
|
}
|
||||||
|
|
||||||
.option-one-cell {
|
.option-one-cell {
|
||||||
@@ -118,6 +128,11 @@
|
|||||||
svg {
|
svg {
|
||||||
fill: var(--header-text-color);
|
fill: var(--header-text-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&:focus {
|
||||||
|
outline: var(--header-text-color) solid 2px;
|
||||||
|
outline-offset: 0.25em;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.save-button,
|
.save-button,
|
||||||
|
|||||||
Reference in New Issue
Block a user