4 ms·
Listing a set of rules doesn't not "logical" make. > width looks up the tree while height looks down the tree. > that’s why height: 100% doesn’t do what peopl
by eviks 3y ago
Listing a set of rules doesn't not "logical" make.
> width looks up the tree while height looks down the tree.
> that’s why height: 100% doesn’t do what people often expect and go the full height of the screen
That's why it's "not logical", even though both sets of rules (W/H look up; W looks up H looks down) can be written down. What's the logic behind the same thing (dimensions) looking at the opposite direction? What is the mental model of the interface world where this makes sense, so that you could use that logic instead of having to rely on remembering the rule that contradicts your intuitive "logic"?
- Dalewyn 3y agoYou make something wider to fill the viewport. You make something taller to fit the content.
- bazoom42 3y agoIt is logical for laying out text because if a text is larger than what fits on a screen, you want lines to be no wider than the viewport width and instead have the text expand vertically. So width is constrained by what is available but height determined by what is necesary for the content. The CSS flow layout is designed to make text content readable by default on a variety on device dimensions.
- corethree 3y ago[flagged]
- ClumsyPilot 3y ago> He stated the rules logically A computer is made of logic gates, therefore anything a computer does is logical by definition. It is literally not able to do anything that is not a logical operation
- deleted 3y ago[deleted]
- chrisjj 3y agoTrue, but this "logical" spec was not created by computer.
- corethree 3y agoI'm kidding a bit here. My post is actually agreeing with the parent poster but in a sort of roundabout deceptive way of appearing to disagree. It got flagged and several downvotes. Likely from saying that css is terrible. But I mean that's the essence of the parents actual argument is it not? He's essentially saying css is just not well made or poorly designed. I'm just more on the nose about what he's actually saying. Either way as you pointed out css being logical is from a very technical perspective correct.
- yCombLinks 3y agoNo, here is the logical behavior. Width applies to the left and right direction, Height applies to the up and down direction, and otherwise their behavior is exactly the same. That's why everyone gets it wrong, consistency between these two is the logical expectation.
- chrisjj 3y agoGood points. And they highlight that the word "logical" needs disambiguation here. CSS behaviour requires sustantial work to get one's head around. The result includes dramatic change to head shape. #!important
- Flimm 3y agoI wish percentages in CSS were more explicit: #foobar { width: 100% of container width; height: 100% of contents height; }
- eviks 3y agoSame idea I had when commenting - this just needs some good old explicit reference (can be optional)!
- deleted 3y ago[deleted]
- err4nt 3y agoThis exists, you can specify containers and then use 100cqw container query length percentage units https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_containment/Container_queries#container_query_length_units https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_contain...
- williamcotton 3y agoHow the hell would anything coherent be drawn to a computer screen if the underlying description wasn’t logical? It might be messy, but it is being processed by a machine that is fundamentally based on logic!
- eviks 3y agoRiddle me this: why does this blog list a long set of rules as a justification instead of a single one "because a machine can process it to draw something coherent"? Could that be due to the fact that your definition is irrelevant for this conversation?
- williamcotton 3y agoBecause a computer can take more than one instruction, right down to the CPU. Is ASM not logical?
- eviks 3y agoThis doesn't address my question
- williamcotton 3y agoThe author is missing a key understanding of how computers operate and any thesis that the human language is illogical to the computer system misses the point. Logical and confusing are two different concepts and I’ll leave it to the reader to ponder why.
- yCombLinks 3y agoSo if CSS had a property named Text-Color that set the font size it would be logical, because it's all based on logic? CSS isn't a mathematical construct based on first principals. It's a spec that was created to layout print-media style webpages in the mid 90s.
- 3y ago