Skip to content

Commit

Permalink
fix(configsMenu): improve color picker accessibility and styling
Browse files Browse the repository at this point in the history
- Update color picker input to be more accessible by associating it with a label
- Refine color picker query selection method for better compatibility
- Adjust CSS to ensure consistent styling across different environments
  • Loading branch information
mustakshif committed Oct 13, 2024
1 parent bd276c9 commit 63ec80a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/modules/configsMenu/makeItems.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ function createMenuItems() {
const asriConfigMenuHTML = `
<button class="b3-menu__separator asri-config"></button>
<button class="b3-menu__item asri-config" id="pickColor">
<input id="asriColorPicker" type="color" value="${asriConfigs.userCustomColor}">
<svg class="b3-menu__icon"></svg>
<label for="asriColorPicker" class="be-menu__label">${i18n['pickColor']}</label>
<input id="asriColorPicker" type="color" value="${asriConfigs.userCustomColor}">
<label for="asriColorPicker" class="be-menu__label">${i18n['pickColor']}</label>
</button>
<button class="b3-menu__item asri-config" id="followSysAccent">
<svg class="b3-menu__icon"></svg>
Expand All @@ -140,7 +140,7 @@ function createMenuItems() {
followSysAccentBtn = document.getElementById('followSysAccent');
pickColorBtn = document.getElementById('pickColor');
asriChromaSlider = document.getElementById('asriChromaSlider') as HTMLInputElement | null;
colorPicker = pickColorBtn!.lastElementChild as HTMLInputElement | null;
colorPicker = pickColorBtn!.querySelector('input') as HTMLInputElement | null;

if (!followSysAccentBtn || !pickColorBtn || !asriChromaSlider || !colorPicker) return;

Expand Down
2 changes: 1 addition & 1 deletion style/features/colorful-asri.scss
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@
}
}

.body-asri--iosApp #pickColor {
body:where(.body-asri--iosApp) #pickColor {
svg {
display: none;
}
Expand Down
2 changes: 1 addition & 1 deletion theme.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion theme.js

Large diffs are not rendered by default.

0 comments on commit 63ec80a

Please sign in to comment.