diff --git a/_drafts/whose-layout-is-it-anyways.markdown b/_drafts/whose-layout-is-it-anyways.markdown new file mode 100644 index 0000000..ef53994 --- /dev/null +++ b/_drafts/whose-layout-is-it-anyways.markdown @@ -0,0 +1,46 @@ +--- +layout: post +title: "Whose layout is it anyways — where the margins are made up and the spec doesn't matter" +categories: posts +description: TODO +--- + +I've been [working on rebuilding Kosmonaut's layout engine](https://github.com/twilco/kosmonaut/pull/14), and in doing +so uncovered a bizarre incongruence between one of the most foundational CSS specs and the actual implementation of said +spec in all major browsers. + +### The CSS box model and block layout + +In the CSS box model, boxes are made up of several components: margin, border, padding, and the box content. + +{:refdef: style="text-align: center;"} + +{:refdef} +
display
value:
+> https://drafts.csswg.org/css-display/#display-value-summary
+> {% endfnbody %}
+> {% fnbody %}
+> When taking the writing-mode
property into account, the equation we're investigating actually calculates the inline-size and inline-start and inline-end margins rather than width and left and right margins. To keep it simple, this post will discuss only the latter set of values. If you want to know more, the writing mode spec gives a nice overview of what changes in abstract layout:
+> https://drafts.csswg.org/css-writing-modes-4/#abstract-layout
+> {% endfnbody %}
+> {% endfootnotes %}
+
+
+
+Alternative title: A practical lesson on CSS spec purity vs. reality