← Back to context

Comment by Pxtl

4 years ago

Making resolution-agnostic applications in C# Winforms wasn't hard, it was a simple flag to tell the OS how to scale the GUI. And if you used the native widgets and set tab-indexes you'd be all set for changing sizes, blind users, OS re-theming, etc. A good UI framework should handle that stuff internally... even a bad one should do that (bad, like how winforms set the wrong default font).

Imho, the real reason we don't see stuff like this for the Web is that the web isn't designed for modularity. CSS, Javascript, and HTML IDs are all global.

Programming 101 lesson 1 is "don't use globals" and the Web is the perfect object-lesson in why not.

CSS - Yes. JS - Not since 2015, I'll admit that is somewhat recent. HTML IDs - IDs are only good if they're unique. Since HTML had no notion of scope, they became global. Shadow DOM is the web platform answer for modularization, however any JS framework will allow you to slice your CSS and HTML in components.

> if you used the native widgets and set tab-indexes you'd be all set for changing sizes, blind users, OS re-theming, etc

> Imho, the real reason we don't see stuff like this for the Web

Where are you looking on the web? tab-indexes and extending native web components gives you responsiveness and accessibility. The browsers provide theming capabilities for light and dark mode, and OS level color preferences (I use "red" for selected on Mac) easily show themselves on CSS `outline` etc

> Globals

No one uses globals on the web. This isn't 2000, or even 2013.