I also spent quite some time building desktop and mobile apps (5, maybe 6 years) and also more than 10 years of building web apps and don’t really share this sentiment.
My feeling is exactly opposite. CSS is messy and hacky way to build layouts (the famous “how to center a div”, etc.) while with UI toolkits it tends to be much more straightforward and standardized.
When is the last time you used CSS? "How to center a div" has not been an issue with CSS for many, many years. Flexbox and now CSS Grid have overwhelming adoption and most layouts can be achieved with a few lines of CSS.
> When is the last time you used CSS? "How to center a div" has not been an issue with CSS for many, many years. Flexbox and now CSS Grid have overwhelming adoption and most layouts can be achieved with a few lines of CSS.
The html-apps-as-a-local-app (like electron-based stuff) became popular prior to "how to centre a div" was answered.
IOW, they became popular in spite of having shitty layouts specifications.
Before flex and grid CSS had most complex, least friendly and (probably) least powerful layout definition system compared to everything I knew. Creating unecessary elements just to trigger primitive CSS mechanisms was commonplace as was having >3 methods to do some primitive layout task (like centering) depending on where that task was needed. Tables were popular so long because you could do 80% of what CSS could do while knowing <10% of what was needed to do layout without them.
After flex and grid it is just most complex and least friendly. You still need to know all the gotchas if you work with legacy projects or with imported components, but at least there are some sane ways to do basic layout tasks.
For me still nothing beats Adobe Flex when it comes to layout. Without much experience I could easily create UI that looked and behaved good without any resizing problems (although as I remember mobile phones were never supported).
Adobe Flex is one of those things that while I really enjoyed it, Adobe just isn't a good steward of projects/products like it. I do wonder what it would be like if some other large tech company either invented, or took it over.
Flex could be used on mobile through Adobe AIR, but it was slow, and felt all kinds of wrong. This was one of the downsides to Flex, too, in my experience.
I think you're not giving credit to the best part about the web: CSS.
I've been programming GUIs with Java AWT, Swing, and Qt for years. Nothing comes close to CSS when it comes to defining layouts.