Visual design rules you can safely follow
anthonyhobday.com
anthonyhobday.com
He gives the good advice that you should only follow the rules when they make sense, and not otherwise. With that in mind, the two rules I disagree with the most are:
> Measurements should be mathematically related
> Elements should go in order of visual weight
Because, whereas most of the other rules are probably good to follow 90% of the time, these feel sort of arbitrary and opinionated.
I think making measurements mathematically related is a convenience and is often helpful, but for the same reason that optically centering things is better than mathematically centering them, I think you can easily ignore a mathematical relationship between values if it doesn't look as good. There is nothing inherent about humans that makes us prefer magic numbers, it's just that using them gives us an easy way to achieve visual consistency. If it stops doing that, ignore the ratio. If a grid or your font sizes look better nudged by a pixel or two in one direction or the other, do that instead.
With respect to ordering elements by visual weight, my only complaint is that he specifically says "heavier first", rather than "heavier first, or heavier last, both are fine as long as you're consistent". So, it's a nitpick, but it bothered me because it's an easy distinction to make.
It reminds me of shuhari (守破離), an idea from martial arts and other traditional practices. It basically means "Follow the rules, break the rules, transcend the rules", and the characters mean "follow, break, transcend". The article hints at this too: follow the rules until you find a good reason not to. As it is aimed at beginners we should mostly be learning and following the rules until we have enough experience to start breaking them.
I really like how that lines up against one of my favorite maxims, "First do it, then do it right, then do it better."
守 does mean "follow" in the specific sense of "following rules", though it has no sense related to motion and most "following", including metaphorical following, would be represented by 隨. 守 mostly means "guard" or "protect", and I assume that's the metaphor that was extended to complying with rules and correctly performing rituals.
破 means "break", no problem there.
離 means "leave" as in "go away"; it does not appear to have any sense of "transcend".
For those unfamiliar, the rule is that the main focal point (the bit you want to draw the observer into the picture first - such as the eye of a the person in a portrait) of the picture should be at the intersection of one third from the edges of the picture.
Another "rule" is the "sacred geometry" where elements that have long edges are more appealing when they are in alignment either with other "lines" in the image, or with the edges of the image itself. I've taken many landscape photos with a camera leveled with a gyroscope stabiliser (or just a spirit level when on a tripod) but the resulting images didn't "pop" until they were rotated so the ground aligned with the frame, or the picture skewed so the walls of buildings were truly vertical.
But then I've seen some incredible photographs that break those rules and only work because they deliberately broke the rules - some quickly found examples (and article affirming my diatribe above :)) from natgeo: https://www.nationalgeographic.com/photography/article/break...
Optical weight is nice and all (and a better simple rule than just spacing things by equal distance), but in the end you also have other phenomena (humans perceive horizontal lines different than vertical ones etc.)
Just the seemingly simple task of spacing out letters can get complicated pretty fast if it should look pleasing as in "as if there was no design there".
I think that this might be more true in screen based work than in printed publications. The focus of a printed page tends towards the top, but not necessarily at the top. A webpage is a different entity… not always seen in its entirety. The way that unity manifests would therefore necessarily be different. The order of weight would be better maintained at a local level, not global.
> Make outer padding the same or more than inner padding
This is one that is generally true, but not always. A framed drawing can often safely accommodate more space at the bottom than the sides and top.
not because not doing so would result in bad design decisions, but because it makes it much much easier for people unfamiliar with design work to:
- keep things consistent - stay within a balanced set of measurements that are easy to remember and expand - avoid ending up with a set of values that are too close to each other to meaningfully impact the design, but are therefore hard to maintain and identify
However, there is sort of a reason to do it: baseline alignment. If you have columns with different contents, the heights of everything should work out so that the baselines continue to align over the page. You can adjust this manually, but a mathematical relation can be a shortcut there.
Optically is more center of mass, but ideal more 'center of visual weight'. Larger things are 'heavier', darker/more contrasty things are 'heavier'. Rounded things should extend over an alignment line a bit, flat shapes butt up against it (e.g. in the letters lO the O extends over the baseline slightly compared to the l, to visually connect with the baseline more).
In general the way it works is you align with whatever software says and you look at it and say does it actually look aligned or need minor adjustment? Because the point is to look aligned rather than to be mathematically correctly aligned. Like our letters above, they look more visually on the same baseline when they're not, then when all the rounded base letters sit most 'correctly' on the line.
The author is suggesting you use the mean X value of all the pixels in the shape, instead of the mode x value.
I'm sure fancier image editing software does this, but your eyes are pretty good at it too because it's just dividing the surface area in half, or thinking about it as the "center of mass" as you put it: where could you attach a string to this shape such that it doesn't tip over one way or another?
> I think making measurements mathematically related is a convenience and is often helpful
I think, in the absence of any guiding principles or rules, this is a good one to have. It's easier to say "Ok, this should be 4, 12, 36" then go from there.
I think heavier first is just because so many people make the same mistakes. Clearly, if you have experience, you can break the rules anytime you want and even make up your own.
Heck, related by Wiener noise/integrated random walk is mathematically related, and if you watch 2D animations of random walks you'll soon develop a visual feeling for that.
[Back] nevermind [NEXT]This rule actually can be used to generate all the other rules about spacing, kerning, leading, font size, padding, etc. It was the first true piece of "secret" design knowledge I was handed down when I went to work at an ad agency at 15, having already been proficient in Quark and PS/AI but without any formal design training. The rule about alignment based on eye / weight versus mathematical alignment also flows naturally from this.
Interestingly, it was the agency director who was not a true designer who told me this; I believe it was her one and only rule for judging design, and it worked quite well.
In the years I spent studying design and typography in art college later on, I never once heard anyone mention this rule. But it is the very first thing I bring up with designers I hire.
One thing that happens when you follow this rule is that you get an automatic grid of sorts, that isn't necessarily constrained to a standard way of breaking up grids. Using the same measurement increments (e.g. 10 pixels padding, or 1/2" gutters) as the multiple by which things that are lined up take their space from each other, you can get regularity and readability without boredom even in pretty wild designs.
Excellent job by this author putting these ... essentially rarely spoken, infrequently taught, but fundamental and quotidian design rules into a clear, digestible format. These are all things that are sort of assumed in design agencies but are rarely elaborated on so clearly.
I showed it to the designer and he basically said it looked like shit. I was like, what, why? He took a screenshot, dragged it into Sketch and used some of those little red rulers to point out that in his design, everything was aligned to the left with a fixed padding to the side, whereas in my implementation it was all over the place.
Basically, I didn't have the eye for design or alignment yet. I mean I still don't and I'd rather not anyone ask me to do visual design, but I got better at it by being taught what to look for.
"Teaching how to see" is an important lesson that a lot of developers haven't had yet, I think, which is why there's tropes about UIs designed by developers.
When I got moved from doing print design to the early web, we'd literally design an entire website at one size in Photoshop and use slices to cut all the interactive/hover bits out and put it all in a table. Nothing about web/app design has gotten simpler since then. Compare with the absolute ease and freedom of working with a layout program like InDesign or Illustrator, targeting a known print size. It's easy for a nontechnical designer to look at a mockup and say what's wrong with it, but it's infinitely harder to know what levers to pull in the giant puzzle of CSS and HTML to attain all the details of the static design. And sometimes the static design is just a launch point. In a case like that, if I were in the graphic design / art direction role, I would provide a logical style sheet, basically a list of rules about alignment and sizing, because I wouldn't expect the coders to be able to visually extract my intent or what I considered important just from looking at a comp.
I'm no designer, but I know I appreciate when designs include that kind of info.
That's because designers use guides. Things that line up with guides, line up with other things.
So putting it as the later, aka 'lining up with other things' becomes rather the indirect way of putting it.
It's true that small imprecisions in lining things up create subconscious disruption - but most people who've done years of design can spot a 1px misalignment like that without guides. The rule that everything should line up with something else doesn't refer to technical precision. It refers to how you construct and think of where to place each element in your overall design, well before you get to the stage of pixel-level adjustments.
Guides might be a problem or inhibiting in classical design, but not web design where breaking the rules set by the guides will usually cause problems.
This is interesting because when I was in design school we had entire courses on Swiss grid systems. "Grid Systems in Graphic Design" by Josef Müller was like the holy bible.
That said there are a lot of design peers that I've worked with that were either never taught or simply ignore this. I wonder if it's a generational thing and simply not taught anymore (I went to design school in the mid-90's).
Of course one downfall of having worked with various grid systems for so long is I can tell when something is off by one pixel and then cannot unsee it.
Once developers know this system exists, coding front ends becomes a lot easier.
A lot of these tips I've learned on my own just analyzing how designers I've worked with did things or noticing how sites I thought were aesthetically pleasing to the eye have done it. I kind of wish I had a summary like this a few years ago.
Film/video/photography have them as well. Things like looking room, rule of thirds, and similar guidelines will pretty much always be safe. However, there are times when breaking those rules can look very awkward or very artistically done, but it can be telling when it was done from ignorance and just looks awkward or done with intent and the breaking of the rule reveals something else deeper.
Here is an essay I wrote on the subject:
https://www.dropbox.com/s/il89ks8jzw8wwsd/thirds.pdf?dl=0
To summarize:
1. The ROT has a bastardized history, that involves the artist Thomas Smith semi-completely misunderstanding the work of the artist Joshua Reynolds.
2. Smith re-wrote Reynolds's observation as a rule of prescription (e.g. 'walk only on the path') not as a rule of exclusion (e.g. 'don't walk on the path'). In aesthetics, the former generally do not have a long life expectancy.
3. Reynold's original observation was not restricted to composition. It addressed the artist's abhorrence of symmetry. Symmetry is understood as being a general phenomenon. Hence the following cases are all understood as being manifestations of symmetry...
- Two or more lights of the same colour
- Two or more diagonals of the same angle
- Two or more objects of the same size
a common use of thirds is in graphics use of lower thirds. it's just enough room without being too much. lower quaters would be small. lower halves would be too much. centering your subject in the first 2/3 and leaving the remaing third as looking room isn't bad aesthetically.
so maybe how you are interpretting the ROT is different than how i use it, but you definitely seem to have a grudge
Yup. I guess I do. Perhaps I overstated my feelings, but as an art and design teacher such non-truths are the bane of my life.
Almost all 2D aesthetic images (paintings, art photographs or page layouts) feature a region of interest (ROI) sometimes called the point of focus or the center of attention. Indeed, it is difficult to construct an aesthetic image that does not.
The so-called rule of thirds states that this ROI is best located one third across the vertical and horizontal axis.
However, the actual; truth is more complex and more interesting:
1. The horizontal axis ratio is not 1:2 but closer to 1.618. In other words, the golden ratio https://en.wikipedia.org/wiki/Golden_ratio [1]. For many purposes, one third is close enough to the golden ratio. However, in practice artists/designers tend to actively avoid exact fractions (third, half, quarter, seventh etc).
2. There is a difference between the placement on the vertical axis to that of the horizontal axis. The vertical axis seems to be tighter towards the edge (the bottom edge in a painting, the top edge in a flat design).
3. Mysteriously, there is a slight favoring of the left side over the right. This seems to have something to do with writing direction [2].
My own small-scale field research supports these observations (on 31 art students), as well as the work of a few others (below).
On a personal note... one reason I like lurking in Hacker News is for the precision of thinking that computer and software engineers exhibit. In my own field (fine art) 'received wisdom' is often taken as lore. These non-truths are harder to kill than vampires. Examples:
- Red recedes over blue (in a FG/BG pairing, one will always recede, but which would depend upon which red and blue you employ and how they are used).
- The complementary of red is green (yes it is the perceptual complementary in RYB space, but the mix-to-neutral complementary in RGB space is cyan).
- That the Pointillist painter Seurat employed optical mixing of primaries by placing them in close proximity, like a CMYK printer (he simply did not... there were other reasons he favored small dabs of paint in close proximity).
... I could go on.
[1] Amirshahi, S.A., Hayn - Leichsenring, G.U., Denzler, J., Redies, C.: Evaluating the rule of thirds in photographs and paintings. Art Percept. 2 , 163 – 182 (2014)
[2] Chahboun, S., Flumini, A., Gonzàlez, C. P., McManus, I. C., & Santiago, J.: Reading and Writing Direction Effects on the Aesthetic Appreciation of Photographs (2016)
I loved this list.
In response the really elite players just go back to bending over to pick up the ball with their hand, signaling that they're too skilled to bother signaling how skilled they are.
HN falls hard into this in general. But then combine it with the disdain or even contempt it's fashionable to show towards subjective pursuits like aesthetics, and it gets dialed way up.
Like you said it's very predictable. Any time I see a link that has any sort of distinctive design, unique typographic style, or especially authorial tone, I know instantly what a handful of comments are going to be.
Truly elite players have ball boys and girls pick up balls for them.
Your point, though, reminds me of the Sneetches by Dr. Seuss
Once you realize that "appeal to nature" is a fallacy, you will be free.
https://anthonyhobday.com/sideprojects/
I think his design ideas are sound. But visual design without any notion of information design is like having a beautiful car with no wheels. Or something.
I know this is hard to grasp in the world of LinkedIn that we live in, but would it shock you to learn that sometimes people just like to share things without it being directly marketed somehow? Not everything has to be a hustle.
I'm guessing that his website is work in progress or/and he's learning cms he's using.
>I think his design ideas are sound. But visual design without any notion of information design is like having a beautiful car with no wheels. Or something.
Sure, but you should learn from multiple sources as not everyone should teach about everything. It's up to you to connect that knowledge.
In another of his articles he begins with "Stripe recently refreshed their website..." but we have no way of knowing what "recent" means. The article might be 10 years old. For someone focused on attention to detail, he has neglected the importance of date in context:
https://anthonyhobday.com/sideprojects/attentiontodetail/str...
Sometimes it's okay not to mention date, such as a movie or book review. We know it was written some time after the book or movie was released - a date already known to reader.
This is not difficult.
Please don't. Reducing contrast of text makes it harder to read. Even if you do it just a little bit, it still makes it a little bit harder to read. Worse, a lot of designers seem to get carried away with this and end up with gray-on-gray text that's impossible to read for anyone over the age of 30.
Plus it doesn't even look better. I guess this is subjective but I frequently open the devtools inspector to edit people's CSS to turn their near-black into black and their near-white into white, and every time I'm like "Wow, that looks so much better!"
Maybe I'm just a systems engineer with no sense of taste but I absolutely don't understand why anyone wants this.
People over the age of 30 can mostly read books and newspapers just fine, and when they can't it's rarely the fault of the off-white paper and slightly faded ink.
Do you have any links to the studies by those researchers? My own understanding is that yellow-on-blue is traditionally meant to be the most visible option, but that there's not actually a huge amount of evidence to back this up, and it's more tradition than anything else right now.
Too much contrast has never been an issue, which is why no one uses flux or dark themes, right?
f.lux is for increasing color temperature. Dark themes are for reducing the ratio of bright to dark. Neither is primarily intended for reducing contrast.
font-weight: 300, color: #555
nightmare that we see everywhere on the modern web.So lets just not.
Also, a backlight-based screen is not the same thing as a newspaper, where you can easily increase contrast by improving your light source almost infinitely. I can always decrease my screen brightness quite a bit, but there is an upper limit of increasing it.
That said, even though monitors like laptops and phones increase brightness, that’s not enough when in direct sunlight. There, black in white would make sense, but of course comes at a cost of reducing range (it’s physically impossible). Screens that are incapable of keeping up with direct sunlight should probably increase contrast in those conditions.
(Incidentally I'm a big gamer but I generally prefer to turn off HDR because it hurts my eyes. It's actually really annoying. I don't want certain parts of a scene to be extra-extra-bright.)
If you're giving me text, please don't second-guess whether I've set my monitor brightness appropriately. The vast majority of text I look at is already black-on-white. By reducing the contrast of your text you're assuming that everything else I look at is blinding me and somehow you're saving me with more appropriate contrast. No, I've set my monitor so everything else I look at looks right and what you're showing me is too washed out.
Why would #000 text on #fff be the correct way? It’s common but not at all ubiquitous, there’s no standard for this.
> No, I've set my monitor so everything else I look at looks right and what you're showing me is too washed out.
If you don’t like the extra range you can easily increase the contrast and reduce the brightness, but the other way is very destructive. You can go from #def -> #fff with a simple transform but you can’t go the other way. And if you use 100% of your range in a single element, you have no room for using color, shadows and background, which is a critical tool for all complex design, including old school Windows and Mac UIs from the 90s.
That said, there should be better APIs/standardization and monitors should be better at adjusting brightness and contrast to lighting conditions. I don’t mind at all that people change to whatever suits them, in fact I wish it was easier to use things like reader mode (which ad-tech has been fighting against, hard). Lots of web sites suffer from all kinds of design issues these days, sometimes too low contrast, even for me.
By maximising contrast, one is trading short-term legibility with long term legibility. The maximum amount of contrast is as problematic as almost no contrast. There is a maximum useable deviation to both ends. By approaching max contrast, it gets harder to read for longer periods, because your photoreceptors approaching exhaustion, creating an after image [1]. It may happen slow enough to go unnoticed for some periods but should be noticeable at the end of a day as eye strain.
If I'm sitting on my laptop in daylight, outdoors or in a room with large windows, I'd really like to max out the contrast while reading. Later in the day, the "Night Light" feature that's built into Windows 11 will reduce the contrast and increase the color temperature towards a yellower hue. (In past years I used f.lux for this.)
This kind of adjustment is not something each website should try to do. It's a system-wide setting that needs to take into account e.g. local sunrise/sundown times, like Night Light does. (And on iPhones, there's a light sensor that takes care of this.)
Even if your scene were in the middle of the night you would still use your brightest white ("FFFFFF") for the least-dark moonlit areas. (Striking recent example is The Northman fighting in the caves.)
In that context I wonder if the motivation for recommending near-white and near-black, i.e. foregoing dynamic range for no intrinsic benefit, is for contrast against other things in the user's field of view e.g. large images, browser toolbars, popup notifications, etc.
I'd associate eyestrain with the muscles in the eye. Like you can give yourself eye-strain by quickly moving the focus from close to far-away a couple of times.
Meanwhile, after-images are a neurological artifact. They do not cause your eyes to change focus, and are not caused by the muscles in the eye.
Although extremely bright light may strain the eyes in the same way your eyes may be sore from contracting if you go outside on a bright summer day.
What I described earlier as exhaustion is buried in a process called visual cycle, which is a biochemical process. If enough photons of a given wavelength hitting special molecules of a part of your retina, these molecules run through a replenishing cycle after photon absorption to run through the same loop again and again. If light source is strong enough, the cycle is not adequate to account for the incoming mass of photons, essentially triggering temporary deactivation. The molecules responsible for colour vision register the inverse of the incoming wavelength, as in: the absence of all other wavelengths registered gets interpreted as the colour one sees. This essentially creates the yellow after image if one looks at an object with strong red and blue content.
This is a can of worms and there is more involved, even on the side of the emitter which is why there is measurement in watts per steradian going on but my knowledge ends here. Maybe a Biologist can chime in.
When most displays blast intense white light in your face at normal settings, it's not a screen brightness issue, it's a content brightness issue. Solved with controls such as dark modes, reading modes and options for users to customise. Obviously a lot of users prefer the full contrast experience, but many don't. Providing user choice is best strategy.
It's certainly possible to cause them by "bleaching" photo-pigments, but this requires extremely bright light. Other mechanisms likely produce the after-effects you normally encounter, and even there, eye movements (large and small) should help counter-act them unless the stimulus is very large and bright.
I have no doubt that overly contrast-y web pages can cause eye strain, but it's usually not because they're exhausting photoreceptors.
and guess what, it's far easier and more pleasant to use all contrast available in color and tone it down with the brightness setting of the monitor, than doing grays on grays and having to shade or crank up contrast in the monitor
No, ‘Maximum contrast everywhere’ given as a directive without consideration is not a solution and will increase the problem.
Consider things beyond HDR displays: At technology progresses, we will approach superbright display technologies which will surpass the dynamic range of the human visual system. Technically, these will be as bright as light bulbs and brighter and could be used as such. Going by that max brightness directive, we will all stare happily into a direct light source one day. Or one is happily busy dragging the brightness slider up and down the whole day, one at a time for every app and site. It won’t work. To solve this, we would need tone mapping at the latest pipeline stage, everywhere. And this will, of course, again reduce contrast, but this time, by design.
The other major problem is: by leaving it all to the users (all three dimensions of the now prevalent color model), one throws every standard out of the window. One website will send out 4000 nits, the next one 350. One display can handle it, the other cannot. Color shifts abundant. How should that be accounted for? Furthermore, your model makes it impossible to design for: this removes the visual target platform and puts legibility and qualitative design principles at the mercy of technological progress. So solve this with the tech available, there were several agreements made to specify calibration targets - which include brightness and contrast settings, aka gamma in more than one dimension.
In a perfect world, no screen would leave the factory without a built-in calibration device and an ambient light sensor.
One more problem, the constant intermixing of use cases while discussing HDR displays: not every use case needs an HDR treatment. It does not make any sense. The main problem HDR solves is that content creators are not forced to squeeze 10 pounds into an 6 pound bag anymore. And if your display supports this, you can benefit from the full color space the content creator wanted the observer to see. Which is totally nice for hundreds of use cases. However, staring at a pitch black font next to a white background which emits 20.000 cd/m^2 would be painful.
2. I especially considered calibration in my comment and others above yours.
No, it doesn’t ignore it. Your comment, however, does not go into any details I mentioned besides ‘you are wrong‘.
What is actually your argument?
Otherwise I loved this list as a lay person.
Regarding color palette, I really like the work of Kate Rose Morley: https://fosstodon.org/@kate/109348023789472321
I have always put this down to designers having very high quality monitors with excellent contrast. Apple screens (laptop or desktop) particularly tend to show those low contrast things as more readable than for the rest of us.
It is a plague that seems to be less bad than it used to be. I think it's ok in principle but it should be quite subtle. Also, I think that full-black should generally be used for text, but you can get away with more on the background (look at HN for example!).
> “Pure black looks unnatural on a screen, and pure white is too bright.“
Even though it looks “unnatural“ at least I can read it.
The "safe" rule would be to use 100% black and 100% white for maximum contrast. Only diverge from that if you have a good reason.
TBF, I think having a small range of blacks in use is a good thing. Use 0.0 and 1.0 for highlighted items. 0.1 and 0.9 for the rest. Great! A little color rather than grayscale? Great!
But, I've seen far too many sites that take it too far and think they are smart by presenting dim-on-grey text. f2 hex is 0.87 and 22 hex is 0.33. That's cutting my screen's range in half! And, that's much better than many lovingly designed sites I've had stomp over with screen-reader mode, on my 800 nits phone screen!
Or if their device is even capable of it (phones/tablets and laptops)
Also can't control if a user has their brightness too low. So what then?
I studied that ebook over 5 days (it would be possible to read in 1 day), took notes, and found it a delight to read and incredibly unpretentious (sophisticated ideas are conveyed in simple side-by-side comparisons of right vs wrong ways to do things).
I'm also a bit displeased that "UI" seems to mean "webpage" these days (not even SPAs, but just laying out hypertext and graphics on a screen), whereas I always considered that to be a special case of UI that's so trivial that it almost needs to be thought of as a "degenerate" special case. It used to be called "web design" but that's probably too 90s and wouldn't sell books nowadays. I actually wanted to learn about desktop GUIs, making this wholly the wrong book for me.
These come from an era before HCI was a professional discipline taught in schools. I suspect newer books don't teach these general principles because they take for granted that a professional will have learned them already through their formal training, so they can focus on specifics.
https://www.amazon.com/About-Face-2-0-Essentials-Interaction...
https://www.amazon.com/-/es/Don-Norman/dp/0465050654/ref=pd_...
https://www.amazon.com/-/es/Steve-Krug/dp/0321965515/ref=pd_...
What's the "next level" from these handy rules of thumb? I'm looking for a UI 201
Everything about modern design is "unnatural", this design rule is the "appeal to nature" fallacy manifest.
If you need proof that beautiful things can be black and white: https://gwern.net/
(also, OP blog is _so close_ to pure black and pure white, it's almost imperceptible)
You tend to get a smearing effect, where the pure black parts have a slight delay.
You can see it demonstrated in this video https://youtu.be/eHpLN0rX2DI
OLED has a delay when switching pixels on and off.
That being said, if it's static please offer a "high contrast dark mode".
Nothing looks better (and more battery efficient) than pure black on an OLED.
It also doesn't occur on monitors. White and black on a screen is not pure, screens aren't that good.
"Don't use pure black for text" or "don't use a pure white background" are total myths among designers. You'll never have anything close to a pure color on current display technology.
- Saturate your neutrals
- Use high contrast for important elements
- Everything in your design should be deliberate
- Optical alignment is often better than mathematical alignment
- Lower letter spacing and line height with larger text. Raise them with smaller text
- Container borders should contrast with both the container and the background
- Everything should be aligned with something else
- Colours in a palette should have distinct brightness values
- If you saturate your neutrals you should use warm or cool colours, not both
- Measurements should be mathematically related
- Elements should go in order of visual weight
- If you use a horizontal grid, use 12 columns
- Spacing should go between points of high contrast
- Closer elements should be lighter
- Make drop shadow blur values double their distance values
- Put simple on complex or complex on simple
- Keep container colours within brightness limits
- Make outer padding the same or more than inner padding
- Keep body text at 16px or above
- Use a line length around 70 characters
- Make horizontal padding twice the vertical padding in buttons
- Use two typefaces at most
- Nest corners properly
- Don’t put two hard divides next to each other
As you get bigger resolution on standard sized (computer) screens, increasing px gives you the same physical size of the letters with more and more detail around the edges etc.
1 px = 1 pixel was the original intention but has not been true for a long time now.
The problem is that some people use HDPI screens without (adequate) display scaling - likely to recover screen space from existing bloated desings - and then base their own designs on that. So neither px nor pt end up referring to physical sizes in practice.
Dark/light mode is fine and all, however be wary of accessibility. Note that the US actually even publishes it's own CSS/JS framework similar to bootstrap. I believe (but I am not positive) it is here: https://designsystem.digital.gov/
I don't claim it to be perfect, but the last time I had the opportunity to use it, it put other UI/UX frameworks to shame.
I've talked about this on HN ad nauseum but it was so frustrating to have this issue ignored. I am in a different field now and try not to let my employers know that I can do web stuff because, but if I ever got back into it, I think I would have to have some kind of employment contract section covering YES WE ARE GOING TO DO THIS I DON'T CARE IF IT TAKES MORE TIME with some kind of slideshow presentation everyone would have to endure each year titled "Your Audience Isn't Just Teens with Gigabit Connections Who Have the Visual Capacity to Discern Dust Particles Drifting By."
Whats really nice is it's not just theory, but a ready to deploy system. You don't have to adopt it 100%, but you can drop it into your environment and then tweak it to meet your needs, rather than having to start from scratch.
I use software to build stuff, damn it. I want well-notated and labelled complexity. Stop making my tools look like an elementary school classroom in a dystopian short film.
I've done my fair share of front end dev and I like modern flat designs, however these text-only buttons take it too far.
Pure blacks only exist on OLED, and to a lesser extent with FALD (not relevant for text). What’s worse, IPS panels only have a nominal contrast ratio of 1:1000 or less. #000 already is only dark gray on them. Please, PLEASE, use pure black for text!
> pure white is too bright
I’d argue that the brightness of your display is turned up too high if pure white is too bright. It shouldn’t be brighter than a sheet of white paper held next to it, and normally we don’t claim that those are too bright.
I print a lot of books, and I find that a more "cream" colored paper is much more pleasant to read for an extended period of time. YMMV but if there's more than a paragraph of text involved I'd prefer a lower contrast ratio.
The benefit of white paper is that when you do require high contrast, you don’t need ultra-bright lighting to achieve it.
Standard brightness has a fixed value, adjust contrast in your designs, not in the settings of the screen.
Even if you're just a casual user, you should at least roughly configure colors, color temperature and contrast after changing the brightness.
That comparison makes no sense for emissive light sources such as screens. You could argue it for e-ink displays, but not normal screens where we watch mixed content such as videos and photos - where we want whites to be bright.
It reminds me of a book by Robin Williams (that I remember because of Mork) called "The Non-designers Design and Type Book." I got a lot out of that book because it gave me some visibility into guidelines I wasn't aware of before I read it. It definitely improved the quality and effectiveness of a ton of my work on and off the web.
The idea of alignment in this post reminds me of similar ideas in Williams' book, but there are definitely ideas in the post that aren't in the book.
I definitely will take the advice of another comment in this thread and try to follow more of the author's content.
I think I'll
But the advice to use 16px normal text fonts was probably written by someone on a mac or other hi-dpi display. On Windows and Linux without 4k I find it horrible. So you're shifting from "not large enough for 50% of your users" to "too large for 50% of your users" - unless you know your user's hardware...
The rest is nice but this grinds my gears.
I am not buying OLED only smartphones since first Samsung Galaxy to follow this controversy. Black should be black.
I also agree that pure white should almost never be used in dark mode - it's usually reserved there as a highlight color, for critical warnings that should immediately alert the user.
Particularly padding and margins - I’ve only recently taken the time to study what makes a design look good vs looking off in terms of spacing, and have come to similar conclusions as the author.
I suspect if the rule against pure black on pure white were buried in the middle (or omitted) then the response would be warmer.
I'm not sure why it's so controversial among digital designers.
The same person taught me that "optical alignment is often better than mathematical alignment" (which is why the bottom of curved letters often falls slightly below the baseline if you look closely).
Assuming you're talking about the "Give me #000000 on #FFFFFF or give me death!" crowd, it's a kneejerk reaction to the cardinal sin of gray-on-gray content that is fucking impossible to read.
I happened to have a few iOS apps where true black is an option (which is desirable on OLED to save battery). A perhaps less common concern is eInk whose dynamic range is quite limited and for which #000000/#FFFFFF greatly enhances readability.
This means developer built UIs, documents, etc. could look waaay better by following simple design (typography! included) guidelines.
I believe these guidelines exist, but there's no well defined, available, or well-known "grammar" (as in this type of grammmar https://vita.had.co.nz/papers/layered-grammar.html) and there's no set of rules.
With a proper grammar and rules we could go a very long way. Other examples are
"What every engineer should know about..",
https://semver.org/ etc.
Can you provide an example of a 20% creative decision that has no technical aspects?
These are the things I struggle with when designing generic corporate marking websites. I'm not a designer but I've worn the designer hat many times. I always warn my employer/client that I'm more of a technical designer than a creative one. Nowadays I just stick to application design since it's 100% technical.
Example: as someone who's more technical than creative I could have come up with the overall layout of the Excalidraw+[0] website but I don't think I would have thought about adding circles around keywords or the dashed line that leads users down the page.
For example, once the basic IA is worked out, you could have a phase of the project called "flourishes", where your knowledge of illustrative techniques, eye-tracking, colour theory and UX tricks and so on, guides the design. Along with business needs, communication preferences... Another phase could be "product photography" where knowledge of what makes a good photograph comes into play.
But yeh it's usually easier to get a professional designer who enjoys and does these things all day long!
This is not safe. During the past few years this became a trend, legibility has suffered greatly and eyestrain has increased significantly for me. It gets even worse when combined with `font-weight: 300` - completely unusable.
This is on high quality 4K laptop screen / expensive EIZO FlexScan 32" monitor / Macbook screen - its even worse with other less expensive equipment.
"Near" is also open to interpretation.
Says a website using a painfully-large font size that results in a line length of only ~40-characters ;P. That said, despite using a much more reasonable font size, Hacker News goes out of its way to limit line length to ~40 characters even though there is extra margin it could be using to get up to ~50-60.
Now, I'm sure some people are going to balk and say that this website--and Hacker News--in fact have longer line lengths and I must be crazy, but the reason they look the way they do to me is because I am reading this on a phone... as are most people doing most of everything they do these days: using actual computers is now somewhat rare.
However, I honestly have no issue reading with a ~40 character line length! In truth, I am pretty confident that I prefer it to longer 60-80 character lines: I read books on my phone, and I have the font size set to reflow at ~40 characters per line, and if I move to landscape (at the same size) I find that difficult to track as the lines are simply too long.
Now, we might then conclude that this is somehow just obsolete advice caused due to a lot of designers having grown up during a time when people used to have devices (even computers) with larger screens and were maybe more used to seeing long lines of text on large sheets of paper, where obviously everything had longer lines than my narrow phone...
...but no: I'd argue that some of the best typesetters in the field, who had the strongest reason to care about optimizing for legibility and readability, worked for newspapers, and if you pull up a scan of an old paper--whether from the 1980s or the 1860s--you will find that they all prefer ~40 characters per line (and you will find the same with science journals and government registers and most magazines).
I will thereby claim that the only reason we put up with 60-80 character lines is because it feels like a waste on a widescreen monitor to enforce such a narrow column and the technology of scrolling makes it extremely awkward to have multiple columns (as anyone who gets angry at navigating PDF articles--almost all of which are typeset with ~40 characters per line--in a web browser experiences viscerally).
Not so much: https://imgur.com/a/T1hDP8c
I’m doing a ton of web design for documentation and for some reason I’m a little bit obsessed with this kind of thing right now.
Maybe there is an issue on your browser? I get between 70 and 80 characters per line.
Mea Culpa
The "multiples of 8" for spacing and sizes is one such rule I follow and it is easy to remember. Some of the rules in the original article are harder to remember. Though I will remember the 16px as min font size idea.
What does that _actually_ mean? Grey looks more 'natural'?
Notice that this also describes pixels on a display.
I'm guessing that the centroid of the shape isn't the answer.
(The buttons are horrible, but I gave up the hope that modern design will care about usability.)
Huh? Nothing about text on a screen is "natural". "Too bright" is completely meaningless, you have no idea what my motivations are for the brightness settings on my screen. The content should make use of the full range of brightness, and the user can then adjust the contrast to any point in [0, 1] as desired. This is like suggesting that an audio sample should only use 10% of the dynamic range allowed by the file format, because "speakers are too loud".
> some odd shapes have a visual centre that is different from their mathematical centre.
"Mathematical" doesn't really mean anything here. Are you referring to the centroid? If anything that is a "more mathematical" concept than a midpoint. The use of this word here makes it look like you want to eschew the technical perspective in favor of the emotional, aesthetic perspective. But a centroid can be computed.
Same thing with the "too bright". Too bright based on what? Too bright for whom? Doesn't matter. Just follow these opin- I mean rules.
'Mathematical' alignment would mean centering on the basis of width or height, whereaas 'optical' aligment would adjust for the 'visual weight' of the item, which often 'feels' different.
For example, a 100px wide container with a 50px wide image within it, may not be appropriate to sit at the 25px->75px range. It may need to be slightly adjusted depending on the visual mass of the images.
Honestly these are excellent rules for design, and it's a bit funny in fact to see all the comments from people unable to process ostensible ambiguity in the rules, as though they are looking for a 'precision algorithm'.
I would say to anyone having difficulty processing why these are helpful rules, that it would be worth looking into design principless overall, it'll be a fun experience.
The documentary 'Helvetica' is pretty fun.
But apart from that, it is good advice, and I think the post gives a few more good rules of thumb too.
But remember, every rule is just a starting point. If you have a solid understanding of contrast, color, composition, usability, accessibility, and more, you have the freedom to experiment and try new things.
In my professional opinion, standardization and commoditization in design have their pros when it comes to production and usability. However, this approach is leading us towards a bland and uninteresting user experience.
I'm hoping that the emergence of XR will bring back some of the old-school "skeuomorphic" spirit of exploration, expression, and texture in design. If we keep relying solely on "best practices," we risk being replaced by automation.
And please, don't design UI without having a design background. Use some UI library or Tailwind/Bootstrap instead.:)
Maybe it's time overthrow the W3C and invent HTML6 already, and provide for some proper modern UI widgets instead of needing piles and piles of JavaScript UI-library-of-the-month that create widgets by hacking together a clutter-fest of div hell.
Stuff like <hamburger>, <tabset swipeable="true">, <img pinchzoomable="true" onclick="window.lightbox(this)" lowsrc="..." highsrc="..." ultrahighsrc="...">, <ul pulltorefresh="true" onrefresh="foo()"> should be part of it already, <button> should have more sane margins, font, contrast, and border radius choices by default, <hr> should be low contrast by default as the article says, and the default background and text colors should be #f2f2f2/#222222, and not #ffffff/#000000. Visual centering should be implemented in CSS with a neural net. Let's get standards with the beat.
Actually, I am utterly baffled that this is not the target of current neural net implementation. I expected some form of automation to emerge in this field first.
Instead, someone decided, that investing in generative "A.I." art and removing the human element from the illustration process is more important.:)
In the world of lean development and design sprints, the quality of UI is not the important part.
Maybe in the near future, only the best designer will survive the shift.
In printed photographs, on the other hand, all four inks can be mixed to produce a darker black than is seen in the surrounding text ("rich" black). Thus, in newspapers, the contrast ends up being higher in photos than in text.
But this is due to limitations of paper printing technology--none of this applies to computer displays, where R/G/B components are always perfectly aligned.
It's not reasonable to constantly change your monitor's settings, especially when you want to display both in the same document.
With HDR content, this is already possible, full brightness in an HDR video will be far brighter than #ffffff in css.
But even for regular media, this is an issue, which is why you should configure your screen for the maximum possible contrast and then reduce contrast of text in software.
If you set text to maximum contrast, you need to reduce contrast in your monitor settings, which then also affects photos (which you obviously don't want).
Should a background be darker than the containers it holds? Or should containers be designed as if they are behind a background, basically a hole in the page?
"Keep body text at 16px or above
16px is the default text size in most browsers. Text below this size gets harder to read, so it’s safest to avoid it for body text. The higher you go beyond 16px, the easier the text is to read."
I'm able to read the content on every site I visit even when it has whitespace and images but to each their own. I'm glad Hacker News serves your needs.
That's the only point on his list that is 100% wrong. The rest is actually spot on.
it seems like standard-of-care tools like tailwind converge to transliterated css in real-world frontends
take something like 'saturate your neutrals' -- to use this automatically, a tool would have to label an element as neutral + figure out the color of the foreground element
'math relationships between spaces' as well -- computers should be great at this (it's math!) but css is doing everything in its power to not run code ever, making it hard
css isn't a tool for theming
also, not sure why this kinda random assortment of 'rules' was picked out to be comprised of these ones, and for them to be listed in this way. it doesn't come together into a more systematic approach, it's just kinda all over the place. (unlike if it was ordered more like, 'this is about space; this is about shapes; elements; colors; text; alignment; containers; clarity; complexity; etc.)
I could go over a list like this and apply every tip to each element of what I might be working on but that's annoying. Font-size vs line-height, element alignment, button contrast and padding etc feel like things that could be automated -- even if it just ends in "hey, I drew a bunch of lines over your page, maybe you find something that looks like it could be moved to one of them".
Does that exist?
I am looking around and this seems to me to be a straight up lie. In fact, I can clearly see the opposite if I look out the window. Objects further away get LIGHTER, not darker.
Very strange to write something so trivially false with such confidence. Like he would have written "objects fall up"!
The brain is known to make use of such cues to gauge depth, and it's used in several optical illusions. (You can even make use of this principle with flash photography techniques to create approximate depth maps for surfaces. It's quite effective.)
I would argue that a model based on close distances of stacked items (e.g. stack bits of card or paper) is generally a better model than one based on large outdoor spaces, as it is a closer analogy in most situations. (Reading on-screen being reading off a relatively-close surface.)
But both can work. Look at screenshots of a game such as Spelunky: dark backgrounds, light foreground objects. The eye is drawn to the lighter surfaces and can ignore the darker background. But if the background was a distant landscape (e.g. Rastan -- don't know why that was my first thought... showing my age!), rather than a relatively close cave wall, your approach of desaturated lighter backgrounds might work just as well, as it would be more realistic. And at night, the opposite would be true.
The one with dark on top looks like a tunnel to me; the one with light on top looks like items layered on each other.
This one seems weird. The left option is much clearer than the right one
Your screen does not reproduce pure black or white. Contrast ratios on LCD displays are already bad enough. No need to make it worse. People have contrast and brightness controls on their displays. Stop making comfort decisions for them. Let the user choose for themselves.
The black on my screen is darker than the darkest dark in my environment, and the white is brighter than looking right into my ceiling lamp.
For all intents and purposes, it does reproduce pure black and white.
For readability, the contrast range should be clamped to that of paper – pure black ink on white paper looks the same as using #444444 on #eeeeee on my (calibrated) monitor.
To compensate for people with misconfigured monitors, extending the range to the colors mentioned in the article makes sense, but not any further, as that's going to be painful to look at.
Please properly configure your monitor instead. To be able to accurately represent images, the contrast of #000000 to #ffffff needs to be much larger than the contrast of any text in any reasonable situation.
It's useful to be able to reproduce colors far beyond the range of print. Not everything IRL is colored by reflective pigments. From sunsets to iridescent birds, there's lots of colors and contrast ranges available in real life that your screen should accurately produce as well.
Am I the only person who enjoys dense text?
If you are interested in diving deeper, there is also a lot of good thinking in the US Web Design System - freely available here: https://designsystem.digital.gov
https://apps.apple.com/us/app/amazon-prime-video/id545519333
I only find this useful to me.
Some others are ok. Some are I already do. Some are just natural (easy to feel that it's off)
I'm a frontender in a two men team and we have a backoffice application that doesn't require nice ui but still would like to see wheter I can improve it with those rules.
The most valuable thing is that it gives me the instruments to think and reason about my designs.
Many thanks to the author!
Programming is a form of expression between a human and a system. We should finally start treating it that way.
Write something beautiful.
sure, I bought a hdr monitor specifically to have graysh blacks and washed out whites.
A UX professional should learn about both perspectives and know how to apply both.
Near black against near white is high contrast.
Some of the best design, art, music, code breaks all the rules.
Don't misunderstand me, boring is good, predictable and comes with less noise. However, there will be fever prices and innovation will suffer.
While the presentation may have struck you as pompous, as far as I can tell, the author is just trying to save people time of researching these things and make it more likely that people won't keep building terrible websites which are hard to read or use.
There are a few things like using slightly off-black or off-white that can be controversial, but overall this reads to me like a great place to start if you don't know any better.