Intro to The 8-Point Grid System (2016)
builttoadapt.io
builttoadapt.io
Luckily, it's easy to deviate, but just sharing my experience. :)
And do font-sizes follow the same pattern as boxes? How tall should a font be in relation to the box it is in? 8pt smaller? 16pt smaller?
In the first case the amount of mm would be different for each display. In the second case the amount of pixels would be different for each display.
Perhaps this quote from the article provides a hint:
> Ok, I get the even number thing, but seriously, why not 6, or 10? The majority of popular screen sizes are divisible by 8 which makes for an easy fit.
From this I'd say it is about pixels. But why call it "pt" then? And yes, how does this give useful results on high resolution displays?
I think the article is really confusing.
The point is that the author says that the screen size in pixels should be an integer multiple of 8pt, which doesn't make sense.
In typography, the point is the smallest unit of measure. It is used for measuring font size, leading, and other items on a printed page. The size of the point has varied throughout the history of printing. Since the 18th century, the point's size has varied from 0.18 to 0.4 millimeters. Following the advent of desktop publishing in the 1980s and 1990s, digital printing has largely supplanted the letterpress printing and has established the DTP point (DeskTop Publishing point) as the de facto standard. The DTP point is defined as 1⁄72 of an international inch (about 0.353 mm)
So if you have a 72 dpi monitor, then as it happens, a point is a pixel.
On the web it feels like such a pain to really implement something like that with dynamic page width and content. So in most cases i just nudge things and make sure they are nicely aligned where it makes sense.
Still, nowadays this is much easier than even 3-4 years ago.
/* _variables.css */
--font-size: 12px;
--ru: 1.5;
/* _typography.css */
p {
font-size: 2rem;
line-height: calc(var(--ru) * 2rem);
margin: calc(var(--ru) * 1rem) 0;
&.small {
font-size: 1.5rem;
line-height: calc(var(--ru) * 1rem);
}
}Uh, divisible by 8 pixels, not 8 points. On my screen 8 points is 10.67 pixels, which renders the author's arguments about resolution and odd numbers invalid.
I’ve yet to see a grid system that has guidance—let alone tooling!—for working with paragraphs of text which embed inline-block elements in them of “abnormal” block heights (= larger than the text’s own line-height) without somehow breaking the grid.
Picture, for example:
> You’re invited to [test-drive our new Beta]!
...where the text in brackets is a button, and this button has enough padding/border that it has, relative to the line height, ~1.5em of outer bounding-box height.
Before grid systems, this used to be a pretty classic appearance for a call-to-action!
I’d expect, if I were writing traditional bespoke CSS and not using a grid, that I could achieve all of the following at once:
1. the text inside the button is baseline-aligned with the text beside the button;
2. there isn’t too much or too little space between the edges of the button and the surrounding text—i.e. it feels like it’s “part of” the line of text, rather than feeling like the line of text and the button are two cells in a table;
3. the line of text that the button is a part of, within the paragraph of text, doesn’t awkwardly have different line-height than the other lines in its paragraph (which is what inline reflow chooses to do by default, unless you give all the lines in the paragraph that same line-height as a minimum.)
4. the paragraph doesn’t awkwardly have a different line-height than the other paragraphs on the page;
5. the paragraph doesn’t seem to have too much margin on the top/bottom edge compared to its immediate siblings (which usually happens, because line-height in CSS is applied per line, rather than being interspersed between the lines of a paragraph, meaning that it overpads the top line);
...but I have no idea how to achieve these properties together on a grid.
I feel like this is an important and oft-overlooked consideration, because “CTA button” here can be word-replaced with “emoji” or “highlighted reference to a username/tag” and you’ll end up with the same problems.
It's nothing new. CSS has these properties for a reason.
Usually people claim to know how these things "should" be done, but there's always a "but".