Rust/JavaScript/WebAssembly and dynamical stylesheet

I known styling page with programming language supporting imperative paradigm could be harder to debug and made more match your needs, but it will be quite more complex.

We could select any language, which support DOM model. To load dynamic stylesheet, page must switch to special mode, which increase user security (JavaScript couldn’t read page style in this mode - something like you do with css/fonts, so javascript’s script couldn’t read some css properties). I think behavior part of page couldn’t read style property for example.

Also, dynamic style (Script) will not connect via internet or write something different than style property of element. It still may create variables, but visible only on it’s own scope. It may also read any JavaScript variable - maybe add special interface for this.

Why? Many people disables scripts to protect themselves, but web developers need JavaScript to control page look&feel. Currently, many pages not load, when JavaScript is disabled.

This solution could satisfy webdevelopers and users. Developers could bind JS event like Scroll to deliver nice scroll effects. I know, that this solution is bad in many cases, but it will solves many problems. It’s better to disallow user to see a web page, cause he/she has disables scripts.

I’m very old fashioned and write CSS by hand for my little pages. I understand that complex applications have different requirements.

I was raised with the idea of graceful degradation and/or progressive enhancement, and I personally use NoScript, so I strive to make as much content as possible available even when scripting is disabled.

Each application/site has its own needs, of course, but I don’t think the browser should make the decision to exclude users from seeing what they can see if they decide to disable JavaScript on a page.