stdlib-js / www

Website for stdlib, a standard library for JavaScript and Node.js.
https://stdlib.io
Apache License 2.0
6 stars 8 forks source link

[Bug]: theme selection should be a dropdown/select rather than a toggle #42

Closed kgryte closed 2 years ago

kgryte commented 2 years ago

Description

The current theme selection UI does not accommodate future theme extensions, such as high contrast, in order to accommodate web accessibility needs.

Currently, the choice is binary, but we're likely to want at least three choices.

Screen Shot 2021-10-02 at 1 17 26 PM

Related Issues

None.

Questions

No.

Demo

No response

Reproduction

-   open settings menu.

Expected Results

-   UI element which accommodates more than 2 options.

Actual Results

-    UI element which only accommodates 2 options.

Environments

Firefox, Chrome, Safari, Microsoft Edge, Internet Explorer, Other Browser

Browser Version

No response

Node.js / npm Version

No response

Platform

No response

Checklist

Planeshifter commented 2 years ago

While there could be other reasons to not use the MUI <ToggleButton />, the component does easily accommodate more than two options. See their documentation for various examples.

kgryte commented 2 years ago

IMO, a toggle button group is still the wrong abstraction here. Say we have 10 different themes; presenting what effectively amounts to a radio button UI pattern would be unorthodox, at best, and generally unexpected.

We're unlikely to have minimal button icons representing the themes, so cannot readily follow the examples in the docs for text justification. The most compact and expected UI pattern would be a dropdown.

kgryte commented 2 years ago

This has now been updated to a dropdown.

Screen Shot 2022-05-13 at 5 36 57 PM

Screen Shot 2022-05-13 at 5 36 49 PM