https://www.youtube.com/watch?v=K3tZisVDIVk https://practicaltypography.com/ https://beautifulracket.com/appendix/racketcon.html
Hardest problem in computer science: centering things
171–180 of 473 posts
Re: Hardest problem in computer science: centering things
#172That bright yellow background imprinted my eyes for 5 minutes, there's other way to leave an impression than fucking up with my senses, like writing a clear concise article instead of a never ending list of examples interrupted with distracting fake mouse move. An horrible web experience through and through.
Re: Hardest problem in computer science: centering things
#173Text-Box-Trim I’m surprised ‘text-box-trim’ wasn’t mentioned. It’s a CSS attribute that solves this on the web. https://caniuse.com/css-text-box-trim If only browsers would support it. Until then, here’s a JS alternative. https://seek-oss.github.io/capsize/
Re: Hardest problem in computer science: centering things
#174Earlier quoted context omitted.
The grocer's apostrophe (which I will argue should be called the grocers'(1) apostrophe, since there are many offending grocers) is the bane of my existence (1) My phone absolutely tried to correct that back to "grocer's"
> which I will argue should be called I think you're missing the joke of the name!
Re: Hardest problem in computer science: centering things
#175If there’s anything I learned from studying design and typography, it’s that there’s no singular correct rule you can use to align things. Use precise measurements for your margins? Someone will say that perceptually it’s not symmetrical, and rightfully point out that perceived symmetry is the only one that matters . Adjust visually for your hanging punctuation, ascenders and descenders? Someone will draw a bunch of…
Re: Hardest problem in computer science: centering things
#176This is an excellent piece, about how virtually impossible it is to center things accurately mostly because of how fonts are displayed. But I'll add two more wrinkles that the author doesn't mention: First, that font rendering isn't just about metrics but varies across operating systems and browsers. So even if you center perfectly on Chrome on your Mac, it may very well be off on Firefox on Windows. And second, that…
Yes, and let’s not forget fallback fonts. So rules for each browser and OS and each font class and each layout (desktop, tablet, mobile). Probably on the order of 100 rules for a single style. Yeah, we’re just being lazy. We need sane font rendering in browsers that treat things like alignment in a way that we’d expect for the 99% case. If I say “center” it should just fucking center.
Re: Hardest problem in computer science: centering things
#177Earlier quoted context omitted.
And then it took some 20-ish years for CSS to finally realize that aligning to a grid is a good idea and, through a long, painful, incremental process, eventually reinvent tables for layout.
I mean, semantics are also good! Yes, CSS grids are a lot like tables in some ways, but not having to add 25% more DOM elements to fake a table layout (display: table/table-row/table-cell; that's 3 divs for one row!) is also a thing to be celebrated. Plus, in practice, grid is a lot more powerful than doing a few common layouts. Grid took so long precisely because they were trying to think a little further ahead rath…
HTML is a graphics rendering language in denial about its true nature.
Grid took a long time because everything takes a long time when you have to align mutually competing organizations and there's no profit motive involved with the actual work itself. There's no real technical benefits to CSS layout over table tags. A table tag isn't a heavy object. CSS cascade calculations on the other hand ...
Re: Hardest problem in computer science: centering things
#178Earlier quoted context omitted.
And then it took some 20-ish years for CSS to finally realize that aligning to a grid is a good idea and, through a long, painful, incremental process, eventually reinvent tables for layout.
I mean, semantics are also good! Yes, CSS grids are a lot like tables in some ways, but not having to add 25% more DOM elements to fake a table layout (display: table/table-row/table-cell; that's 3 divs for one row!) is also a thing to be celebrated. Plus, in practice, grid is a lot more powerful than doing a few common layouts. Grid took so long precisely because they were trying to think a little further ahead rath…
I'm not the most current, but as I remember in CSS tables those table-internal elements generate the needed anonymous boxes of rows, tbodys and such, when those arent't specified:
Re: Hardest problem in computer science: centering things
#179I’d like to use system fonts more often, but apart from the vendor brand fonts like Segoe or San Francisco they are pretty terrible to use all around.
So choosing a custom font and fitting everything around it seems like the solution for now. Apart from that, I’d like to see more support for leading-trim, which will help make things better, at least on the web. https://medium.com/microsoft-design/leading-trim-the-future-...
Re: Hardest problem in computer science: centering things
#180My experience is that frontend devs mostly wants to write js and not css. The term they use for guys like the op is pixel pusher. Another annoying thing is when they use colors that are a bit different where is should be the same. For things like buttons etc...