Skip to content

demo: not responsive on mobile, and the page chrome ignores the theme toggle #39

Description

@sidgaikwad

Two separate problems in demo/src/styles.css.

1. Not responsive — the file contains no @media query at all

.sidebar is a hard width: 240px; flex-shrink: 0, and .body is a plain row flexbox. On a phone that leaves the editor roughly 135px wide next to a sidebar that can't shrink. .preview is also a fixed width: 320px pinned to the bottom-right, which overlaps most of a small viewport.

The sidebar toggle in the top bar helps, but it defaults to open (useState(true) in App.tsx), so the first paint on mobile is the broken one.

Worth adding a breakpoint that collapses the sidebar by default (or overlays it) below ~768px, and lets .preview go full-width.

2. The page chrome ignores the theme toggle

The demo has a Light/Dark selector that drives options.theme, but the surrounding page is hardcoded:

  • html, body, #root are hardcoded light (background: #fff, color-scheme: light)
  • .topbar and .sidebar are hardcoded dark (#16181d, color-scheme: dark)
  • .preview card is hardcoded white

So switching the editor to dark produces a dark editor inside light page chrome, and switching to light still leaves a permanently dark sidebar and top bar. Since the demo is the thing people look at to decide whether the theming works, it currently undersells it.

Driving the demo's own palette off the same theme state (CSS custom properties + a data-theme attribute on <html>) would make the toggle actually demonstrate something.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions