4 ms·
This stood out to me too, and makes me scratch my head a bit, because it is not in line with the otherwise pragmatic advice. For projects that have a design ma
by dgb23 4y ago
This stood out to me too, and makes me scratch my head a bit, because it is not in line with the otherwise pragmatic advice.
For projects that have a design made by a designer (with something like Figma/Sketch/XD) it is definitely _not_ better for responsive design. Almost all designs assume that the border is part of an element. It's the more intuitive option, plus the tooling around designs will show you the spacing _between_ borders.
Intuitive: In the real world, when I need measurements from you and you omit the conceptual borders of a thing, I'm not going to be very happy.
Then you also have the issue that many of the common idioms get hairy and intuitive. Say you put an element with a border inside a container. With content-box, your 100% values are now not respecting the border, meaning you'd have to subtract the border width in order to fit the element.
Lastly there is the philosophical argument about layout vs content. HTML/CSS does not in fact provide a meaningful and clear distinction of layout and content/structure. They do somewhat in theory, but that falls apart so quickly that you're better off just ignoring the theory and live with the practice. And on a human level, there is no clear distinction either. The letters, colors, images and shapes we put on the screen are all part of the same visual experience we try to communicate.