Craig Abbott - The problem with ‘pixel perfect’ design — Transcript
Full transcript
- 0:05Hi everyone. Um, so yeah, I'm Craig. I'm
- 0:08a principal accessibility consultant at
- 0:10Tological. Um, before we start, I always
- 0:14like to just let everyone know that I
- 0:16have ADHD and I'm also autistic. So
- 0:20depending on which side wins, the talk
- 0:21will either end up super clinical or
- 0:23like super erratic. Um, and I've got a
- 0:25lot to get through, so hopefully the
- 0:27ADHD wins. Um, but yeah, I think also as
- 0:30well just to point out when I was
- 0:32talking on the way in about uh what I'm
- 0:34about to talk about, I
- 0:37think given the people who are in the
- 0:39room, I think uh you know hopefully this
- 0:41will just be stuff that you already
- 0:43know. Um but then thankfully Matt did a
- 0:45talk all about stuff that you already
- 0:46know. So I'm just going to ride with
- 0:48that. But yeah uh I want to talk a
- 0:51little bit about pixel perfect design.
- 0:52I've worked in a few organizations where
- 0:55this is a this is a thing uh still where
- 0:58designers get really hung up on
- 0:59everything being pixel perfect and
- 1:01everything being exactly in the browser
- 1:03as it is in the Figma file and and
- 1:05whatnot. And I find it a bit bizarre
- 1:06that this is uh still a thing in, you
- 1:09know,
- 1:122025. So pixel perfect is yeah basically
- 1:15just making whatever's in the browser
- 1:16and whatever's in the Figma file or
- 1:18whatever design file you're using just
- 1:20look absolutely identical. I mean, I've
- 1:22literally seen a designer screenshot the
- 1:25browser and overlay it in a Figma file
- 1:26and be like, "This is 10 pixels out or
- 1:29something." And really, only designers
- 1:31care if something's not pixel perfect.
- 1:32Users don't care. Developers don't care.
- 1:34Product managers don't care. But we
- 1:36spent ages making it look pretty, and we
- 1:38want the final design to reflect our
- 1:40expertise. So often designers are the
- 1:42ones that are the ones pushing it. But
- 1:44Pixel Perfect does cause headaches for
- 1:46developers.
- 1:48Um, lost my water. It's all there. Yeah.
- 1:51Yeah. So developers with pixel perfect
- 1:53design like we find um they write more
- 1:55CSS. They're often having to use
- 1:58override utility classes or writing
- 2:01custom uh CSS to override things that
- 2:03are already there. Um the company that I
- 2:06previously worked at that we had a
- 2:07design system and then there was just
- 2:09loads of um like inline styling being
- 2:13put on the components just to make
- 2:15everything look exactly as the designer
- 2:16wanted it to look. And that creates
- 2:17inconsistencies and it creates headaches
- 2:19for developers.
- 2:21But pixel perfect is an interesting term
- 2:24because perfect is really subjective. Um
- 2:27different designers have different
- 2:28opinions on you know how wide a margin
- 2:31should be. If you ask the same designer
- 2:33on different days they can have
- 2:34different opinions. So like the term
- 2:37perfect is really subjective.
- 2:39So I think also when we talk about
- 2:41pixels um yeah so this again caveat I
- 2:45suppose for this talk is that I find a
- 2:47lot of designers don't necessarily
- 2:49understand pixels um we often think that
- 2:52a pixel is a pixel on a screen like a
- 2:54tiny square or something um I'm assuming
- 2:57everybody in this room knows what I'm
- 2:58about to talk about but um yeah so
- 3:02pixels are basically picture elements so
- 3:04if we take a picture or pix and then we
- 3:06take elements and L's we end up with pix
- 3:08pixels
- 3:10A digital pixel is the smallest element
- 3:12of a digital picture. So if we take this
- 3:15awesome picture of a cat and we zoom in
- 3:18in Photoshop or Figma or whatever it is
- 3:20and we keep zooming in, we eventually
- 3:22get to a pixel which is the smallest
- 3:24element of the image which is a solid
- 3:26block of color. Then we have physical
- 3:29pixels which are the smallest element on
- 3:31a modern display. So again, if we took
- 3:33the nice picture of a cat on a monitor
- 3:34and we zoomed in and zoomed in and
- 3:36zoomed in, we eventually get to a red,
- 3:38green, blue uh pixel
- 3:41element. And this worked really well for
- 3:43about 80 or 90 years because all screens
- 3:45used the same 4 by3 ratio and uh there
- 3:48was roughly a 1:1 mapping. So when they
- 3:50were firing uh electrons at the screen,
- 3:53you know, the RGB um area was roughly a
- 3:56one to one mapping. So everything kind
- 3:57of just worked. Content just scaled up
- 4:00and down. It didn't need to adapt. It
- 4:02didn't need to reflow. It didn't need to
- 4:04do anything. You know, if you put it on
- 4:06a small telly or a big telly, it just
- 4:07looked the same but bigger. But these
- 4:10days, screens are not consistent. So,
- 4:12we've got different dimensions, we've
- 4:14got different aspect ratios, and we've
- 4:15got different pixel
- 4:19densities, physical pixel densities, I
- 4:21suppose I should clarify.
- 4:23And then to complicate matters further,
- 4:25we have CSS pixels which um are abstract
- 4:28units which are calculated by the
- 4:30browser. And these can be made up of any
- 4:32number of physical pixels. So you know
- 4:35when you say 10 pixels, it might not be
- 4:3710 pixels at all. It could be whatever
- 4:39they've the algorithm is trying to work
- 4:41out uh you know how how big to draw
- 4:45it. But CSS pixels do help us make
- 4:48things roughly look the same size on
- 4:50different screens. So um you know if
- 4:53something's roughly arms length away it
- 4:54should all look the same size regardless
- 4:56of how many physical pixels there is on
- 4:58the screen which is helpful but it means
- 5:00this whole term of pixel perfect becomes
- 5:02a little bit uh tricky and this is why
- 5:05pixel perfect design is hard is because
- 5:06pixels are not perfect like one physical
- 5:09pixel is not one digital pixel one
- 5:11digital pixel is not one CSS pixel and
- 5:13one CSS pixel is not the same on every
- 5:15screen so it becomes really difficult
- 5:17when you're trying to explain to a
- 5:19designer why you know they're 10 pixels
- 5:20isn't 10
- 5:22pixels. Um, so moving on to the problem
- 5:25with pixels. Um, as I've just said, you
- 5:29know, like, um, you can draw something
- 5:31out to be 10 pixels on a screen, it
- 5:32might not necessarily be 10 physical
- 5:34pixels wide, but it will always be the
- 5:36same size on a particular screen. So if
- 5:39you in your browser say, I want this
- 5:41thing to be 10 pixels wide, every single
- 5:44time the browser draws that, it'll be
- 5:45the same physical length on the screen.
- 5:50And static measurements by definition
- 5:52are not variable. So for example, if you
- 5:54are instructed to drive a car at 60
- 5:56miles an hour, you will always drive 60
- 5:58miles an hour. It's just a static unit
- 5:59of measurement. And the same with the 10
- 6:01pixels um variable uh sorry the 10
- 6:04pixels uh
- 6:06measurement. But user preferences are
- 6:08not static. So in Chrome for example,
- 6:11the font size can be medium which will
- 6:14be 16 pixels by default. But then you
- 6:17can go into the browser settings and you
- 6:18can change that. So you can have very
- 6:19small text which will be 10 pixels. You
- 6:21can have small text which will be 13.
- 6:23You can have large which will be 20 or
- 6:25you can have very large which will be
- 6:2624. If you're like my dad and you need
- 6:29uh you know everything to just be
- 6:31massive all of the time. You'll go
- 6:32straight in them settings back on 24 and
- 6:34then you'll probably find nothing
- 6:36changes. And this is where static
- 6:38measurements can actually cause some
- 6:40accessibility issues. So things like
- 6:41font sizes and margins and patterns um
- 6:44which are set using pixels will never
- 6:46actually react to the user's browser
- 6:49settings. Um so this is an example of
- 6:52Facebook which does set everything in
- 6:54pixels. And basically if you go into
- 6:57your browser settings and you
- 6:59change small or medium or very
- 7:02large like nothing happens. Um I think
- 7:06in in the dev tools you can see the font
- 7:08size change slightly but that's the only
- 7:10thing that
- 7:12changes. Now using pixels as a static
- 7:15size is not actually a wag failure on
- 7:18its own. Um the web content
- 7:20accessibility guidelines just they care
- 7:22if you can zoom into 200% and then
- 7:24everything doesn't break. But they don't
- 7:26necessarily care whether the content
- 7:28responds to the browser settings.
- 7:30But in situations like my dad, for
- 7:33example, where he has the font size on
- 7:34very large. If he's on his phone and he
- 7:37goes on a website, the font size always
- 7:39just if it's set in pixels, it's just
- 7:41always, you know, the bare minimum, then
- 7:43he has to start trying to zoom in on his
- 7:44phone and then he ends up starting to
- 7:45scroll around in two dimensions and
- 7:47everything's just kind of off. Whereas
- 7:49if it just responded to the browser
- 7:50settings, he'd just be able to scroll up
- 7:51and down and everything had work. So,
- 7:53it's not a technical accessibility
- 7:55failure, but in real life situations,
- 7:57I've definitely seen it where it affects
- 7:58people trying to kind of get around
- 8:00this. And also, um it means that when
- 8:04you're zooming in in the browser, if
- 8:06you're using manual zoom, um like my
- 8:08view shown earlier, it's
- 8:10um it's not a great experience. Like
- 8:13this puts an additional burden on the
- 8:15user. So, every time they go to a
- 8:17website because it doesn't persist
- 8:18across domains. So every time you go to
- 8:20a website, you can zoom in at 200% and
- 8:22you can navigate around that website,
- 8:24but then as soon as you go to a
- 8:25different one, you've got to zoom in at
- 8:26200% again. So the whole thing becomes
- 8:28really tedious. The other thing that is
- 8:31a problem is that it just makes
- 8:32everything bigger. Like when you zoom in
- 8:34on the browser, like borders on inputs,
- 8:37uh like everything just gets bigger. So
- 8:39if you zoom in far enough, you you know,
- 8:40you can be filling in a form and you've
- 8:42got like a 30 pixel border on your and
- 8:44everything just looks a bit trash
- 8:45really.
- 8:47So using relative measurements uh
- 8:50creates a more accessible
- 8:52experience and relevant relative
- 8:54measurements use a reference point. So
- 8:56now if we talk about the car example if
- 8:58you know you're told to drive 1.2 times
- 9:00the speed limit that I realize now this
- 9:02is terrible advice. Don't do
- 9:04that. Drive at the speed limit. It
- 9:06should have been like 0.5 of the speed
- 9:08limit. I realize now yeah don't do this.
- 9:10But yeah if you drove a car at 1.2 times
- 9:12the speed limit. You if you were on a 50
- 9:15mph limit you'd drive 60 miles an hour.
- 9:17If you were in a 60 mph limit, you would
- 9:19drive 72
- 9:20mph. So, common relative units we can
- 9:23use in the browser are percent, m, rims.
- 9:26Um, but percent and m can be
- 9:28challenging. So when I've tried to
- 9:30explain these concepts again normally to
- 9:32designers or um you know people who
- 9:35don't necessarily uh know the ins and
- 9:37outs of browsers and things their
- 9:40reference points change which depending
- 9:42on which CSS properties they're used on
- 9:45means that you can essentially end up
- 9:46with different sizes. So for example 1 M
- 9:49is not 1 M. If you set your font size to
- 9:531m, the font size will use the parents
- 9:56element uh font size to then set itself.
- 10:00But if you use it on a margin, it'll use
- 10:01itself to set the font size of itself to
- 10:04set the margin. So you end up with um
- 10:06these sort of vary variations in what
- 10:09size you might actually get in your
- 10:10design.
- 10:12And m's and percent also suffer from a
- 10:14problem called compounding where because
- 10:17they are using their parent elements
- 10:18when you nest them under themsel, you
- 10:21can end up with exponential results. So
- 10:24if you for example had a child that was
- 10:26supposed to be 2 m and the parent was 16
- 10:28pixels, you'd want the font to be 32
- 10:30pixels. But if you nest a child within a
- 10:33child, the first child becomes the
- 10:35parent. So now it's doing 2m of 32
- 10:37pixels, which will be 64 pixels. And if
- 10:39you nested it again, you'd end up
- 10:41withund I can't do math 28 pixels. I
- 10:44don't
- 10:44know. So yeah, this compounding problem
- 10:47uh can be challenging. So then we've got
- 10:50rims or root m uh which is the font size
- 10:53of the root element uh the HTML tag if
- 10:56you like and that inherits from the
- 10:57browser settings. So this time if we use
- 11:00rims then we can get a nice uh we can
- 11:03get access to those user preferences and
- 11:05we can use this to our advantage.
- 11:08So a rem is whatever the user chooses in
- 11:11the settings. So we said before that
- 11:12could be 16 pixels at medium, it could
- 11:14be very large at 24, it could be very
- 11:16small at
- 11:1910. And one rim does equal one rem. Um
- 11:23so if you set the font size uh in the
- 11:26browser to be 16 pixels and then you use
- 11:30it on font size or margin, then it will
- 11:32emulate whatever it's set in the
- 11:34browser. So everything will be as you
- 11:36kind of expect it to be. So rims don't
- 11:38compound either the same way that um M's
- 11:41and percent do. So we can nest them as
- 11:43deep as we want and it will always kind
- 11:46of work out the way that we expected it
- 11:49to. So this is an example where you know
- 11:53things of margins and font sizes and
- 11:55things have been set up using rem. And
- 11:57now when we change the settings in the
- 11:59browser you'll see that everything just
- 12:01kind of responds to um those things. So
- 12:04you don't have to actually zoom in on
- 12:05the website anymore. you come to this
- 12:07website and uh your font size is set to
- 12:10very large, it'll just respect it off
- 12:11the bat and you don't have to then zoom
- 12:13in and and do all of that
- 12:16stuff. And rims are great, but we still
- 12:19need a system. So, we can replace pixels
- 12:21with rims and things will scale, but we
- 12:24still shouldn't just be sitting
- 12:25squinting at Figman like eyeballing
- 12:27values and just going, I think that's
- 12:28about two rims. Like, we still need a
- 12:30system in place. So, I'm going to talk a
- 12:32little bit about harmonic scale. And
- 12:33this is about to get a little bit weird,
- 12:35but I it is design related, I promise.
- 12:38Um, and people might have heard of
- 12:39harmonic scale or modular scale. There's
- 12:41a really good book called Every Layout
- 12:43by Hayden Pickerin and Andy Bell. Um,
- 12:46where they they talk about this in more
- 12:47depth and they give a lot of um it's a
- 12:50really good book. If you have not read
- 12:51it, I I imagine everyone probably has to
- 12:53be honest in this room, but uh yeah, if
- 12:54you haven't, it's definitely worth
- 12:56looking at. So when we talk about
- 12:59harmony, if we look at the Oxford
- 13:01dictionary, it says it's the combination
- 13:03of simultaneously sounding music notes
- 13:05to produce a pleasing
- 13:06effect. So good music is not random.
- 13:09Like harmonies only exist because of the
- 13:12physics of sound waves. So if you put
- 13:14waves together where their high and low
- 13:16points meet up, they will create
- 13:19harmony. And humans can sense harmony.
- 13:22Like even if you don't understand
- 13:23musical theory, you just know when a
- 13:25note is off. it just feels
- 13:28wrong. So we have these things called
- 13:30harmonic scales which is a defined set
- 13:32of notes that mathematically complement
- 13:34each other to create harmonies. So uh if
- 13:36you're you know learning to play guitar
- 13:38whatever and you learn your scales then
- 13:39you know you can play if you've got to
- 13:40knock a solo out then you can just play
- 13:43any of them notes and they should just
- 13:44work
- 13:45together in theory.
- 13:48So, for example, some notes in the C
- 13:50major scale are C, G, C, and E, and
- 13:53G. And hopefully the sound will come
- 13:56out, but you can play any of the notes
- 13:58in the scale and they'll work because
- 14:02[Music]
- 14:11science.
- 14:13So, you can play them in order. You can
- 14:16play them all together. But
- 14:17mathematically because those waveforms
- 14:18line up, they just sound quite nice. If
- 14:21a single note is not part of the scale,
- 14:23hopefully you'll realize that it just
- 14:25feels not it's a bit makes you feel a
- 14:27bit
- 14:28[Music]
- 14:35uneasy. So yeah, without harmonic
- 14:38scales, making good music would be a lot
- 14:40of trial and error. I mean, you'd
- 14:41literally just be sitting there going,
- 14:42"Nope, that feels wrong. That feels
- 14:43wrong. That feels wrong."
- 14:45And we can apply the same logic to
- 14:47visual design. So if we design using a
- 14:50harmonic scale or it's also known as a
- 14:51modular
- 14:53scale, we start with a a base size or a
- 14:56fundamental and then we use a ratio to
- 14:58calculate the harmonic sizes off the
- 15:00back of
- 15:02it. And choosing uh when you're looking
- 15:05to choose a base size or a ratio, it can
- 15:07depend on the kind of style you're
- 15:08looking for. you know, if you've got
- 15:09quite a uh like a plain website, you
- 15:12might have a a bigger fundamental or you
- 15:14might have a bigger ratio. Uh if you've
- 15:16got a really content dense one, you
- 15:18might want to choose something smaller.
- 15:19But ultimately, it doesn't really matter
- 15:21what fundamental or what ratio you
- 15:23choose, but it is normally better to
- 15:24pick one that's based on a little bit of
- 15:26logic. So 16 pixels can be a good
- 15:28fundamental because that's the default
- 15:30font size in the browser. And 1.5 can be
- 15:33a good ratio because that's the minimum
- 15:34line height that's used to assess text
- 15:36spacing in Wuk 2.2. So that could just
- 15:38be two reasons why you picked those, but
- 15:39you could pick anything that you
- 15:42wanted. Then we multiply and divide each
- 15:45increment to create the scale. So if we
- 15:47start with 16, we would do 16 * 1.5
- 15:49because that's our ratio. And we'd end
- 15:51up with 24 pixels. So the next size up
- 15:53would be
- 15:5524. Then we would take 24 and we would
- 15:57multiply that by 1.5 again and we would
- 15:59get 36. And if we went the other way,
- 16:01we'd take 16, divide it by 1.5, and we'd
- 16:04end up with 10.67. And so on and so
- 16:06forth.
- 16:08So we'd end up with this harmonic scale
- 16:10for design where essentially our
- 16:11waveforms would line up based on the
- 16:13sizes that we'd
- 16:15used and the scale is not linear. So
- 16:18choosing sizes becomes easier as a
- 16:20designer. Like if it just if it looks
- 16:22too big then we just use the next size
- 16:23down and we don't have to sit and
- 16:24eyeball things anymore. And the whole
- 16:26idea of it being not linear means that
- 16:29you don't end up just with increments of
- 16:31like 10 pixels, which is what I assume
- 16:34um some designers would try and do just
- 16:36to to maintain some semblance of
- 16:38control. And I think this is a good
- 16:41point to make is that you know your
- 16:42scale should only need two or three
- 16:44sizes in each direction most of the
- 16:45time. If you end up with too many
- 16:47options, then you're probably trying to
- 16:49cling to too much control and you just
- 16:50need to relinquish it.
- 16:52So in Figma, we can use variables to
- 16:55create a harmonic scale in pixels. So
- 16:57you can actually go into Figma, you can
- 16:59set up a whole bunch of number
- 17:00variables. You can So the only annoying
- 17:04thing about Figma is you can't calculate
- 17:06off another variable. So you can't The
- 17:08only thing annoying about
- 17:14Sorry. The only annoying thing in this
- 17:15context about Bigma
- 17:18[Laughter]
- 17:21um yeah God that that would be an entire
- 17:24talk in itself that we wouldn't get
- 17:25through 30 minutes but yeah in Figma you
- 17:28can do this and you can do math in the
- 17:31um in the input when you are setting
- 17:34your variables but you can't use other
- 17:36variables to calculate off which is
- 17:38annoying. I'd rather just be able to set
- 17:39a variable like scale zero and then do
- 17:421.5 times scale zero. But you can't do
- 17:44that in Figma. But you can set them up
- 17:46and then once they're set up once you
- 17:48can then just uh use them in all of your
- 17:50margins and your font sizes and all that
- 17:51sort of
- 17:52stuff. And in CSS you obviously can use
- 17:55variables. So we can create our harmonic
- 17:56scale and REM. So we can just use the
- 17:58the calculate um function and we can
- 18:01pass in the variables from previously.
- 18:03So we can literally just set the ratio
- 18:06and the um the kind of base scale at the
- 18:09top and then everything else is just
- 18:11done
- 18:13automatically. And if designers and
- 18:15developers are using the same scale,
- 18:17everything ends up automatically in
- 18:19sync. So the designers are in Figma,
- 18:22they're using variable scale one and the
- 18:25developer has variable scale one and
- 18:27then nobody has to really worry about um
- 18:30eyeballing those pixels and and
- 18:32screenshotting the browser and
- 18:33overlaying it in Figma and whatnot. We
- 18:35just trust the system. So a wrap-up
- 18:40um like pixel perfect is an outdated way
- 18:43of thinking about design. like in 2025,
- 18:45we shouldn't be squinting at Figma and
- 18:47just trying to work out if the pattern
- 18:48looks better at 10 or 12 pixels. Like we
- 18:50should just trust the system. I mean,
- 18:52the amount of times where um you know,
- 18:55I've literally been in conversations
- 18:57where two designers are arguing over two
- 18:59pixels. Uh and that just I I cannot
- 19:02grasp why that is a thing in 2025. Um
- 19:06there's obviously better ways to to
- 19:08solve this problem, but designing in
- 19:11systems is better for everybody. like
- 19:12designers spend less time visually
- 19:14balancing designs um and developers
- 19:16spend less time writing custom CSS and
- 19:18overriding all of the stuff that's kind
- 19:20of already in the system. Um and I think
- 19:22as Jerry alluded to earlier, there's a
- 19:24lot of time that gets wasted uh prepping
- 19:27for dev where a designer's job is
- 19:30literally to go through that Figma file
- 19:32and eyeball all of the margins and
- 19:35everything so that the handover is as
- 19:36smooth as possible. And I mean, you
- 19:38know, it takes up to a day sometimes to
- 19:40go through a whole, you know, how how
- 19:41inefficient um can you get
- 19:44really? And scales scale. If everyone
- 19:48just started using bigger screens
- 19:50tomorrow, you can just go in and adjust
- 19:52your ratio and your base size and then
- 19:53everything will just work. If it's set
- 19:56up properly, everything will just scale.
- 19:58Even if the spacing changes, the balance
- 20:01will remain because the scale has been
- 20:03set up to work mathematically.
- 20:07Pixel sizing is still useful for some
- 20:09things though and these are things which
- 20:10shouldn't scale. So if you are putting a
- 20:13border on something and you want it to
- 20:14be three pixels, that's perfectly
- 20:16acceptable. That means that when
- 20:18somebody comes in with their 24 pixel
- 20:20very large size, the border still stays
- 20:22the same. Whereas obviously if you'd set
- 20:23that in rims or whatever would scale
- 20:25with it. So pixels and some absolute
- 20:28positioning like if you want something
- 20:29to be at the top right of the screen for
- 20:31example and it's like 50 pixels down um
- 20:34you don't want to necessarily be using a
- 20:37scalable size there because then when
- 20:38people come in it'll it'll push
- 20:39everything over. So there is still some
- 20:41uses for pixels but it should only be
- 20:44things where everything you want it to
- 20:45remain
- 20:46static. And I guess the if you take
- 20:49nothing away from this talk, take this
- 20:50away and that's that nobody needs an app
- 20:52or a website to be pixel perfect, but
- 20:54everyone needs it to be
- 20:56usable. And that's everything. Thanks.
About this transcript
This page contains the full transcript of Craig Abbott - The problem with ‘pixel perfect’ design by London Web Standards, generated from the public captions YouTube serves with the video. The transcript has 4,018 words across 574 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.
What you can do with it
Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to choose a caption track available on the video.
Free YouTube transcript tool
YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, caption language selection, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.