fix: use ASCII characters for operator icons to support dark mode

Replace emoji operator icons (  ✖️ ) with ASCII characters
(+ − × ÷) that properly inherit font colors in dark mode.

Changes:
- Update SETTING_ICONS to use ASCII: +, −, ×, ÷, ±
- Update TabNavigation operator icon function to match
- Change styling check from isPlusMinus to isOperatorSymbol
- All operator symbols now display correctly in light and dark modes

Fixes issue where emoji operators stayed dark in dark mode because
they don't inherit text color properties.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Thomas Hallock 2025-11-12 18:06:22 -06:00
parent 0a0f7878c5
commit 3bd5c00d21
2 changed files with 10 additions and 9 deletions

View File

@ -15,8 +15,8 @@ export const TABS: Tab[] = [
label: 'Operator',
icon: (operator) => {
if (operator === 'mixed') return '±'
if (operator === 'subtraction') return ''
return ''
if (operator === 'subtraction') return ''
return '+'
},
},
{ id: 'layout', label: 'Layout', icon: '📐' },
@ -52,7 +52,8 @@ export function TabNavigation({ activeTab, onChange, operator }: TabNavigationPr
>
{TABS.map((tab) => {
const icon = getTabIcon(tab)
const isPlusMinus = icon === '±'
// All operator symbols (+, , ±) are ASCII characters that need larger font size
const isOperatorSymbol = tab.id === 'operator'
return (
<button
@ -100,8 +101,8 @@ export function TabNavigation({ activeTab, onChange, operator }: TabNavigationPr
>
<span
className={css({
fontSize: isPlusMinus ? 'lg' : undefined,
fontWeight: isPlusMinus ? 'bold' : undefined,
fontSize: isOperatorSymbol ? 'lg' : undefined,
fontWeight: isOperatorSymbol ? 'bold' : undefined,
})}
>
{icon}

View File

@ -5,10 +5,10 @@ import type { WorksheetFormState } from '../types'
*/
export const SETTING_ICONS = {
operator: {
addition: '',
subtraction: '',
multiplication: '✖️',
division: '',
addition: '+',
subtraction: '',
multiplication: '×',
division: '÷',
mixed: '±',
},
difficulty: {