DEV Community

Discussion on: UI Layout: Natural versus dependent size

Collapse
 
johannesvollmer profile image
Johannes Vollmer

I think absolute sizes are not suited for layout at all. Allowing only relative sizes simplifies responsive design and encourages the use of layout constructs instead of hard coded dimensions.

Collapse
 
mortoray profile image
edA‑qa mort‑ora‑y

Absolute sizes make sense for laying out things like icons, title bars, profile images, etc. These are things that have an expected size, and aren't expected to get bigger as the device gets bigger. A responsive display should handle other layouts, but as more space becomes available more content should be shown.

For example, you might have a chat bubble that shows a fixed size image (using points), but has a responsive size for the text content.

Or you may have a title bar with fixed icons on both sides, a fixed overall height, but the title text is centered in the remaining space. You wouldn't expect the icons to get bigger with larger screens, or for the title bar height to increase, only that the text remains centered.

Collapse
 
johannesvollmer profile image
Johannes Vollmer

Absolute sizes may make sense for title bars, but do title bars make sense? :P

Collapse
 
nestedsoftware profile image
Nested Software • Edited

This is probably a reasonable idea if you're developing an application, but I would say it's not reasonable if you're making a UI framework. You can be opinionated about your own specific app. But if you're making a framework, and a person using that framework has what they consider to be a valid use-case for absolute sizes, then they won't use your framework if you don't have some way to support what they want.

In general, a framework always has to find some kind of balance between the philosophy of the framework author and the demands of the actual users. I suspect making this work well is not easy in practice: If you're not opinionated enough, you create a kind of kitchen sink of technology that becomes messy and unpleasant to use; if you're too opinionated, you turn people off by telling them "sorry, I know better than you what you need."

Collapse
 
mortoray profile image
edA‑qa mort‑ora‑y

Yes, an engine needs to allow people to be creative and experiment with UX. If it didn't allow this then no progress could ever be made in that area, and the apps would all end up the same, for better or for worse.

Like all frameworks, and languages, this allows people to create bad UI's. I fixed several issues in Fuse found by people doing things I considered a bad design. It's not my job to judge their approach though, rather to find the inconsistency and correct it. Features, of course, were priotized on known use-cases though.

Thread Thread
 
johannesvollmer profile image
Johannes Vollmer • Edited

Okay, I must confess, a library probably shouldn't prohibit using absolute sizes (but it should not promote them).

But all UI engines allow absolute sizing, so you won't make progress by implementing absolute resizing, just as every other engine already does. :D

Thread Thread
 
mortoray profile image
edA‑qa mort‑ora‑y

Don't worry, I'll be talking lots about responsive layout.