From f609aaba0c9a7c4d3c3d579a2a0021ecd5fc4028 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Wed, 21 Feb 2024 13:10:11 +0200 Subject: [PATCH] improve checkbox styles --- src/components/checkbox/checkbox.vue | 5 ++--- src/components/font_control/font_control.vue | 2 +- src/components/input.style.js | 10 ++++++++++ src/components/poll/poll.vue | 4 ++-- src/components/range_input/range_input.vue | 2 +- src/components/shadow_control/shadow_control.vue | 2 +- src/services/theme_data/theme2_to_theme3.js | 10 +++++----- 7 files changed, 22 insertions(+), 13 deletions(-) diff --git a/src/components/checkbox/checkbox.vue b/src/components/checkbox/checkbox.vue index 9739c08b17..eac7919904 100644 --- a/src/components/checkbox/checkbox.vue +++ b/src/components/checkbox/checkbox.vue @@ -12,7 +12,7 @@ @change="$emit('update:modelValue', $event.target.checked)" > @@ -82,8 +82,7 @@ export default { transition: color 200ms; width: 1.1em; height: 1.1em; - border-radius: $fallback--checkboxRadius; - border-radius: var(--checkboxRadius, $fallback--checkboxRadius); + border-radius: var(--roundness); box-shadow: var(--shadow); background-color: var(--background); vertical-align: top; diff --git a/src/components/font_control/font_control.vue b/src/components/font_control/font_control.vue index b90fba5648..d5e6357897 100644 --- a/src/components/font_control/font_control.vue +++ b/src/components/font_control/font_control.vue @@ -14,7 +14,7 @@ v-if="typeof fallback !== 'undefined'" :id="name + '-o'" :aria-labelledby="name + '-label'" - class="input opt exlcude-disabled visible-for-screenreader-only" + class="input -checkbox opt exlcude-disabled visible-for-screenreader-only" type="checkbox" :checked="present" @change="$emit('update:modelValue', typeof modelValue === 'undefined' ? fallback : undefined)" diff --git a/src/components/input.style.js b/src/components/input.style.js index 985d54120e..b1c9f3db34 100644 --- a/src/components/input.style.js +++ b/src/components/input.style.js @@ -12,6 +12,10 @@ const hoverGlow = { export default { name: 'Input', selector: '.input', + variant: { + checkbox: '.-checkbox', + radio: '.-radio' + }, states: { disabled: ':disabled', hover: ':hover:not(:disabled)', @@ -21,6 +25,12 @@ export default { 'Text' ], defaultRules: [ + { + variant: 'checkbox', + directives: { + roundness: 1 + } + }, { directives: { background: '--fg, -5', diff --git a/src/components/poll/poll.vue b/src/components/poll/poll.vue index 087822e1f9..57ec879a55 100644 --- a/src/components/poll/poll.vue +++ b/src/components/poll/poll.vue @@ -43,7 +43,7 @@ @@ -52,7 +52,7 @@ type="radio" :disabled="loading" :value="index" - class="input" + class="input -radio" >