fix: improve a11y, move preview box inside label (#997)

This commit is contained in:
Nolan Lawson 2019-02-15 19:03:24 -08:00 committed by GitHub
parent 25aea9f30a
commit 59544d2cf4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -10,11 +10,13 @@
<input type="radio" id="choice-theme-{theme.name}"
value={theme.name} checked="$currentTheme === theme.name"
bind:group="selectedTheme" on:change="onThemeChange()">
<label class="theme-picker-label" for="choice-theme-{theme.name}">
<div class="theme-preview theme-preview-{themeGroup.dark ? 'dark' : 'light'}"
style="background-color: {theme.color};" >
</div>
<label class="theme-picker-label" for="choice-theme-{theme.name}">
<span class="theme-picker-label-span">
{theme.label} {theme.name === DEFAULT_THEME ? '(default)' : ''}
</span>
</label>
</div>
{/each}
@ -43,15 +45,18 @@
}
.theme-picker {
display: flex;
flex-direction: row;
align-items: center;
}
.theme-picker-label {
display: flex;
align-items: center;
}
.theme-picker-label-span {
margin: 2px 10px 0;
}
.theme-preview {
width: 1.5em;
height: 1.5em;
width: 21px;
height: 21px;
box-sizing: border-box;
border-radius: 2px;
margin: 0 2px 0 10px;