khang-nd / 7.css

A JS-independent, tree-shakeable CSS framework for building faithful recreations of the Windows 7 UI.
https://khang-nd.github.io/7.css/
MIT License
1.57k stars 80 forks source link

[Dropdown] Inconsistent appearance #80

Open hohaicongthuan opened 10 months ago

hohaicongthuan commented 10 months ago

The visual appearance of the dropdown varies a lot across different OSes and browsers. Here are some examples:

OS \ Browser Image OS \ Browser Image
Windows 7's dropdown dropdown menu reference Windows 11 | Brave Win11_Brave
Windows 10 | Brave Win10_Brave Linux (Kubuntu) | Brave Kubuntu_Brave
Windows 10 | Edge Win10_Edge Windows 10 | Firefox Win10_Firefox

(There's more but you get the idea)

khang-nd commented 10 months ago

This is due to the fact that the dropdown component is merely styling the browser's default select element. To achieve a consistent cross-browser dropdown box, we'd probably need to make a pseudo dropdown element and utilize some sort of CSS combinators (e.g. > or +). Also, I reckon it would still be useful to keep the select element support for simplicity or as a fallback behavior.

wll8 commented 9 months ago

https://github.com/necolas/normalize.css

Will the problem be alleviated if normalize is used?

khang-nd commented 9 months ago

@wll8 Unlikely, the main concern is the dropdown box's appearance e.g the borders, shape, shadow, background color... being not consistent, and normalize.css only helps standardize the fonts (line 163-168) and doesn't touch any of the aforementioned properties.

With my limited CSS knowledge, I don't think there's an easy way to address these properties of a native select element, best I might do is as I commented above.

liam-mills commented 2 months ago

Hi @khang-nd,

Just wanted to make you aware of the selectlist (previously selectmenu) proposal by Open UI. As it's still in a proposal state it isn't supported on any browsers currently (with the exception of Chrome under an experimental flag). But if this proposal becomes standard then we could aim to style the dropdown menu accordingly with the Windows 7 format; fingers crossed.

For your reading:

https://open-ui.org/components/selectlist/ https://caniuse.com/?search=selectlist https://css-tricks.com/the-selectmenu-element/

Cheers.