Skip to content

Revisit Konsta UI integration — layout conflicts with existing styling #336

@hessius

Description

@hessius

Context

The Konsta UI v5 adaptive component layer was added in v2.4.0 (6226a79) to provide native iOS/Material look on mobile viewports. While the integration is architecturally complete, it causes layout conflicts with the existing Tailwind CSS v4 + Radix/shadcn styling that make it unusable in its current state.

What was tried

  1. Scoped CSS isolation — Added a konsta-active class on <html> to scope base styles (border utilities, font, letter-spacing, border-radius) so they don't conflict with Konsta's own resets.
  2. Platform theme "none" bypass — Made useKonstaOverride() respect "Standard" theme selection to fully disable Konsta rendering regardless of viewport width.
  3. Cross-component event system — Added konsta-ui-changed custom event so all adaptive components re-evaluate immediately when the user toggles settings.

Despite these fixes, visual conflicts remain — Konsta's global CSS (konsta/react/theme.css) and component styles clash with the oklch color system, custom button classes, and ambient blob styling.

Current state (temporarily disabled)

All Konsta code is preserved but disabled:

  • useKonstaOverride() in apps/web/src/hooks/useKonstaOverride.ts — always returns false (original logic preserved in comments)
  • Platform theme dropdown and Konsta UI toggle in SettingsView.tsx — commented out
  • Select, useKonstaToggle imports in SettingsView — commented out
  • 10 adaptive UI components (button, card, checkbox, switch, slider, input, progress, select, tabs, dialog) — dormant, all gated behind useKonstaOverride() which returns false
  • KonstaApp wrapper in App.tsx — conditional on useKonsta, effectively dead code
  • konsta/react/theme.css import in index.css — still present but harmless (only sets unused --k-color-* variables)
  • .konsta-active scoping rules in index.css — present but class is never applied

To re-enable

  1. Restore useKonstaOverride() logic (uncomment the original implementation)
  2. Uncomment Settings UI in SettingsView.tsx (platform theme dropdown + Konsta toggle)
  3. Uncomment the Select and useKonstaToggle imports
  4. Address root CSS conflicts — likely needs a more thorough isolation strategy (Shadow DOM, CSS layers, or stripping Konsta's global reset)

Key files

  • apps/web/src/hooks/useKonstaOverride.ts — master gate
  • apps/web/src/hooks/usePlatformTheme.ts — theme selection + event dispatch
  • apps/web/src/App.tsxKonstaApp wrapper + konsta-active class toggle
  • apps/web/src/index.css — CSS scoping rules + Konsta theme import
  • apps/web/src/components/SettingsView.tsx — hidden UI controls
  • apps/web/src/components/ui/*.tsx — adaptive component wrappers

Labels

Enhancement / deferred

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions