WEBVTT

00:00:00.017 --> 00:00:03.877
As the front end developer, you have to look at the design and try to decide

00:00:03.877 --> 00:00:08.597
how much am I going to translate into like directly based on what they have?

00:00:08.677 --> 00:00:12.577
Or how much am I going to transform a little bit in the translation to make

00:00:12.577 --> 00:00:13.757
it adapt better to the web?

00:00:14.817 --> 00:00:18.897
But we do need an infinite list view on the web. We need something that is competitive

00:00:18.897 --> 00:00:23.297
with a UI table view that they have on native and, you know, React.

00:00:23.497 --> 00:00:27.437
The whole reason React got invented like 12 years ago or whatever was for an infinite list.

00:00:28.257 --> 00:00:30.557
Thank you, dude. That was my thing. I was like, here's a big problem.

00:00:30.697 --> 00:00:34.437
I guarantee 90% of the people in this crowd, even though you're all CSS professionals,

00:00:34.617 --> 00:00:38.277
don't have this property on your site and it's making your site look bad.

00:00:38.320 --> 00:01:02.960
Music.

00:01:05.237 --> 00:01:14.317
Revision 672 we are three people two from the team one is vanessa hello vanessa hi,

00:01:15.097 --> 00:01:20.197
my name is shep and that means we have a guest and that guest is adam argyle

00:01:20.197 --> 00:01:26.837
hello adam hello happy to be here yeah thank you for joining us from seattle

00:01:26.837 --> 00:01:29.757
and also across not just the pond,

00:01:29.897 --> 00:01:32.417
but also all kinds of time zones.

00:01:33.137 --> 00:01:34.997
Very cool that we could make this happen.

00:01:36.228 --> 00:01:43.188
You have been guest with us already, but we looked up when that was,

00:01:43.288 --> 00:01:46.548
and that was 2020, so five years ago.

00:01:47.208 --> 00:01:52.728
So our guess is that a lot of our listeners, and maybe also listeners that just

00:01:52.728 --> 00:01:55.768
listened to this episode, won't know you.

00:01:56.108 --> 00:02:00.248
So would you maybe tell us who you are and what you're doing?

00:02:01.128 --> 00:02:05.308
Yeah, of course. Oh, I can't believe that was like CSS4 five years ago.

00:02:05.308 --> 00:02:08.288
Now we're on CSS5. There's been a whole bunch of stuff that's happened. Woo!

00:02:09.308 --> 00:02:14.228
My name's Adam Do, and I hail from the States. I'm on the West Coast,

00:02:14.328 --> 00:02:15.528
the best coast, the fresh coast.

00:02:16.188 --> 00:02:22.588
I'm just a kind of excited, easy-going UI developer. I love sweating all the details.

00:02:23.008 --> 00:02:28.288
I like nerding out about border radius and, you know, nested border radius and

00:02:28.288 --> 00:02:32.068
all the weird little things that can happen along the way of making a desirable

00:02:32.068 --> 00:02:35.668
user experience. I just want to make UIs that people go, oh,

00:02:35.888 --> 00:02:36.988
that wasn't just functional.

00:02:37.408 --> 00:02:41.168
That was kind of delightful. Or there was a moment there where I didn't feel

00:02:41.168 --> 00:02:44.688
like I was making a business transaction. I was entertained by the cute little

00:02:44.688 --> 00:02:45.808
bird that flew by or something.

00:02:46.308 --> 00:02:50.888
And so I've just always spent my time acquiring skills and tools so that I can

00:02:50.888 --> 00:02:54.588
make nice user experiences. And sometimes that means getting into the back end.

00:02:55.048 --> 00:02:59.008
Sometimes in the front end, it doesn't matter. I'll do what it takes to make

00:02:59.008 --> 00:03:03.748
a good user experience. And that's led me to a lot of focus on CSS because a

00:03:03.748 --> 00:03:06.308
lot of people don't focus on CSS and you need someone to.

00:03:06.428 --> 00:03:10.448
And so I always stepped in and was happy to learn the skills and learn the language

00:03:10.448 --> 00:03:13.608
to, again, just deliver delightful user experience.

00:03:13.708 --> 00:03:17.328
And so it's a little bit about me. I was at Google for seven years, but I'm not anymore.

00:03:18.836 --> 00:03:24.716
Yeah, and I think you also picked the right topic because I would say since

00:03:24.716 --> 00:03:27.316
you concentrated on CSS,

00:03:27.756 --> 00:03:37.916
CSS really went off and went through the roof with features and new developments and advancements.

00:03:38.176 --> 00:03:42.176
So CSS is the new JavaScript, maybe?

00:03:42.856 --> 00:03:46.776
Yeah, I think so. I even showed up and that's kind of how I got that role on

00:03:46.776 --> 00:03:50.556
Chrome doing CSS was I was like, hey, you have like six people doing JavaScript

00:03:50.556 --> 00:03:52.936
dev rel things. Where's the CSS one?

00:03:53.516 --> 00:03:59.396
And they were like, you do it. And I was like, nope, I don't have any skills doing this, whatever.

00:03:59.556 --> 00:04:02.776
Anyway, I got talked into it and I already loved the language.

00:04:02.936 --> 00:04:08.356
So at that point, it's just learning how to dev rel. But yes, I didn't do all the work.

00:04:08.496 --> 00:04:12.376
That's definitely not the case. But I do feel like Like I lit a fire under it

00:04:12.376 --> 00:04:16.836
at Chrome specifically and said there's more work to do here and there's a lot

00:04:16.836 --> 00:04:19.636
of value that we can get out of this for users and developers.

00:04:20.116 --> 00:04:24.036
And that pitch really resonated with them for a long time. And I was happy to see that grow.

00:04:25.116 --> 00:04:31.756
Yeah, and also I have the impression that the whole focus also of the DevRel

00:04:31.756 --> 00:04:35.316
team moved a lot more towards CSS.

00:04:37.296 --> 00:04:43.876
So, yeah. Yeah. And you were DevRel, which means basically you were in touch with us developers,

00:04:44.536 --> 00:04:54.156
like feeding back the wishes and all the real world problems that we have to the team.

00:04:54.396 --> 00:04:58.316
And the other way around, you also took the new stuff and explained it. Yeah.

00:04:59.706 --> 00:05:04.646
I did. And that was really fun. Yeah, I have years and years of developer interview

00:05:04.646 --> 00:05:10.126
experience just in my mind, from designers to developers to product managers

00:05:10.126 --> 00:05:14.406
to project managers to anyone kind of working to build something on the web.

00:05:14.906 --> 00:05:20.406
I did. I kept friction logs. I kept notes like, okay, so I focused on scroll for five years.

00:05:20.526 --> 00:05:25.486
And that's because five years ago, I noticed very much so that scroll was difficult

00:05:25.486 --> 00:05:28.426
or that scroll wasn't competing well with native apps.

00:05:28.486 --> 00:05:31.626
For example, native apps had well they had multi-threading and

00:05:31.626 --> 00:05:34.486
they had uh over scroll effects and scroll driven

00:05:34.486 --> 00:05:37.346
animations and all the stuff that we didn't have and i

00:05:37.346 --> 00:05:40.866
categorized it all i made a big old list and then went down to that list and

00:05:40.866 --> 00:05:43.266
they were like well we can't ship all those features and i was like well here's

00:05:43.266 --> 00:05:48.606
the top five most meaningful ones and that's what spawned uh things like scrolling

00:05:48.606 --> 00:05:55.626
to view uh with like additional options the scroll markers and scroll buttons as well as scroll start.

00:05:55.986 --> 00:05:58.606
It's just the ability to like start the scroll. Anyway, it's just like all of

00:05:58.606 --> 00:06:01.206
these were born out of problems that users had.

00:06:01.506 --> 00:06:04.846
And you're right. I would walk those through and then I'd be the first developer

00:06:04.846 --> 00:06:08.686
to try the feature in Chrome and make sure it was validating and solving the

00:06:08.686 --> 00:06:12.646
problems that we set out to fix and eventually get on stage and show everybody

00:06:12.646 --> 00:06:17.086
the cool stuff that's in the web platform they asked for because they allowed us to interview.

00:06:17.206 --> 00:06:20.646
So a lot of kudos goes out to people just allowing me to interview them.

00:06:21.246 --> 00:06:24.006
And yeah, I missed that about it. It was really cool staying in touch

00:06:24.006 --> 00:06:27.166
with so many developers all the time very very meaningful stuff

00:06:27.166 --> 00:06:30.326
yeah yeah i remember that uh

00:06:30.326 --> 00:06:38.286
once you gave this uh old snap talk at css day uh just about scrolling and and

00:06:38.286 --> 00:06:47.066
it was like you didn't just show features but you like you i wouldn't say misused

00:06:47.066 --> 00:06:49.506
you had like a lot of tricks.

00:06:51.146 --> 00:06:58.466
That you showed which were in retrospect they were like okay it makes total sense,

00:06:59.796 --> 00:07:04.956
you have to think of this and like these these things where you have this um

00:07:04.956 --> 00:07:11.036
i know i remember you had these pseudo elements at the start and end of scroll

00:07:11.036 --> 00:07:14.676
areas which were like extra space,

00:07:15.316 --> 00:07:23.176
but they wouldn't snap so that made like a bit elastic um if you you could scroll

00:07:23.176 --> 00:07:29.356
further than like the end that that so and that was or you also had this pull

00:07:29.356 --> 00:07:31.156
to refresh thing that you showed.

00:07:33.176 --> 00:07:36.156
Yeah uh yeah you blew

00:07:36.156 --> 00:07:39.176
blew my mind oh you were in that talk too because

00:07:39.176 --> 00:07:42.096
you blew my mind with your keyframe hacky trick

00:07:42.096 --> 00:07:45.236
to make uh carousels auto progress

00:07:45.236 --> 00:07:48.156
i think was the deal right and it could pause with css and

00:07:48.156 --> 00:07:51.416
is this the whole thing with css with buttons yeah that

00:07:51.416 --> 00:07:54.316
was a very wild demo too um but yeah over scroll effects

00:07:54.316 --> 00:07:57.356
i still use that one all the time making that elastic effect uh it

00:07:57.356 --> 00:08:00.116
was in my talk at css day and i was like hey it doesn't all have

00:08:00.116 --> 00:08:02.876
to be business because like that's a good business use case right like

00:08:02.876 --> 00:08:05.736
oh add a nice little moment of elastic delight to

00:08:05.736 --> 00:08:08.536
a scroller oh isn't that so fancy and so in the talk

00:08:08.536 --> 00:08:11.236
at css day i was like hey those are cool they're fancy they're great

00:08:11.236 --> 00:08:13.956
but also you can make it silly and i showed one

00:08:13.956 --> 00:08:16.856
where my face uh as you scroll

00:08:16.856 --> 00:08:20.096
that overscroll effect i scroll driven animation

00:08:20.096 --> 00:08:23.696
uh my face into the thing and it's like me doing this like really dorky face

00:08:23.696 --> 00:08:26.976
saying something like yeah and so you get to the end of the scroller and as

00:08:26.976 --> 00:08:29.656
you overscroll it it's like yeah and then you go back to the beginning anyway

00:08:29.656 --> 00:08:32.176
i should have added a soundbite into it it would have been really funny but

00:08:32.176 --> 00:08:36.116
it's not all business some of this stuff but you're right scroll is littered

00:08:36.116 --> 00:08:37.856
with fun little quirks that you can,

00:08:38.436 --> 00:08:42.836
call them hacks or call them features it's up to you um but knowing that they're there It's creativity.

00:08:43.536 --> 00:08:49.916
They were not hacks. It was just assembling things that were there in a new

00:08:49.916 --> 00:08:52.536
way and that nobody thought of before.

00:08:53.657 --> 00:08:57.917
Yeah, but this is also what makes CSS so beautiful. And listening to you now,

00:08:58.017 --> 00:09:01.237
it reminds me of Zelda Breath of the Wild, not Breath of the Wild,

00:09:01.377 --> 00:09:02.337
but Tears of the Kingdom,

00:09:02.637 --> 00:09:09.057
where they gave you the possibility to build stuff with hundreds of items.

00:09:09.557 --> 00:09:12.797
And the community just started.

00:09:12.797 --> 00:09:19.497
And I don't believe that Nintendo could foresee that the community will come up with.

00:09:19.497 --> 00:09:28.457
And I think it was on day three where this very cheap plane was already created,

00:09:28.457 --> 00:09:31.117
which was extremely powerful, but so simple.

00:09:31.337 --> 00:09:37.897
And then people just started to create so many very interesting and creative things.

00:09:37.957 --> 00:09:45.737
I do enjoy this revision now. My only problem in my day-to-day life is that

00:09:45.737 --> 00:09:50.157
I hear about these CSS tricks, not hacks, but tricks.

00:09:51.397 --> 00:09:57.897
But Adam, you also provided a list of CSS attributes that we could go through today.

00:09:58.097 --> 00:10:04.297
But I think I have used none of those in my real life.

00:10:04.737 --> 00:10:08.917
What about ScrollSnap? Any ScrollSnap in your regular day? Scroll snap,

00:10:09.257 --> 00:10:12.057
yes, but only with a library, I think.

00:10:12.297 --> 00:10:17.497
No, I replaced a library with it, but this was really everything.

00:10:17.897 --> 00:10:22.037
So I did not use the rest yet. And that always makes me a bit sad,

00:10:22.157 --> 00:10:24.517
but I'm always very happy if people talk about them.

00:10:25.786 --> 00:10:28.526
Awesome. And yeah, you touch on one of my favorite things about CSS too.

00:10:28.666 --> 00:10:31.926
You ask 10 different CSS developers how to accomplish something.

00:10:32.066 --> 00:10:35.226
You get 10 different results. Yes. Each be unique and fun.

00:10:35.486 --> 00:10:38.626
And I think about it like it's the same thing why I like making design tools

00:10:38.626 --> 00:10:42.926
or I like working on tools that enable expression because that's what we're talking about.

00:10:43.046 --> 00:10:47.206
Oh, the human shows up to all these kind of otherwise useless parts.

00:10:47.366 --> 00:10:50.986
And then we put them together and we express something unique and fun.

00:10:51.106 --> 00:10:56.146
And in Zelda, we were making hover cars or I made a hover motorcycle.

00:10:57.426 --> 00:11:01.066
Yeah, the hover bike was really cool. I was like, yeah, hover bike.

00:11:01.746 --> 00:11:04.606
I tried to make a one wheel. It didn't work out very good because it didn't

00:11:04.606 --> 00:11:07.586
balance very good. But I think there's the balancing thing you can stick on there to stay balanced.

00:11:07.726 --> 00:11:11.546
Anyway, yes, I love expressing and just like being creative and taking things

00:11:11.546 --> 00:11:14.706
that maybe they didn't see would work, which is kind of like music too.

00:11:15.086 --> 00:11:18.526
Music, you get these really blunt building blocks, you know, notes.

00:11:18.706 --> 00:11:20.846
Oh, here's notes in a scale. Here's a chord. And then you're like,

00:11:20.886 --> 00:11:21.826
what am I supposed to do with those?

00:11:21.926 --> 00:11:24.806
And you're like, well, look at this person over here they're making

00:11:24.806 --> 00:11:28.406
them sing and you're like whoa expression human

00:11:28.406 --> 00:11:31.566
expression is so so cool and yeah

00:11:31.566 --> 00:11:36.726
css sits right in there with the some of the highest most impressive expressive

00:11:36.726 --> 00:11:42.126
capabilities that we have on our little digital screens and yeah i love it what

00:11:42.126 --> 00:11:49.346
i want also want to say as i meant um that i don't use it in my um work life i don't want to say that.

00:11:50.726 --> 00:11:54.466
These are only creative only artsy

00:11:54.466 --> 00:11:57.346
css attributes that you don't need

00:11:57.346 --> 00:12:00.666
in your business life but my personal

00:12:00.666 --> 00:12:03.946
problem is also to come across the new features

00:12:03.946 --> 00:12:11.926
that css might have and to know where can i use it how can i test it um so i'm

00:12:11.926 --> 00:12:15.406
just very happy that we now have the chance to talk about them and also talk

00:12:15.406 --> 00:12:21.526
about maybe real-life business cases where we might need these where we might need to implement,

00:12:22.383 --> 00:12:25.303
css that behaves like this then maybe it's

00:12:25.303 --> 00:12:28.563
also a bit problematic if you usually in businesses

00:12:28.563 --> 00:12:31.783
have uh ux or ui design

00:12:31.783 --> 00:12:37.243
prepared and then also from a developer perspective come in and say hey i have

00:12:37.243 --> 00:12:41.783
additional ideas how we can make it behave a bit more smooth maybe we change

00:12:41.783 --> 00:12:47.943
the ui design a bit so we can also support a bit of snapping or any of these

00:12:47.943 --> 00:12:51.363
other functionalities that we have now Yeah, you're right.

00:12:51.483 --> 00:12:56.683
There is definitely a tension or a collaborative moment to happen between design and development.

00:12:56.883 --> 00:13:00.643
And yet designers often don't know what's available on the web because they're limited by their tools.

00:13:01.243 --> 00:13:06.583
Figma is not a web design tool. It's a tool to make native app designs or any kind of design.

00:13:06.703 --> 00:13:11.363
So it's not enabling designers to reach into the coolest parts of the web platform.

00:13:11.983 --> 00:13:16.223
And yeah, I think you nail something very specific, which is great,

00:13:16.423 --> 00:13:20.403
that we need business use cases for these things. You know, they can't just be cool.

00:13:20.503 --> 00:13:23.783
Like here in our list, we have at function and at mix in.

00:13:24.103 --> 00:13:27.343
Those don't really have business use case other than, you know,

00:13:27.563 --> 00:13:31.383
developer ergonomics and making them faster and delivering less.

00:13:31.523 --> 00:13:33.463
I mean, you could like argue that that's a business use case,

00:13:33.563 --> 00:13:38.743
but it's not as easy as something like scroll state, which I think has great business use case.

00:13:38.863 --> 00:13:41.823
Color contrast has great business use case. These things can kind of be added

00:13:41.823 --> 00:13:44.003
like, or even scroll buttons.

00:13:44.283 --> 00:13:46.583
That's one of my favorite ones. That's an overflow five.

00:13:47.183 --> 00:13:50.663
You don't have to write JavaScript or anything. You can add buttons onto the

00:13:50.663 --> 00:13:52.903
scroll area, which is CSS.

00:13:53.283 --> 00:13:56.843
And those can bring a lot of value to the scenario, but designers aren't going

00:13:56.843 --> 00:13:58.343
to ask you for CSS scroll buttons.

00:13:58.463 --> 00:14:01.503
So you're right. As the front-end developer, you have to look at the design

00:14:01.503 --> 00:14:07.763
and try to decide how much am I going to translate directly based on what they

00:14:07.763 --> 00:14:11.803
have, or how much am I going to transform a little bit in the translation to

00:14:11.803 --> 00:14:13.123
make it adapt better to the web?

00:14:13.483 --> 00:14:18.203
And yeah, these are some of the hard parts of front-end development is you never

00:14:18.203 --> 00:14:22.583
get the complete picture from anyone, you always have to kind of go in there and finish it, right?

00:14:24.343 --> 00:14:27.203
That's when I always go add animations. I'm like, I'm going to transition this

00:14:27.203 --> 00:14:31.063
little state change right here. They didn't ask for it, but it's only one more line of code.

00:14:31.723 --> 00:14:37.403
But yeah, those are tough things to decide. Is there business value in this thing? And I don't know.

00:14:37.563 --> 00:14:42.563
It's kind of like these what's new in CSS podcasts or just episodes can be really good for you to hear.

00:14:43.483 --> 00:14:47.663
Maybe one day I'll get asked to do something and then I heard about that feature

00:14:47.663 --> 00:14:51.343
and now i know that it's there for me and so i think about these things is at

00:14:51.343 --> 00:14:54.043
first when you're learning about these things just put them in your tool belt

00:14:54.043 --> 00:14:58.483
you know you don't have to use it yet but just know it exists and that'll help

00:14:58.483 --> 00:15:01.143
you uh for when the time when the time comes,

00:15:02.263 --> 00:15:07.803
yeah and it's also cool if you do some kind of demos and brownback sessions

00:15:07.803 --> 00:15:14.483
for your colleagues so that they also learn about it and then maybe they deliver

00:15:14.483 --> 00:15:18.703
a design that uses it so that's really cool and and the business values.

00:15:20.331 --> 00:15:24.891
Could also one business value could be you have to ship less javascript so that's

00:15:24.891 --> 00:15:30.451
also cool so even if on the surface everything is the same as before but you

00:15:30.451 --> 00:15:32.591
ship less javascript that's already,

00:15:33.611 --> 00:15:39.411
like i or at least for me that's an improvement and it's also more robust,

00:15:40.791 --> 00:15:44.151
because css gets evaluated constantly so you

00:15:44.151 --> 00:15:46.931
don't have to like for example if you have a i remember back

00:15:46.931 --> 00:15:50.871
in the days when you did javascript uh slider and

00:15:50.871 --> 00:15:53.951
you had maybe like on desktop there were two elements

00:15:53.951 --> 00:15:56.851
sliding at once and then on mobile you had

00:15:56.851 --> 00:15:59.551
just one because the viewport was small then you had

00:15:59.551 --> 00:16:02.871
to like like destroy and re-instantiate this

00:16:02.871 --> 00:16:06.731
the thing when when like the screen went from

00:16:06.731 --> 00:16:12.311
i don't know if you rotated the phone from like a portrait to landscape or these

00:16:12.311 --> 00:16:18.611
things um or at least if i wanted to do it correctly so maybe some people didn't

00:16:18.611 --> 00:16:25.631
um and that was yeah not a nice developer experience to to wield these scripts.

00:16:27.131 --> 00:16:30.251
Yep that was a lot of overflow five so scroll markers

00:16:30.251 --> 00:16:33.691
and scroll buttons and scroll start or now

00:16:33.691 --> 00:16:36.691
it's called scroll initial target these things are all so

00:16:36.691 --> 00:16:39.471
that um javascript can get out of the way so that you

00:16:39.471 --> 00:16:42.631
can deliver a scrolling experience that resizes

00:16:42.631 --> 00:16:45.511
to the viewport that has buttons that move it back and forth and have little

00:16:45.511 --> 00:16:50.931
dots all from css and they're just nice to haves and now if your user's browsing

00:16:50.931 --> 00:16:54.931
without javascript enabled they also get a carousel through the you know 50

00:16:54.931 --> 00:16:58.391
images or or whatever it is that you're kind of carouseling them through and

00:16:58.391 --> 00:16:59.391
it's responsive they turn their

00:16:59.391 --> 00:17:03.471
phone no javascript has to execute just regular page layout and totally,

00:17:04.051 --> 00:17:05.711
hit the nail on the head with that one yep.

00:17:06.990 --> 00:17:10.630
So uh yeah maybe we should start diving

00:17:10.630 --> 00:17:13.990
in uh so i think it's not like super grouped

00:17:13.990 --> 00:17:16.690
the list that we have like i think we have

00:17:16.690 --> 00:17:19.610
like some scroll things here some scroll

00:17:19.610 --> 00:17:22.990
things there but the first one is already

00:17:22.990 --> 00:17:30.290
like yeah absolutely brilliant the contrast color well or in this case it's

00:17:30.290 --> 00:17:35.870
color contrast the color contrast function but there's also contrast dash color

00:17:35.870 --> 00:17:42.470
function so maybe we could start with the white why is there like these two even like,

00:17:43.130 --> 00:17:45.930
oh it got renamed so i think you're remembering the old

00:17:45.930 --> 00:17:48.750
one contrast dash color okay i thought

00:17:48.750 --> 00:17:52.450
it's still like alive and just kind

00:17:52.450 --> 00:17:55.650
of paused for now well the

00:17:55.650 --> 00:18:00.810
whole function was supposed to be paused uh contrast color for two reasons the

00:18:00.810 --> 00:18:07.690
biggest reason being that the The WCAG contrast algorithm was made in the 90s

00:18:07.690 --> 00:18:13.070
and is not as good as we'd like it to be.

00:18:13.270 --> 00:18:16.830
Or at least the CSS working group was like, hey, there's too many times where

00:18:16.830 --> 00:18:21.930
the WCAG guideline or the WCAG function gives you a color that's actually less

00:18:21.930 --> 00:18:23.110
readable than another color.

00:18:24.110 --> 00:18:28.430
Because it's a math operation. And it was a math operation made in the 90s to

00:18:28.430 --> 00:18:30.470
perform very quickly because our computers were slower.

00:18:30.470 --> 00:18:36.250
And so there's been work to be done to make new ones, a new contrast algorithm

00:18:36.250 --> 00:18:41.030
that would be more accurate for human eyes as opposed to just luminance in math.

00:18:41.910 --> 00:18:49.450
And they're pretty much all theories or none artificial parts of the WICIG 3.0.

00:18:49.570 --> 00:18:52.250
So, there was one about to be, and it was called APCA.

00:18:52.430 --> 00:18:56.970
It was the Advanced Perceptional Contrast Algorithm that was supposed to overtake

00:18:56.970 --> 00:19:03.210
the WICIG one, but that's a whole conversation on its own about why that didn't go through.

00:19:03.350 --> 00:19:08.630
But anyway, so contrast color now does use the WICIG 2.0 algorithm.

00:19:08.630 --> 00:19:12.810
Kind of regrettably that people in the working group didn't want to support that and so the,

00:19:13.970 --> 00:19:18.690
compromise that got made was the contrast color or the color contrast function now,

00:19:19.670 --> 00:19:25.490
exclusively in terms of it's version one that's been shipped in two browsers now is just to return,

00:19:26.270 --> 00:19:32.830
black text or white text given a color that you pass in and the the bummer is

00:19:32.830 --> 00:19:37.790
is it'll still return you the wrong text color in certain situations.

00:19:39.210 --> 00:19:42.110
But it's only those situations when it's like right on the edge,

00:19:42.230 --> 00:19:48.130
you know, like, oh, if you go one more hue nudge on this color, it becomes white text.

00:19:48.250 --> 00:19:50.770
And if you nudge it, the hue, the other direction becomes black text.

00:19:50.990 --> 00:19:54.250
And sometimes it'll choose black text incorrectly or something like that.

00:19:54.350 --> 00:19:58.670
But that's the current function we have. But the original function was not just

00:19:58.670 --> 00:19:59.850
to return black or white text.

00:19:59.910 --> 00:20:04.370
It was going to return you a color from your design system. You could pass it

00:20:04.370 --> 00:20:06.510
10 colors, for example, like here's all my blues.

00:20:06.950 --> 00:20:12.370
Here's the background that this text is on. Pick the best light blue to fit

00:20:12.370 --> 00:20:15.430
on this background, given the user's contrast preferences.

00:20:16.330 --> 00:20:20.750
And that just ended up being way too complex. And so for now,

00:20:20.910 --> 00:20:25.070
we have the very simple one that just returns white or black text based on a

00:20:25.070 --> 00:20:27.590
color using the Wicked 2.0 algorithm.

00:20:27.850 --> 00:20:33.770
But one day, we might have a very powerful one that can be very dynamic and

00:20:33.770 --> 00:20:38.450
take your contrast settings so that maybe you have low contrast preference in

00:20:38.450 --> 00:20:41.090
your users or high contrast preferences in your user settings.

00:20:41.330 --> 00:20:45.390
This function could take those into account automatically and calculate a meaningful

00:20:45.390 --> 00:20:50.990
text color for users just in time and pull something from your design system

00:20:50.990 --> 00:20:55.210
because usually a designer doesn't make white or black text these days at least.

00:20:55.410 --> 00:20:58.250
Usually it's a very, dark blue or it's a really really light

00:20:58.250 --> 00:21:04.270
blue if your theme is blue so it's a little useless to some designers anyway

00:21:04.270 --> 00:21:08.470
that's me i just there's a really long explanation of some color contrast yeah

00:21:08.470 --> 00:21:14.630
well but i don't think it's i don't think that it is useless at all i i remember

00:21:14.630 --> 00:21:17.390
that i had a real use case years ago.

00:21:18.127 --> 00:21:22.827
And it was not so everybody who is right now listening thinking of why do I

00:21:22.827 --> 00:21:26.667
need a function for that that is calculating a color because I could also preset

00:21:26.667 --> 00:21:31.007
colors like here are my 10 background colors and for this you use white and

00:21:31.007 --> 00:21:33.387
for those you use black text.

00:21:33.387 --> 00:21:39.027
But we had a feature where users could set their background color.

00:21:39.287 --> 00:21:44.487
And yes, we did start with a fixed set of colors for them to choose.

00:21:44.487 --> 00:21:48.527
So we can have control about their text color then.

00:21:48.807 --> 00:21:54.087
But then one week the feature was out and users were asking, we want this colors.

00:21:54.227 --> 00:21:57.767
It needs to match my brand color, my brand, not your orange, my orange.

00:21:57.887 --> 00:22:01.907
Exactly, my brand color, my brand color. And I'm like, I cannot go to the code

00:22:01.907 --> 00:22:06.127
base in the front end and write your company name inside and say,

00:22:06.287 --> 00:22:08.847
if this company, then those colors, please.

00:22:09.107 --> 00:22:12.767
And we don't have time in the back end to implement it like this.

00:22:12.887 --> 00:22:15.247
And so here's a color picker.

00:22:15.467 --> 00:22:18.687
Just choose whatever background you would like to have.

00:22:18.827 --> 00:22:23.327
And then here's a color picker for the text color or maybe just white and black.

00:22:23.327 --> 00:22:28.947
But so you think it might be a simple task to ask for, just use a contrast color,

00:22:29.147 --> 00:22:31.427
please. But no, not a simple task.

00:22:31.787 --> 00:22:36.247
So then we get bug reports. Hey, I cannot read the text on your website.

00:22:36.247 --> 00:22:39.167
I'm like, yes, because you chose this background color.

00:22:39.887 --> 00:22:44.447
But this is user experience. And of course, in the moment when I get this bug

00:22:44.447 --> 00:22:47.087
report, I'm like, this is not a technical error.

00:22:47.507 --> 00:22:52.327
But still, it is a user experience. And it would have been great if I could

00:22:52.327 --> 00:22:55.587
have used the function like this at this point.

00:22:55.767 --> 00:23:01.187
Also understanding, I think, there are background colors where you might never

00:23:01.187 --> 00:23:05.347
have a good contrast, neither with middle of gray, probably.

00:23:07.569 --> 00:23:10.509
Yep those all those scenarios are there and so that i'd used

00:23:10.509 --> 00:23:13.409
to talk to facebook about that because they have facebook groups or whatever and

00:23:13.409 --> 00:23:16.149
groups can set any color that they want and they have

00:23:16.149 --> 00:23:19.469
a wild back-end pipeline of javascript functions

00:23:19.469 --> 00:23:23.109
that convert the hex color into oklch or

00:23:23.109 --> 00:23:27.929
an lch equivalent and they try to dynamically generate a palette for that facebook

00:23:27.929 --> 00:23:33.569
group based off the color and they're managing all of this infrastructure just

00:23:33.569 --> 00:23:40.929
to deliver good accessible color palettes to a dynamic user-based color picker of their website.

00:23:41.149 --> 00:23:45.409
So yeah, it's a tough problem. And I agree color contrast comes in really handy

00:23:45.409 --> 00:23:47.029
there and it would have automated a lot of it.

00:23:47.489 --> 00:23:50.309
But yeah, it just depends on how robust you want to control all the colors.

00:23:50.469 --> 00:23:52.869
If black and white are fine for you, then you're good to go.

00:23:53.069 --> 00:23:56.229
I also shared in our notes here, my proposal for contrast color,

00:23:56.389 --> 00:23:59.289
because I was one of the original people that proposed

00:23:59.289 --> 00:24:02.449
this and this was proposed uh in css color the

00:24:02.449 --> 00:24:05.389
specs because the users are having such

00:24:05.389 --> 00:24:08.329
a hard developers and designers have a hard time picking contrasting colors

00:24:08.329 --> 00:24:11.289
it's also you look at the wicked reviews of all the websites and they're like

00:24:11.289 --> 00:24:15.429
contrast the the color is uh the number one issue across the board so we're

00:24:15.429 --> 00:24:19.009
like what if we just give people a function boom that's easy and so then i shared

00:24:19.009 --> 00:24:24.609
my proposal there uh which allows you to pass a color and then provide some other options.

00:24:24.749 --> 00:24:27.409
You could pick which contrast algorithm you want to use.

00:24:27.589 --> 00:24:31.029
So you could pick APCA or you could pick another one that, you know,

00:24:31.129 --> 00:24:34.289
there's been four or five of them created over the past 40, 50 years.

00:24:34.929 --> 00:24:38.949
And then you could also specify black or white by using a keyword and just saying,

00:24:39.089 --> 00:24:41.189
pick the maximum contrasting value.

00:24:41.649 --> 00:24:44.609
And then you could also let it pick a color for you. So like,

00:24:44.689 --> 00:24:47.449
let's say you were just like, Hey, pick a really light pink on top of this red.

00:24:47.569 --> 00:24:51.009
I don't want it to be white. And it would find the nearest light pink within

00:24:51.009 --> 00:24:52.509
the same hue of your red button.

00:24:53.101 --> 00:24:56.161
That passes the color contrast requirements and my

00:24:56.161 --> 00:24:58.941
function also looked at user preferences so it

00:24:58.941 --> 00:25:01.621
looked at the prefers reduced contrast value and would

00:25:01.621 --> 00:25:04.581
automatically adjust the returned result based on the user's preference

00:25:04.581 --> 00:25:07.381
so that was my proposal um and very little

00:25:07.381 --> 00:25:10.201
or none of it made it into the current shape of the

00:25:10.201 --> 00:25:13.501
the one but i still think it's a it's the

00:25:13.501 --> 00:25:16.481
one that from all the designers that i talked to this would be the most useful

00:25:16.481 --> 00:25:19.961
but it's a little hard to do also yeah it's

00:25:19.961 --> 00:25:23.241
one of these things where you are dependent on like an external

00:25:23.241 --> 00:25:26.201
group and if they don't move then you can't

00:25:26.201 --> 00:25:30.121
move and these kind of things so yeah yeah what

00:25:30.121 --> 00:25:33.401
can you do but i think the like the current solution with

00:25:33.401 --> 00:25:37.441
just returning white and black so the uh rationale

00:25:37.441 --> 00:25:40.721
behind that is that uh even

00:25:40.721 --> 00:25:43.741
if it's like yes it's limited but the on

00:25:43.741 --> 00:25:46.781
the other hand you it's like

00:25:46.781 --> 00:25:49.921
people don't expect things to really break

00:25:49.921 --> 00:25:54.101
a lot when when color contrast then one

00:25:54.101 --> 00:25:56.801
day gets upgraded to to do

00:25:56.801 --> 00:25:59.581
all the things that we just discussed that that we

00:25:59.581 --> 00:26:03.141
wish it could right so uh the

00:26:03.141 --> 00:26:12.361
probability that uh a white now is like off a lot uh by a lot by a big margin

00:26:12.361 --> 00:26:20.161
of the color that a future color contrast version would return is like not high.

00:26:20.161 --> 00:26:21.821
So that's the idea i think.

00:26:24.141 --> 00:26:30.761
Yep and speaking of preferring reduced contrast you see the new ios designs with the liquid glass,

00:26:32.001 --> 00:26:34.861
you got prefers reduced transparency also that's

00:26:34.861 --> 00:26:37.981
been in your browser for a while and some some users prefer

00:26:37.981 --> 00:26:40.721
no transparency and so you got to use that media query that

00:26:40.721 --> 00:26:43.641
media query became really valuable now as uh i

00:26:43.641 --> 00:26:46.401
think a lot of people are going to be like i can't see through the glass i would like

00:26:46.401 --> 00:26:49.901
to not have glass and just be a element i

00:26:49.901 --> 00:26:52.521
can read you know so anyway we could do that on our

00:26:52.521 --> 00:26:55.321
websites too and i think that's a fun media query that people don't

00:26:55.321 --> 00:26:58.781
think about very often and prefer reduce contrast

00:26:58.781 --> 00:27:02.041
that's that's also a new one uh right

00:27:02.041 --> 00:27:04.681
because i think it's prefers contrast and then

00:27:04.681 --> 00:27:08.241
the value i typed it wrong the value is more or less is

00:27:08.241 --> 00:27:11.201
your options this is actually

00:27:11.201 --> 00:27:15.061
also my trick um if i um

00:27:15.061 --> 00:27:22.161
explain anybody to test also like the windows high contrast mode or something

00:27:22.161 --> 00:27:25.421
like this so if you don't have a windows machine or you don't have a browser

00:27:25.421 --> 00:27:32.521
stack that i think you can go to um your dev tools and chose the tab rendering and there's.

00:27:34.061 --> 00:27:38.941
Prefers contrast less inside and I think it also simulates a bit I'm not sure

00:27:38.941 --> 00:27:43.081
if it's exactly like this but it does somehow assimilate maybe like a high contrast

00:27:43.081 --> 00:27:47.361
mode and then everybody can test it at least everybody was very happy as I told

00:27:47.361 --> 00:27:49.321
them about the trick so I think it's a good trick,

00:27:50.553 --> 00:27:54.633
It's a great trick. I did on my CSS day talk for all the scrollers that I made,

00:27:55.233 --> 00:27:58.173
they were light, dark, and had forced colors.

00:27:58.473 --> 00:28:01.733
So yeah, you're talking about there's two things you can change in rendering to emulate.

00:28:01.873 --> 00:28:05.633
There's the contrast preference, more or less. So someone wants a high contrast

00:28:05.633 --> 00:28:10.493
or low, but then there's also forced colors, which is like, it's like high contrast,

00:28:10.773 --> 00:28:14.173
but super high contrast because it doesn't care what your page colors are anymore.

00:28:14.393 --> 00:28:17.313
And forced colors, when that's active, your borders become

00:28:17.313 --> 00:28:20.733
really important because you can't rely on your card background

00:28:20.733 --> 00:28:24.013
color or box shadow to even appear anymore and so

00:28:24.013 --> 00:28:27.093
yeah you get

00:28:27.093 --> 00:28:30.173
a bunch of yeah so i like forced

00:28:30.173 --> 00:28:32.933
colors too i think it looks really cool um and yeah

00:28:32.933 --> 00:28:36.413
you can emulate that in dev tools yeah yes and

00:28:36.413 --> 00:28:39.233
you don't have to be a developer you don't have to have a browser stake or

00:28:39.233 --> 00:28:43.293
so account but hey it's in your dev tools i don't

00:28:43.293 --> 00:28:47.013
think a lot of people know either there's light forest colors mode active and

00:28:47.013 --> 00:28:52.893
dark forest colors mode active um so beware everyone there's there's two um

00:28:52.893 --> 00:28:55.593
but i mean really if you handle one you're going to handle both but it's nice

00:28:55.593 --> 00:28:59.293
to see your site in light forest active and dark forest active.

00:29:01.563 --> 00:29:04.443
Yeah and i think the the big takeaway is really what

00:29:04.443 --> 00:29:07.703
you said um like hacking things

00:29:07.703 --> 00:29:11.443
like doing fake borders with box shadows these these

00:29:11.443 --> 00:29:17.123
things like they fall back on you then yep

00:29:17.123 --> 00:29:20.123
they can come back to get you i really like transparent borders that's

00:29:20.123 --> 00:29:23.943
like one of my favorite things now it's like if i've got a a surface or if i'm

00:29:23.943 --> 00:29:27.583
even considering the element like it has its own surface which means a text

00:29:27.583 --> 00:29:31.603
color and a background put a border on it and a transparent border that way

00:29:31.603 --> 00:29:36.063
when everything becomes forced colors active you're in the clear you and all

00:29:36.063 --> 00:29:39.203
you did was put a one pixel transparent border on something and now,

00:29:39.963 --> 00:29:43.423
you're handling that accessibility use case really well and you can still do

00:29:43.423 --> 00:29:47.083
all your box shadows and your gradient backgrounds on the cards and all the

00:29:47.083 --> 00:29:49.943
sort of different surface experiences but if you got that transparent border

00:29:49.943 --> 00:29:56.323
you're checking a good accessibility box that's a neat trick, taking notes.

00:29:57.623 --> 00:30:03.823
So you mean you don't even have to write in CSS if mode is on,

00:30:03.983 --> 00:30:05.763
then set a border instead?

00:30:06.183 --> 00:30:10.103
That's correct. Just by default you add a border that is transparent.

00:30:10.823 --> 00:30:16.043
Maybe even something with a margin of a negative pixel to get your.

00:30:18.263 --> 00:30:24.263
Size and your area size back? Sure. Do you do that? or do you say no, it does not matter?

00:30:24.783 --> 00:30:28.383
I don't do it because you've got a box-sizing border box. And so that transparent

00:30:28.383 --> 00:30:32.263
border, you can have it overlay the background color instead of create space.

00:30:32.423 --> 00:30:35.163
Well, that would be transparent. It would be box-sizing content box.

00:30:35.723 --> 00:30:40.023
So if you want, you can sort of dance with those. But I haven't found that the

00:30:40.023 --> 00:30:43.683
one-pixel border is actually as disruptive as it seems.

00:30:44.523 --> 00:30:47.123
But it's a good question. Yeah, it could throw off alignment.

00:30:47.323 --> 00:30:50.903
It could throw off sizing. You know, there's all sorts of things. But yeah.

00:30:53.668 --> 00:30:59.608
Then you also listed prefers-reduced data, which is like a rather old,

00:30:59.608 --> 00:31:03.408
in quotes, old media query.

00:31:03.628 --> 00:31:07.528
I think it's around for maybe 10 years already.

00:31:07.768 --> 00:31:12.348
But I think the uptake on the other browsers is not there, right?

00:31:13.288 --> 00:31:16.628
Yeah, it's about six years old. it was proposed by um

00:31:16.628 --> 00:31:19.648
chi uh hang

00:31:19.648 --> 00:31:22.648
chen chen hui because they

00:31:22.648 --> 00:31:25.748
were looking at hey the browser has save data modes hey the

00:31:25.748 --> 00:31:28.868
operating system has like a save data thing where it's trying hey well

00:31:28.868 --> 00:31:31.988
can the kind of website uh from css

00:31:31.988 --> 00:31:34.788
tap in it looks like javascript hey javascript has access to the

00:31:34.788 --> 00:31:37.948
users in a reduced data state how do we get that into css and so

00:31:37.948 --> 00:31:41.028
it became it hit the spec very very quickly everyone

00:31:41.028 --> 00:31:44.728
was like oh yeah totally that's a great media query but at

00:31:44.728 --> 00:31:47.628
the same time there was a lot of privacy concerns around these

00:31:47.628 --> 00:31:50.808
media queries because they expose a user's setting

00:31:50.808 --> 00:31:53.868
and when you expose a user's setting like reduced

00:31:53.868 --> 00:31:56.728
data attackers can use this as a vector

00:31:56.728 --> 00:31:59.748
and they can be like oh reduced data you must be poor you

00:31:59.748 --> 00:32:02.448
must be coming from somewhere with no money and so then they

00:32:02.448 --> 00:32:06.068
can use that or whatever to try to attack or section you

00:32:06.068 --> 00:32:09.448
into some type of user and then sell your data so

00:32:09.448 --> 00:32:12.828
this this particular media query which i

00:32:12.828 --> 00:32:15.608
also helped work on and tried to unblock it because i i made so many.

00:32:15.608 --> 00:32:18.568
Demos of it all i also put the chrome for it in chromium so

00:32:18.568 --> 00:32:21.408
if you open canary and turn on web experiments and

00:32:21.408 --> 00:32:24.728
try the prefers reduced data thing that's my code running in chromium which

00:32:24.728 --> 00:32:27.948
is kind of cool um but this this comes

00:32:27.948 --> 00:32:30.688
up in talks this was in like three css day talks but

00:32:30.688 --> 00:32:33.508
hey make sure to remember prefers reduced data

00:32:33.508 --> 00:32:36.368
i'm sitting in my chair going this thing's like six years old

00:32:36.368 --> 00:32:39.308
no one's using it it's not shipped in any browser yet

00:32:39.308 --> 00:32:42.308
it's constantly on screen people want to be considerate of

00:32:42.308 --> 00:32:45.428
user data but there's no browser that shipped

00:32:45.428 --> 00:32:48.828
it and it's blocked in the css working group because it's a new attack vector

00:32:48.828 --> 00:32:53.288
so it might not ever ship but javascript can do it you know like all of my images

00:32:53.288 --> 00:32:56.608
on the server know if the user's in a save data mode and i can ship a different

00:32:56.608 --> 00:33:02.528
image because uh that uh header travels with that user when they make requests.

00:33:03.008 --> 00:33:06.988
So I'm like, the attack vector is already there. CSS is not exposing anything new.

00:33:07.168 --> 00:33:11.508
And it's a really difficult battle. But I think that's a meaningful media query

00:33:11.508 --> 00:33:15.148
that we just kind of need to ask for more or something. I don't know.

00:33:15.288 --> 00:33:18.308
I'm not sure how to unblock it at this point. But I put it there because,

00:33:18.428 --> 00:33:21.048
yeah, it means something to me. And I'd like to see you go somewhere.

00:33:22.494 --> 00:33:25.694
I thought it had already shipped in chrome so

00:33:25.694 --> 00:33:29.154
that was just my remembering but

00:33:29.154 --> 00:33:32.094
that was apparently wrong so i

00:33:32.094 --> 00:33:35.094
thought because you already have like these client hint

00:33:35.094 --> 00:33:42.374
headers and also the javascript thing that it was also in css already but apparently

00:33:42.374 --> 00:33:51.634
it wasn't it got locked yeah that also be like nice to use as a feature query

00:33:51.634 --> 00:33:54.774
for example in a responsive image thing maybe,

00:33:55.414 --> 00:34:02.114
or video also yeah i have a demo of like a site kind of like netflix and if

00:34:02.114 --> 00:34:05.834
you're in reduced data you don't get any thumbnail images you just get titles

00:34:05.834 --> 00:34:11.654
and it's kind of better it's almost like the images are really showy and they

00:34:11.654 --> 00:34:14.534
make for like it feels like a good browsing experience But in the end,

00:34:14.734 --> 00:34:20.074
they're kind of noise, like the cover of the movie isn't actually that important.

00:34:20.194 --> 00:34:23.154
It's more about like, what's the genre? When did it come out? Who are the actors?

00:34:24.274 --> 00:34:27.494
And so it's kind of interesting. You can ship a reduced data experience that

00:34:27.494 --> 00:34:31.234
does. It saves 90% of the page load because, well, most of the page is images.

00:34:31.434 --> 00:34:34.874
If you don't ship any of the images and CSS is hiding them because the user's

00:34:34.874 --> 00:34:38.634
in this state and you have lazy loaded, the lazy attribute on all the images,

00:34:38.794 --> 00:34:40.474
they never download at all.

00:34:40.474 --> 00:34:43.434
And so the user gets this like super fast loading

00:34:43.434 --> 00:34:46.374
web page and they can start interacting with it right away even

00:34:46.374 --> 00:34:49.434
though they're on low data i mean yeah there's a lot of examples that

00:34:49.434 --> 00:34:53.294
show this can be really cool but uh i

00:34:53.294 --> 00:34:56.174
don't know maybe we just got to do it from javascript you know just let javascript do

00:34:56.174 --> 00:34:59.414
it it's okay no no maybe

00:34:59.414 --> 00:35:02.354
yeah i don't know uh so i i once had

00:35:02.354 --> 00:35:05.194
a like a real use case so i traveled to the us and

00:35:05.194 --> 00:35:08.674
i had a phone that was 4g enabled that's a

00:35:08.674 --> 00:35:11.474
few years already back and the problem

00:35:11.474 --> 00:35:14.334
was that the frequencies in europe are not

00:35:14.334 --> 00:35:18.534
the same ones that i use in the us so my

00:35:18.534 --> 00:35:21.554
phone only supported the european 4g so

00:35:21.554 --> 00:35:29.714
it tried to fall back to 3g but in florida they already turned 3g off because

00:35:29.714 --> 00:35:38.274
nobody used it anymore so it then fell back to 2g and it was super slow and

00:35:38.274 --> 00:35:40.534
that was a situation where i.

00:35:41.489 --> 00:35:44.769
I i would have wished for more

00:35:44.769 --> 00:35:47.969
websites offering uh data

00:35:47.969 --> 00:35:51.549
saving modes yeah yeah

00:35:51.549 --> 00:35:54.309
so it was accessibility where um you know

00:35:54.309 --> 00:35:57.229
like oh accessibility doesn't matter until your arms are

00:35:57.229 --> 00:36:00.049
broken and you have to use a website with like your nose or something

00:36:00.049 --> 00:36:03.469
or just like a different input device and you're like hey this site should be

00:36:03.469 --> 00:36:07.069
built easier for me to hit my keyboard tab key and you're like yeah it should

00:36:07.069 --> 00:36:11.929
and it also shouldn't take you breaking your arms dork to realize uh that there's

00:36:11.929 --> 00:36:15.269
people out there that might want to use a site with their not a mouse you know

00:36:15.269 --> 00:36:18.809
i'm sorry i'm not you're not a dork uh shatman's just making that clear,

00:36:19.609 --> 00:36:23.389
but yeah you felt you felt the pain yeah not

00:36:23.389 --> 00:36:26.489
far from it um yeah also

00:36:26.489 --> 00:36:29.509
so uh what i also so after this

00:36:29.509 --> 00:36:33.149
experience i worked as a at a news um publisher

00:36:33.149 --> 00:36:36.249
uh and we so one

00:36:36.249 --> 00:36:39.489
of my tasks was also to integrate ads of course

00:36:39.489 --> 00:36:42.869
um and but but

00:36:42.869 --> 00:36:45.849
what i did was uh i checked so if

00:36:45.849 --> 00:36:49.009
there was the uh the connection type

00:36:49.009 --> 00:36:54.429
uh info on the uh so if there was a like if it was a chrome device and that

00:36:54.429 --> 00:36:59.249
would that tells me the connection type and it was too slow then i would just

00:36:59.249 --> 00:37:07.809
bail out loading the ads So that was one takeaway that I implemented in code later on. Nice.

00:37:09.089 --> 00:37:15.249
Yeah. So these little tools letting us as developers express a meaningful user

00:37:15.249 --> 00:37:17.149
experience, that's kind of what we're going for.

00:37:17.789 --> 00:37:20.489
Yeah, because otherwise the

00:37:20.489 --> 00:37:25.709
whole page, like the ads as well as the content would both be unusable.

00:37:26.189 --> 00:37:30.749
So then throw out one of the two and be able to use the other one.

00:37:31.713 --> 00:37:39.313
That was the idea. Well, there's a lot more in this list. How about I fast share a couple of them? Yeah.

00:37:40.053 --> 00:37:43.293
So control value is the next. I have never heard of that one.

00:37:43.973 --> 00:37:46.873
Yeah. So, you know, talking about what's new in CSS, some of the stuff down

00:37:46.873 --> 00:37:49.913
below isn't super new, but this one is really new.

00:37:50.093 --> 00:37:54.313
And this is, if you ever wanted the value of an input in CSS,

00:37:54.673 --> 00:37:57.713
so that you like a slider, hey, I want to know what the current slider value

00:37:57.713 --> 00:38:00.953
is so I can fill the GU track up to look like it's that full.

00:38:01.713 --> 00:38:05.033
And so we have to use JavaScript. If we say JavaScript on input,

00:38:05.693 --> 00:38:08.093
set a custom property that says the values.

00:38:08.453 --> 00:38:12.113
Anyway, so this would just do the whole thing from CSS. You get control value.

00:38:12.413 --> 00:38:15.973
So as the selector inside of there, you can ask for the value of the input that

00:38:15.973 --> 00:38:19.373
you have selected and use that input in a calc or whatever.

00:38:20.013 --> 00:38:23.993
And I think that is really cool. Yeah, super useful.

00:38:24.473 --> 00:38:27.593
Super useful. Then there's transition behavior here,

00:38:27.733 --> 00:38:30.473
which is a weird sounding one, but comes in really

00:38:30.473 --> 00:38:33.333
handy when you so a discrete property in

00:38:33.333 --> 00:38:36.113
css if you animate from like display block to

00:38:36.113 --> 00:38:39.473
display none for example that's a discrete property there's

00:38:39.473 --> 00:38:44.273
no in-betweens none and block i mean there's opacity but that's different so

00:38:44.273 --> 00:38:47.853
anyway the browser immediately flips these things if you put them in a css transition

00:38:47.853 --> 00:38:52.493
or in keyframes as soon as it sees that it's headed towards display none or

00:38:52.493 --> 00:38:56.153
as soon as it sees it's currently none and about to be blocked it does it right away.

00:38:56.793 --> 00:39:02.633
And transition behavior allows you to delay this and integrate that moment of

00:39:02.633 --> 00:39:06.133
flipping into something that matches more with your other transitions.

00:39:06.133 --> 00:39:11.533
So you could transition opacity out and then flick to display none, for example.

00:39:12.153 --> 00:39:18.133
And so transition behavior is like a weird word and the value is called allow discrete.

00:39:18.353 --> 00:39:21.233
And you have to say which property, if you want, you can say which property

00:39:21.233 --> 00:39:22.913
to be transition behavior on.

00:39:23.013 --> 00:39:27.513
But anyway, it ends up being a pretty cool feature that allows you to control

00:39:27.513 --> 00:39:31.333
these discrete moments that are great for displaying a dialogue,

00:39:31.573 --> 00:39:34.873
for example, or the custom select element that pops up with its little pop over.

00:39:35.093 --> 00:39:39.113
Those things you need to, if you want to animate those, you need to time the

00:39:39.113 --> 00:39:43.313
display none and display block that the browser's flipping on those for you.

00:39:43.473 --> 00:39:45.433
You need to time those with your transitions.

00:39:45.713 --> 00:39:49.793
And so transition behavior allows you to sneak that timing right in line with

00:39:49.793 --> 00:39:52.873
your other animations and it's adds for a nice smooth user experience.

00:39:54.255 --> 00:39:57.835
Yeah very cool a little bit like uh visibility hidden

00:39:57.835 --> 00:40:00.995
and visible i think that's that was so far

00:40:00.995 --> 00:40:03.815
the only thing that would only be flipped at the

00:40:03.815 --> 00:40:06.975
like visibility hidden would only be flipped at the very end

00:40:06.975 --> 00:40:10.395
and the other way around i think interesting i

00:40:10.395 --> 00:40:13.775
think yeah that was the only thing that worked like that so

00:40:13.775 --> 00:40:17.215
yeah super cool super cool

00:40:17.215 --> 00:40:20.975
and that transition behavior comes in handy with animating to

00:40:20.975 --> 00:40:24.755
summary details the dialogue elements popovers and

00:40:24.755 --> 00:40:27.515
select elements so yeah kind of

00:40:27.515 --> 00:40:30.315
a cool one to know and then there's calc size and interpolate size

00:40:30.315 --> 00:40:33.475
if you've ever wanted to animate height this is

00:40:33.475 --> 00:40:37.075
your this is how you do it now you set interpolate size on the element and you

00:40:37.075 --> 00:40:42.935
say allow keywords and this tells the element that things like min height or

00:40:42.935 --> 00:40:49.555
auto So these keywords can be used in an animation to go from zero to something

00:40:49.555 --> 00:40:52.095
intrinsic inside of that calc size function.

00:40:52.355 --> 00:40:59.795
So then calc size can say, calc size is like calc, except the size portion of

00:40:59.795 --> 00:41:04.795
the function specifically calls out to the browser to measure and use the measured size.

00:41:04.955 --> 00:41:08.795
And there's keywords that you can put inside of calc size also that allow you

00:41:08.795 --> 00:41:12.915
to derive the perfect height animation value that you want to go to.

00:41:12.915 --> 00:41:15.655
Then you can go from height zero to height something and again

00:41:15.655 --> 00:41:18.695
this comes into play with like a summary details accordion when it

00:41:18.695 --> 00:41:21.615
opens it needs to transition to an

00:41:21.615 --> 00:41:24.515
intrinsic height to show all the paragraphs or the contents inside

00:41:24.515 --> 00:41:27.575
of there and you can now animate that with a

00:41:27.575 --> 00:41:30.975
combination of calc size and interpolate size which

00:41:30.975 --> 00:41:36.635
is pretty cool yes this is an example i think in my bubble everybody has waited

00:41:36.635 --> 00:41:44.755
for and I'm happy that the calc size function is part of this year's state of

00:41:44.755 --> 00:41:50.055
CSS survey so people might get aware that there is this new cool thing,

00:41:51.500 --> 00:41:56.560
Mm-hmm. I share a little link here, too, to a, I call it a nice accordion.

00:41:57.200 --> 00:42:00.560
It kind of takes all these little modern features and tries to layer them on

00:42:00.560 --> 00:42:04.940
so that you get a summary details that looks modern. It doesn't look like it was from the 90s.

00:42:05.820 --> 00:42:09.200
Just because I see so many bad summary details elements, and I'm like,

00:42:09.200 --> 00:42:12.120
let's make a cute one. It's got cool little micro interactions in there.

00:42:12.520 --> 00:42:14.620
So check that out in the show notes, y'all.

00:42:16.240 --> 00:42:19.040
Yes. There's also probably all the,

00:42:19.040 --> 00:42:21.940
like the new sudo element inside the what is

00:42:21.940 --> 00:42:25.100
a details content thing details content yeah so colon

00:42:25.100 --> 00:42:28.500
colon details content accessing the slot that uh

00:42:28.500 --> 00:42:32.720
your content is inserted into yeah yep really

00:42:32.720 --> 00:42:36.220
nice and also i i guess progressive

00:42:36.220 --> 00:42:39.240
or graceful degraded degrading on

00:42:39.240 --> 00:42:42.540
on non-supporting browsers right yeah if

00:42:42.540 --> 00:42:46.120
they can't select it they can't select it they're going to get just an accordion that

00:42:46.120 --> 00:42:49.760
opens and closes like regular yeah no big deal yeah like

00:42:49.760 --> 00:42:53.040
that just flips open and close and

00:42:53.040 --> 00:43:00.340
it's not animated and yeah how like the way we we had it for years if we didn't

00:43:00.340 --> 00:43:07.820
use javascript right same as it's always been or it's better yeah at least lighter

00:43:07.820 --> 00:43:13.020
so the next one is It's scroll state. So state.

00:43:14.020 --> 00:43:19.520
Yes, this one I find has a lot of business value for upgrades.

00:43:19.860 --> 00:43:23.680
So at CSSD, I talked about building the Nintendo Switch home screen.

00:43:24.476 --> 00:43:27.976
And scroll state is what allowed me to know which element was snapped and put

00:43:27.976 --> 00:43:30.456
the little highlighting flashing blue box around it.

00:43:30.616 --> 00:43:33.676
And to show the title of the game you have selected, I could use scroll state

00:43:33.676 --> 00:43:38.456
because scroll state exposes which element is snapped just from CSS.

00:43:38.796 --> 00:43:41.496
And it does it in the same way that container queries works.

00:43:41.796 --> 00:43:46.056
So on your scroll container, you say container type is scroll state.

00:43:46.476 --> 00:43:50.516
And then you have a child that is a snapped element inside that scroller.

00:43:50.516 --> 00:43:54.716
And children of that snapped element can ask the snapped element,

00:43:54.956 --> 00:43:55.956
just like a container query.

00:43:56.936 --> 00:44:00.956
I don't want to know your width snapped element, but I want to know if you're snapped or not.

00:44:01.336 --> 00:44:06.756
And you can use that just in CSS to show and hide a title of the selected item

00:44:06.756 --> 00:44:10.996
or animate in a focused selected state and all sorts of things.

00:44:11.296 --> 00:44:15.916
And scroll state has two other features on top of snapped. It also has overflowing

00:44:15.916 --> 00:44:17.516
or is it called overflow?

00:44:17.816 --> 00:44:21.496
I think it's overflowing. and so you literally know if the scrollable

00:44:21.496 --> 00:44:24.876
area is actually scrolling right

00:44:24.876 --> 00:44:27.736
now so like this was impossible to know before

00:44:27.736 --> 00:44:31.536
you know like sometimes you have a box and you put one paragraph in it there's

00:44:31.536 --> 00:44:34.816
no scroll bar you put five paragraphs in it there's a scroll bar how do you

00:44:34.816 --> 00:44:39.216
know from css if there's a scroll bar or not you didn't know and now with scroll

00:44:39.216 --> 00:44:43.596
state queries you can know you can ask the container can you scroll which direction

00:44:43.596 --> 00:44:47.156
can you scroll and it will say i have scrollable runway down.

00:44:47.456 --> 00:44:52.296
And then if you reach the bottom, that is no longer true, but it does have scrollable up.

00:44:52.636 --> 00:44:56.256
And so you can show and hide little buttons that help people scroll.

00:44:56.416 --> 00:44:59.376
You can show and hide the scroll to top button really easy because you're like,

00:44:59.456 --> 00:45:02.716
hey, can they scroll upwards at all? If the answer is no, don't show the button.

00:45:02.836 --> 00:45:05.836
But as soon as you scroll down and as soon as you can scroll up at all,

00:45:06.256 --> 00:45:08.076
show that little helpful button to scroll to the top.

00:45:08.556 --> 00:45:11.796
So you're like giving CSS all sorts of cool little features.

00:45:12.056 --> 00:45:14.956
Oh, and then there's, so there's scrollable, snapped and stuck.

00:45:14.956 --> 00:45:21.156
So you now know if something is stuck in a scroller from CSS by using a container query.

00:45:23.596 --> 00:45:27.476
For a position sticky for example yeah

00:45:27.476 --> 00:45:31.796
so if you have a position sticky child in that scroller that just became this

00:45:31.796 --> 00:45:37.296
sticky header you know the classic example is put a shadow on it as soon as

00:45:37.296 --> 00:45:41.096
it sticks like okay now you can do that with CSS and there used to be a little

00:45:41.096 --> 00:45:45.396
annoying chunk of JavaScript you had to deploy yeah very very useful.

00:45:48.341 --> 00:45:53.001
But it's not like stuck like a bug stuck because the first, maybe it's a German

00:45:53.001 --> 00:45:55.861
thing for me when I hear the word stuck, it's like, oh, I'm stuck.

00:45:56.181 --> 00:46:03.721
I cannot move anymore. But it's position sticky or is there another possibility

00:46:03.721 --> 00:46:05.061
that anything can be stuck?

00:46:06.801 --> 00:46:10.421
Um i think it's just position sticky um okay but

00:46:10.421 --> 00:46:13.201
yeah sticky yeah sticky is funny too even in the states we're

00:46:13.201 --> 00:46:17.661
like oh sticky situation i'm stuck yeah uh it's

00:46:17.661 --> 00:46:20.461
like we know as the css developer like oh no that's a good thing to

00:46:20.461 --> 00:46:23.441
be stuck if you're a sticky element like you know it's okay we wanted

00:46:23.441 --> 00:46:26.541
that pretty funny um any

00:46:26.541 --> 00:46:29.301
more questions on scroll state that one's pretty sweet i wrote an article

00:46:29.301 --> 00:46:32.981
too for chrome on that one i should pull that up scroll state yeah maybe

00:46:32.981 --> 00:46:36.261
one question and that is what is the

00:46:36.261 --> 00:46:40.041
do you know the view of the other browser vendors

00:46:40.041 --> 00:46:42.861
on that thing because on scroll

00:46:42.861 --> 00:46:46.301
state queries yeah are they like positive or

00:46:46.301 --> 00:46:49.681
are they just do they have no opinion so

00:46:49.681 --> 00:46:52.541
oh they definitely are positive and helped

00:46:52.541 --> 00:46:55.161
it all all happen so a lot.

00:46:55.161 --> 00:46:58.061
Of these this is like a common question about some of the scroll stuff like scroll

00:46:58.061 --> 00:47:01.221
buttons and scroll markers people are like that seems

00:47:01.221 --> 00:47:03.861
uh like chrome shipped it really

00:47:03.861 --> 00:47:06.961
fast and are you know did other browsers even

00:47:06.961 --> 00:47:09.961
know this was happening and the answer is totally like these

00:47:09.961 --> 00:47:13.641
things like scroll state queries took multiple years tons of

00:47:13.641 --> 00:47:17.081
conversations there's uh you know these get before they

00:47:17.081 --> 00:47:20.441
can even become a a draft you have

00:47:20.441 --> 00:47:23.181
to pitch it to the working group and the working group has to accept it as a

00:47:23.181 --> 00:47:26.081
as a group so all of these things went through

00:47:26.081 --> 00:47:29.481
group approval and all of the refactors this

00:47:29.481 --> 00:47:33.401
it wasn't originally called scroll state um and

00:47:33.401 --> 00:47:36.481
that is scroll they're called scroll state because we're anticipating other type

00:47:36.481 --> 00:47:39.281
of container queries that are like a style query it's kind of a

00:47:39.281 --> 00:47:42.201
style state query you might get input.

00:47:42.201 --> 00:47:45.821
State queries at some point so they're kind of prepping and

00:47:45.821 --> 00:47:48.881
going through revisions to make sure that the future is

00:47:48.881 --> 00:47:52.481
covered on how this can extend more and more but uh

00:47:52.481 --> 00:47:55.481
as far as i know other browsers would love to implement this

00:47:55.481 --> 00:47:58.221
as soon as they can but same thing with like style queries although i think

00:47:58.221 --> 00:48:00.881
firefox doesn't like style queries that's one where i've

00:48:00.881 --> 00:48:04.201
heard firefox say we don't want to implement that even

00:48:04.201 --> 00:48:07.061
though there's a whole bunch of developers out there like tailwind the creator

00:48:07.061 --> 00:48:11.501
of tailwind wants style queries really bad um but firefox is the last holdout

00:48:11.501 --> 00:48:15.661
i don't know uh what their deal is there but yeah scroll state is all good same

00:48:15.661 --> 00:48:18.881
with scroll buttons and scroll markers these things went through years of uh

00:48:18.881 --> 00:48:23.941
revisions and they'll still go through changes and it'll be better every time it gets talked about.

00:48:25.181 --> 00:48:32.241
And then we can follow up with scroll markers and buttons right away. Yeah. Awesome.

00:48:33.061 --> 00:48:37.541
I'm trying to see if I have a link to any of the working group discussions on scroll state.

00:48:40.734 --> 00:48:45.334
Uh here's the explainer anyway you can go find uh past conversations and see

00:48:45.334 --> 00:48:48.754
the the interest of the other browsers but as far as i know these ones aren't

00:48:48.754 --> 00:48:53.594
contentious like people want to know if something's stuck or snapped and this

00:48:53.594 --> 00:48:57.174
is a way to do it using the container query methodology,

00:48:58.214 --> 00:49:02.014
yeah i think there's there's a lot of these states that that people would love

00:49:02.014 --> 00:49:09.734
to to know about like For example, if you have text clamp,

00:49:10.054 --> 00:49:18.974
and for example, if you want to know if text is clamped or not,

00:49:19.194 --> 00:49:24.454
because if it's short enough to not get clamps, then everything is fine.

00:49:24.454 --> 00:49:32.834
But if it's being clamped, I would like to maybe put in an expand text button,

00:49:33.054 --> 00:49:35.714
for example, or like a dot, dot, dot thing.

00:49:36.134 --> 00:49:42.734
So for these use cases, such a state query would be helpful.

00:49:42.954 --> 00:49:47.534
Also, sometimes text will be clamped on mobile, but not on desktop.

00:49:48.214 --> 00:49:50.174
Also, these kind of things. So, yeah.

00:49:52.134 --> 00:49:55.014
Yep you need that dynamic ability to it's like

00:49:55.014 --> 00:49:57.794
it's a simple question from us as developers like hey

00:49:57.794 --> 00:50:00.494
is it snapped um and you don't even

00:50:00.494 --> 00:50:03.654
have to care if the scroller is even a snapping container at

00:50:03.654 --> 00:50:08.054
that time um but when it is because maybe it's now on a mobile layout which

00:50:08.054 --> 00:50:12.234
has gone into a constricted view which caused it to go into a horizontal scroller

00:50:12.234 --> 00:50:15.994
now you do have snap items and you do want to know which one is snapped and

00:50:15.994 --> 00:50:21.014
yeah that was a lot of javascript you had to dance around and manage state that

00:50:21.014 --> 00:50:22.654
now the browser does it for you. It's pretty sweet.

00:50:25.000 --> 00:50:28.780
Speaking of snapping uh there's

00:50:28.780 --> 00:50:32.120
two new uh dom events uh

00:50:32.120 --> 00:50:37.420
related to snaps snapping right yeah and these took a lot of years to get in

00:50:37.420 --> 00:50:41.340
there also but they were really important so you know you listen to developers

00:50:41.340 --> 00:50:46.240
building things with scroll and they want to know uh when something snaps uh

00:50:46.240 --> 00:50:51.160
and then sometimes they want to know um that it's maybe going to snap there but hasn't snapped yet.

00:50:51.580 --> 00:50:57.260
And so that's what these two events help you isolate is snap change means that

00:50:57.260 --> 00:51:01.840
the scroller has rested on a new snap element and it actually changed.

00:51:02.020 --> 00:51:05.460
So let's say you scroll with your finger, but then you scroll it back and you let go.

00:51:05.780 --> 00:51:09.540
Snap didn't change. So the event wouldn't fire. Scrolling did occur and scrolling

00:51:09.540 --> 00:51:11.680
ended, but snap didn't change.

00:51:11.940 --> 00:51:18.040
And then snap changing is if you pan with your finger and enough that the next

00:51:18.040 --> 00:51:19.580
item would snap if you let go,

00:51:19.580 --> 00:51:23.040
the snap changing event fires to tell you eagerly and

00:51:23.040 --> 00:51:25.700
as soon as possible that there's a new snap element that's going

00:51:25.700 --> 00:51:28.920
to be snapped if the user lets go of their gesture and so

00:51:28.920 --> 00:51:31.780
you can highlight the dot underneath it for example but then

00:51:31.780 --> 00:51:35.520
if they pan back the other way then it could snap changing says oh i'm going

00:51:35.520 --> 00:51:38.040
to snap to this one and then you can change the bottom dot so you can kind of

00:51:38.040 --> 00:51:41.900
provide this feedback to the user while they're scrolling and then when they

00:51:41.900 --> 00:51:46.200
let go you can confirm the gesture and these two events uh integrate really

00:51:46.200 --> 00:51:49.940
well with snap to help you create an even better scroll snap experience.

00:51:52.122 --> 00:51:58.562
And you briefly mentioned scroll end as as an event which is also a new event i would say,

00:51:59.342 --> 00:52:02.562
yeah so you get notified if if a

00:52:02.562 --> 00:52:06.382
scroll that happened is finished is

00:52:06.382 --> 00:52:09.722
finished and that one is extra tricky so that one also helped spec um

00:52:09.722 --> 00:52:12.422
and uh i was really happy to see

00:52:12.422 --> 00:52:15.222
that one get really quickly adopted because i always thought it was crazy that there was

00:52:15.222 --> 00:52:19.342
no scroll end event you know uh why isn't

00:52:19.342 --> 00:52:23.302
there one and so all the all the javascript we had to write was hey infinitely

00:52:23.302 --> 00:52:28.862
do a set timeout uh but if the set timeout goes longer than 100 milliseconds

00:52:28.862 --> 00:52:33.162
and there's still no scroll has changed then they probably stopped scrolling

00:52:33.162 --> 00:52:36.702
and that was like as good as we had but that that didn't work if the user was

00:52:36.702 --> 00:52:38.322
panning with their thumb and they,

00:52:38.842 --> 00:52:43.482
scrolled a little bit and then just stood still for 100 milliseconds scroll

00:52:43.482 --> 00:52:47.942
and would fire and steal the scroll from the user who wasn't done with the gesture.

00:52:48.322 --> 00:52:52.962
And it turns out even in JavaScript, it's really hard to know if the user has

00:52:52.962 --> 00:52:55.542
a finger on the screen or not during a scroll gesture.

00:52:57.202 --> 00:53:01.762
So this was like really difficult stuff for even JavaScript to solve.

00:53:01.902 --> 00:53:07.162
And so we got that into the platform that literally waits for all of the gestures to end.

00:53:07.442 --> 00:53:12.182
And when the scroll maybe smoothly goes to a new place, as soon as it rests,

00:53:12.222 --> 00:53:15.322
and as soon as it's done, you know, the frame scroll has ended.

00:53:15.562 --> 00:53:19.302
So instead of you being delayed 100 milliseconds and maybe getting the scroll

00:53:19.302 --> 00:53:23.642
end event, you literally get the scroll end event at the exact perfect time,

00:53:23.822 --> 00:53:26.402
which is really important. So yeah, there's scroll end also.

00:53:30.490 --> 00:53:33.970
There's this next one here, which is scroll into view, and you can pass the

00:53:33.970 --> 00:53:38.090
container, which is a weird way of saying you can scroll into view and not have

00:53:38.090 --> 00:53:40.510
it bubble up to all the other containers.

00:53:42.170 --> 00:53:51.130
I think that was something that I wished for, that I didn't notice that it's in the web platform.

00:53:52.450 --> 00:53:55.690
Yeah, I bet you did wish for that one. It's super annoying. it's

00:53:55.690 --> 00:53:58.450
like a and they did it for accessibility reasons but

00:53:58.450 --> 00:54:01.570
i don't really think they thought it through as good as they could have but yeah so eventually

00:54:01.570 --> 00:54:04.590
and it's specced and i think it's prototyped in

00:54:04.590 --> 00:54:07.570
chromium right now that you can scroll an item to interview and specify

00:54:07.570 --> 00:54:10.670
the container that you want it to be trapped within and

00:54:10.670 --> 00:54:13.530
that way we can literally we can finally like i

00:54:13.530 --> 00:54:16.270
don't use scroll interview ever because of the way that

00:54:16.270 --> 00:54:19.030
it makes the page scroll also it's like

00:54:19.030 --> 00:54:21.930
it's a very leaky um you know it has

00:54:21.930 --> 00:54:24.890
a lot of side effects yeah i think the problem is that

00:54:24.890 --> 00:54:28.390
scroll interview works itself from the like

00:54:28.390 --> 00:54:32.010
the top most to the like deepest

00:54:32.010 --> 00:54:35.030
like the way down into the dom

00:54:35.030 --> 00:54:38.390
and it tries to scroll like the uh

00:54:38.390 --> 00:54:44.110
like as many parents as possible before then starting to scroll the thing that

00:54:44.110 --> 00:54:49.790
you really wanted to scroll yeah that that sucks and and this like the option

00:54:49.790 --> 00:54:56.110
that you mentioned that will probably reverse that or something like that,

00:54:56.650 --> 00:55:00.330
it'll probably just say where it starts so it sounds like if it works top to

00:55:00.330 --> 00:55:03.710
bottom this would be like hey start at the container uh and maybe only affect

00:55:03.710 --> 00:55:07.370
this container maybe it won't even crawl into child scrollers you know it'll

00:55:07.370 --> 00:55:10.710
just be isolated to the one scroll view that you pass in.

00:55:12.261 --> 00:55:17.961
Cool. I also recently learned that, so I was always wondering why does,

00:55:18.141 --> 00:55:23.841
I think, Firefox support scroll into view if needed, and why do the other browsers

00:55:23.841 --> 00:55:26.981
not implement it? I think Chrome has it, right?

00:55:27.541 --> 00:55:33.941
Yeah, they do have it, and they just implemented it as an option for scroll into view.

00:55:34.461 --> 00:55:36.921
So, didn't know about that.

00:55:37.861 --> 00:55:40.581
And if needed that one's funny too because it has

00:55:40.581 --> 00:55:43.421
the same issue with the container where it continues scrolling all

00:55:43.421 --> 00:55:46.101
the containers so i was like oh it sounds neat you know

00:55:46.101 --> 00:55:48.741
scroll it into view only only if you need to which also kind of

00:55:48.741 --> 00:55:53.621
feels like how the original one should have just always operated but you

00:55:53.621 --> 00:55:56.821
can't change history so you gotta just layer in new functions and

00:55:56.821 --> 00:56:00.061
new parameters to sort of handle these uh more

00:56:00.061 --> 00:56:02.941
modern cases that's just

00:56:02.941 --> 00:56:07.381
the way it is yep it's just the way it is yep it's okay i mean we like it too

00:56:07.381 --> 00:56:10.001
i mean it's kind of nice that it doesn't break old stuff right it's pretty sweet

00:56:10.001 --> 00:56:15.381
yeah yeah i think that's that's also like it's sometimes it sucks but i think

00:56:15.381 --> 00:56:20.421
it's also the biggest uh plus side for the web platform so,

00:56:21.301 --> 00:56:24.861
it's just amazing that you can build things and they will work forever,

00:56:25.921 --> 00:56:32.001
yeah i love it and you don't need to upgrade or touch them anymore not the case

00:56:32.001 --> 00:56:37.601
with anything else like be it javascript or php everything breaks.

00:56:39.381 --> 00:56:44.041
Yeah but css it's typed and resilient what an amazing language.

00:56:45.561 --> 00:56:48.561
Uh here i need to air out some dirty laundry a lot

00:56:48.561 --> 00:56:51.921
of people think the css carousel features are

00:56:51.921 --> 00:56:55.041
carousel features uh they are not they

00:56:55.041 --> 00:56:57.801
are additions to scrollers so that's why

00:56:57.801 --> 00:57:01.241
i have it here is overflow five introduced scroll markers

00:57:01.241 --> 00:57:04.021
and scroll buttons it does not this is not

00:57:04.021 --> 00:57:09.721
css carousels carousels are something you can do with these but it's not exclusively

00:57:09.721 --> 00:57:15.301
all that you can do with them and the idea of these two additions is to make

00:57:15.301 --> 00:57:22.361
it easier for developers to not screw it up like you need buttons not links to scroll your scroller,

00:57:23.235 --> 00:57:25.595
And so to make that easier so that there are always buttons,

00:57:25.855 --> 00:57:29.895
we have a CSS pseudo selector that will create a button for you and make it

00:57:29.895 --> 00:57:31.855
so that you can attach it to a scroller.

00:57:31.955 --> 00:57:35.355
And it'll also handle the amount that scrolls and all that sort of stuff.

00:57:35.815 --> 00:57:39.115
And then scroll markers are like, hey, you have all these snap points,

00:57:39.175 --> 00:57:42.695
but they're invisible to users. They don't know what they can snap to or not.

00:57:43.075 --> 00:57:46.295
But if you show the little dots at the bottom for each of the snap items,

00:57:46.575 --> 00:57:51.755
you're now increasing the visibility and telling a user that this is a snapping

00:57:51.755 --> 00:57:54.795
area because they can see the dots or they can see the thumbnails.

00:57:55.175 --> 00:58:00.455
They can click the thumbnails and jump to an item, right? So the browser handles all this stuff.

00:58:00.775 --> 00:58:06.675
And these are just, I like to think of them as affordances on a regular scroll area.

00:58:07.095 --> 00:58:10.435
So you've got a regular scroll area that has a little bar at the bottom that

00:58:10.435 --> 00:58:12.535
you can grab and get the thumb,

00:58:12.655 --> 00:58:15.475
go back and forth, or you can add some

00:58:15.475 --> 00:58:18.355
buttons to the scroll area now they can click the buttons and that

00:58:18.355 --> 00:58:21.355
nudges the scroller back and forth and or

00:58:21.355 --> 00:58:24.335
you can add these scroll markers and again just these are affordances we

00:58:24.335 --> 00:58:27.155
didn't interrupt the way that the thing scrolled at all it's still

00:58:27.155 --> 00:58:30.015
just overflow auto but we've added

00:58:30.015 --> 00:58:33.355
these nice things for users to have additional interaction points

00:58:33.355 --> 00:58:36.075
that also provide feedback and information to the

00:58:36.075 --> 00:58:38.955
user about the state of the scroller and what's even available for

00:58:38.955 --> 00:58:41.735
them inside of it so that's my that's my

00:58:41.735 --> 00:58:45.255
little soapbox here is that they're not css carousel features they're

00:58:45.255 --> 00:58:48.615
just overflow five new affordances that

00:58:48.615 --> 00:58:51.975
you can put onto a scroller with css so progressive enhancement super

00:58:51.975 --> 00:58:54.875
easy to do and uh yeah there

00:58:54.875 --> 00:58:57.935
wasn't there like a carousel api

00:58:57.935 --> 00:59:00.835
also or is that something like is it something

00:59:00.835 --> 00:59:03.755
else or is it just so did it start

00:59:03.755 --> 00:59:07.695
off as carousel api and now it's it's it's

00:59:07.695 --> 00:59:11.615
scroll markers and buttons it there's

00:59:11.615 --> 00:59:14.655
never been a carousel api it's just a i think

00:59:14.655 --> 00:59:20.375
a well at least for the chrome team it was framed as carousel uh centric because

00:59:20.375 --> 00:59:24.235
that was one of the main pain points that we were targeting with it like we're

00:59:24.235 --> 00:59:28.595
looking at all these e-commerce stores um pinterest or whatever they all have

00:59:28.595 --> 00:59:31.635
a carousel of images in them or a carousel of products.

00:59:32.273 --> 00:59:37.193
And in every design system that we spoke with, the carousel ended up being way

00:59:37.193 --> 00:59:38.633
harder than they thought it was going to be.

00:59:39.373 --> 00:59:41.713
Just like one of the things you said in the beginning, kind of like a responsive

00:59:41.713 --> 00:59:44.893
one, right? Hey, on a big screen, I want to scroll by three items at a time.

00:59:44.993 --> 00:59:46.733
But on a mobile, I want to scroll by one at a time.

00:59:46.973 --> 00:59:50.453
That alone is a lot of work for someone to write in JavaScript,

00:59:50.453 --> 00:59:54.293
let alone all the buttons, the statefulness of the dots and the thumbnails.

00:59:54.673 --> 00:59:58.273
Just the whole thing became, it was a lot, it was always more complicated than

00:59:58.273 --> 01:00:01.753
people thought, which meant that they were not doing a lot of things.

01:00:01.753 --> 01:00:05.393
Like a lot of carousels don't have mobile touch support.

01:00:05.593 --> 01:00:08.493
You can't swipe them because they're not scrollers.

01:00:08.873 --> 01:00:12.433
They don't think of them as scrollers. So the engineer that built it to save

01:00:12.433 --> 01:00:16.133
themselves on trouble, they transform, slide everything around,

01:00:16.313 --> 01:00:19.693
which meant a touch user can't just swipe it.

01:00:19.793 --> 01:00:22.653
Or if they do swipe it, they get the, oh, they get the worst version,

01:00:22.753 --> 01:00:26.353
which is like, I call it an uncanny swipe where, I mean, back in the day with

01:00:26.353 --> 01:00:29.273
jQuery, you would swipe on an image and then after your swipe was done,

01:00:29.613 --> 01:00:32.593
then the image moved over. You know, it wasn't even attached to your finger.

01:00:32.833 --> 01:00:35.353
And then these days, you might have someone that does something a little bit

01:00:35.353 --> 01:00:37.353
like that, where like it follows your finger with JavaScript,

01:00:37.793 --> 01:00:39.033
you know, translating X.

01:00:39.213 --> 01:00:42.633
And then when you let go, it animates to the new position.

01:00:42.873 --> 01:00:46.213
And to you as a user, you're like, that's not the same as scroll snap.

01:00:46.893 --> 01:00:50.733
This didn't feel like my operating system. This felt like somebody animated

01:00:50.733 --> 01:00:51.853
the thing to the new position.

01:00:52.033 --> 01:00:55.653
And so you get this like uncanny experience. Like I'm not interacting with a scroller.

01:00:56.013 --> 01:00:58.853
I can feel it. um so anyway it's like

01:00:58.853 --> 01:01:01.673
all these and you had all these accessibility issues people

01:01:01.673 --> 01:01:05.293
so not only just like no touch support but there's all

01:01:05.293 --> 01:01:07.933
sorts of littered with issues and so these things kind of got rid of

01:01:07.933 --> 01:01:12.573
all that where you could just put markers or put buttons on there they would

01:01:12.573 --> 01:01:15.973
be as accessible as the browser could do and they're going to get more accessible

01:01:15.973 --> 01:01:22.093
over time and you could liberate your carousel component from having piles of

01:01:22.093 --> 01:01:27.233
javascript there was a google one that had seven scripts that loaded just to manage the carousel.

01:01:27.413 --> 01:01:31.793
And we got to delete all of the scripts and just put in a chunk of CSS.

01:01:32.153 --> 01:01:37.033
And so their page load performance went up. Their scroll experience was better for mobile.

01:01:37.393 --> 01:01:40.473
Users with JavaScript disabled got a carousel.

01:01:40.993 --> 01:01:45.193
Screen reader users were really happy because the things actually said what

01:01:45.193 --> 01:01:48.053
they were and said that they were in a list of this many items.

01:01:48.293 --> 01:01:51.553
And it was just much more descriptive about what was going on. so

01:01:51.553 --> 01:01:54.593
it's just like all these wins across the board and to me these again are still

01:01:54.593 --> 01:02:00.013
just scroll enhancements it's not a carousel it's just ways to make a scroller

01:02:00.013 --> 01:02:04.753
better for everybody yeah yeah i think for like for a carousel there's still

01:02:04.753 --> 01:02:09.833
things that are not solved yet like for example like the endless scroll.

01:02:11.627 --> 01:02:19.347
Possibility yeah so that's a really hard thing to to crack i don't know if that ever ever happens,

01:02:19.907 --> 01:02:24.527
um but yeah it's on it's on the task list so is infinite so you have uh you

01:02:24.527 --> 01:02:28.127
have lazy scrolling or like um what is the difference hold on do you have infinite

01:02:28.127 --> 01:02:31.467
scroll and you have cyclical scroll okay so what you described was cyclical

01:02:31.467 --> 01:02:34.867
scroll which is as i get to the last item as i keep scrolling it goes back to

01:02:34.867 --> 01:02:39.167
the beginning automatically browser engineers have an idea of how to do cyclical scroll.

01:02:39.667 --> 01:02:45.907
Infinite scroll though, we currently have contain intrinsic size and content visibility auto.

01:02:46.127 --> 01:02:51.387
And these will delay rendering of the items until they approach the viewport and then paint them.

01:02:51.507 --> 01:02:56.107
So you can save on rendering, but it's not the same thing as an infinite list

01:02:56.107 --> 01:03:00.347
where users expect to load more data by the time they reach a bottom.

01:03:00.687 --> 01:03:03.167
You know, oh, I scrolled to the bottom. Now I need to get a hundred more.

01:03:03.387 --> 01:03:08.087
Oh, I'm going to get a hundred more. And that's different than the virtualized

01:03:08.087 --> 01:03:09.967
scrolling that you can get with contained intrinsic size.

01:03:10.107 --> 01:03:14.187
Anyway, these are all things that were on my list of paint points and things

01:03:14.187 --> 01:03:15.027
that we needed to make better.

01:03:15.507 --> 01:03:18.347
And cyclical scrolling is probably going to get done before infinite.

01:03:19.407 --> 01:03:23.527
But we do need an infinite list view on the web. We need something that is competitive

01:03:23.527 --> 01:03:25.987
with a UI table view that they have on native.

01:03:26.427 --> 01:03:30.647
And, you know, React, the whole reason React got invented like 12 years ago

01:03:30.647 --> 01:03:32.087
or whatever was for an infinite list.

01:03:32.667 --> 01:03:36.147
So if we can get rid of that need, we could get rid of a lot of the requirements

01:03:36.147 --> 01:03:39.307
that folks are reaching for these tools just to do that one little thing.

01:03:41.888 --> 01:03:46.908
Yes, I agree. I remember there was, wasn't there also one, some kind of web

01:03:46.908 --> 01:03:53.528
component or like a built-in web component thing that was supposed to implement

01:03:53.528 --> 01:03:55.808
an infinite list in Chrome?

01:03:57.108 --> 01:04:01.208
Oh, there was a Lappy at one point. Yeah, the layered API.

01:04:01.468 --> 01:04:04.888
They had a couple of them. They had Toast. And was it an infinite list one? yeah it

01:04:04.888 --> 01:04:08.928
was it was i think it was a similar thing to to toast

01:04:08.928 --> 01:04:11.888
so it was also that at that same time

01:04:11.888 --> 01:04:15.168
i think that uh chrome the chrome

01:04:15.168 --> 01:04:18.068
engineers yeah that was the layered apis at chrome dev

01:04:18.068 --> 01:04:20.948
summit lapi's lappies and they got pushed back

01:04:20.948 --> 01:04:24.388
hard from the community and uh crushed a

01:04:24.388 --> 01:04:28.148
lot of those developers a lot of developers quit after that they were like geez uh

01:04:28.148 --> 01:04:31.148
all we wanted to do is help you and you all got so

01:04:31.148 --> 01:04:36.828
mad at us and they were like fine bye and they left well i

01:04:36.828 --> 01:04:43.828
i can totally imagine yeah happens yeah

01:04:43.828 --> 01:04:47.008
i wanted to see the i wanted to see the scroll marker

01:04:47.008 --> 01:04:52.608
in action and i went to the mdn web docs and maybe i asked you to also go to

01:04:52.608 --> 01:04:58.508
this page and try it out the And one thing I'm confused with is there is this

01:04:58.508 --> 01:05:04.088
example with the red buttons below the item list, which you can click.

01:05:05.328 --> 01:05:09.988
And when I click it, it also scrolls down the page.

01:05:10.188 --> 01:05:14.368
And I think it scrolls down too much because there is this sticky stuck header

01:05:14.368 --> 01:05:15.868
on top, which is an overlying.

01:05:16.188 --> 01:05:21.188
Is it on purpose that it also scrolls down instead of only left and right?

01:05:21.188 --> 01:05:26.448
We were talking about earlier where scroll into view is toggling too many scrollers.

01:05:26.848 --> 01:05:31.708
I wonder if they've written JavaScript and that those aren't CSS markers. Let me see.

01:05:33.633 --> 01:05:36.813
Here it's a scroll marker but maybe they have javascript

01:05:36.813 --> 01:05:39.713
clicking on it yeah it shouldn't scroll the page like that

01:05:39.713 --> 01:05:42.453
that's not good if you want to see good examples here i

01:05:42.453 --> 01:05:46.913
just sent a link on our thing there it's chrome.dev slash carousel and

01:05:46.913 --> 01:05:50.293
i built about 20 so you're talking about business use cases um

01:05:50.293 --> 01:05:53.133
i use overflow 5 so scroll

01:05:53.133 --> 01:05:55.753
buttons and scroll markers and scroll driven animations and a

01:05:55.753 --> 01:05:59.113
few of these things and i layer them in to all of these um

01:05:59.113 --> 01:06:01.733
business use cases where you

01:06:01.733 --> 01:06:04.613
have either a media player you have weather widgets you have

01:06:04.613 --> 01:06:07.793
testimonials you have a product slider with product images

01:06:07.793 --> 01:06:10.933
you have an app switcher you have a tv series where

01:06:10.933 --> 01:06:13.813
you're scrolling through tv series like your series one series two the

01:06:13.813 --> 01:06:17.413
seasons uh hubs pages a gallery a wizard

01:06:17.413 --> 01:06:22.013
which is like a form-based wizard which uses the scroll uh overflow

01:06:22.013 --> 01:06:25.113
five features and then you have like a the vertical wheel

01:06:25.113 --> 01:06:30.193
which to me looks like a retro video game system um and

01:06:30.193 --> 01:06:33.593
so yeah my goal of this was to take these primitives like

01:06:33.593 --> 01:06:36.493
we're talking about earlier like hey what am i supposed to do with buttons and markers

01:06:36.493 --> 01:06:39.173
and it's like well it's css yo you could do whatever you

01:06:39.173 --> 01:06:42.533
want so here it is like a whole bunch of meaningful

01:06:42.533 --> 01:06:46.313
use cases using these features um and

01:06:46.313 --> 01:06:49.273
for things way more than carousels although you could.

01:06:49.273 --> 01:06:52.313
Argue they're all carousels but maybe they're not i don't

01:06:52.313 --> 01:06:57.973
know you decide no they feel better i i why you were joking i played around

01:06:57.973 --> 01:07:01.353
with the horizontal cards all of the time because they have this nice effect

01:07:01.353 --> 01:07:06.073
of showing additional information when they are in focus yeah scroll state query

01:07:06.073 --> 01:07:12.113
that's when it snapped when it snapped you present the caption it's also so smooth,

01:07:13.127 --> 01:07:15.667
Yeah, no JavaScript in there. Pretty amazing, huh?

01:07:18.027 --> 01:07:23.207
So yeah, that's scroll state. One more use case for the scroll markers is also

01:07:23.207 --> 01:07:27.047
this thing where you have like a table of contents and when you scroll on the

01:07:27.047 --> 01:07:31.307
page and if it's like a position fixed, for example, and you scroll in the page,

01:07:31.447 --> 01:07:32.987
then you could, for example,

01:07:33.387 --> 01:07:37.987
highlight the section, like the link that points to the section that you're

01:07:37.987 --> 01:07:42.367
currently in, right? Yeah, that's the vertical scrollsby.

01:07:43.127 --> 01:07:48.047
And that's because a marker, a marker is not a dot for a carousel.

01:07:48.567 --> 01:07:53.187
A scroll marker is a way for you to select an element in a scroll area.

01:07:53.627 --> 01:07:58.767
And I call it making a point of interest and surfacing that point of interest

01:07:58.767 --> 01:08:00.387
into the scroll marker list.

01:08:00.647 --> 01:08:03.927
And so, yeah, you've got an article, you wrote an article, all your headers.

01:08:04.367 --> 01:08:08.507
Those are you usually can scroll to them, right? You put a little hashtag tag there.

01:08:08.907 --> 01:08:14.227
You can also make them a scroll marker. So your table of contents is now generated

01:08:14.227 --> 01:08:19.207
from CSS based on the selectors and content that you specify.

01:08:19.207 --> 01:08:23.487
So you could highlight all the headers and be like, hey, add those to my scroll marker list.

01:08:23.627 --> 01:08:27.507
And now the browser manages highlighting them, clicking them and scrolling them

01:08:27.507 --> 01:08:29.187
down to that header, everything.

01:08:29.347 --> 01:08:32.347
You don't have to do any of it. And it's because you said these are points of

01:08:32.347 --> 01:08:36.247
interest. I want to surface and make them easier for my users to find into this

01:08:36.247 --> 01:08:39.547
one little group called a marker group. It's pretty cool.

01:08:40.807 --> 01:08:44.507
If you go to the TV series demo too, in the horizontal TV series,

01:08:45.027 --> 01:08:49.627
the season one and season two are generated markers off of a group of content.

01:08:49.827 --> 01:08:53.167
So you don't have to make a point of interest. A marker doesn't have to be one item.

01:08:53.787 --> 01:08:58.567
It can represent a group. And so in this case, season one and season two are

01:08:58.567 --> 01:09:02.847
generated dynamically based off the content. It's kind of cool.

01:09:04.067 --> 01:09:09.087
You know, really cool stuff to play with and to like refactor the code.

01:09:11.596 --> 01:09:14.956
Uh then you you list scroll bar color yeah uh

01:09:14.956 --> 01:09:17.796
that was because why did you do that

01:09:17.796 --> 01:09:20.596
at my talk at css day i one of

01:09:20.596 --> 01:09:23.576
the opening things was i was like here's here's the problem is most

01:09:23.576 --> 01:09:32.036
people just do overflow auto and they're done to them it scrolls it's it's done

01:09:32.036 --> 01:09:36.296
i'm all done and i'm like no you're not done you just did one and i also talked

01:09:36.296 --> 01:09:41.396
about how overflow auto is a really wildly powerful CSS property value pair.

01:09:41.576 --> 01:09:45.656
Because think about all this stuff. You get a stateful bar that gets added to

01:09:45.656 --> 01:09:50.136
your scroll area with a stateful thumb that then you can grab back and forth.

01:09:50.256 --> 01:09:54.236
The size of the thumb grows and shrinks based on how much the scroll area is, blah, blah, blah.

01:09:54.456 --> 01:09:58.956
I basically am like, overflow auto is very similar to a video tag where you

01:09:58.956 --> 01:10:00.456
get all these controls for free.

01:10:00.576 --> 01:10:02.896
They just pop up. The browser just generates controls.

01:10:03.636 --> 01:10:06.456
And it's like, I don't think... So it's like step one, audience, was

01:10:06.456 --> 01:10:09.516
I don't think you've thought very hard about how much magic you

01:10:09.516 --> 01:10:13.296
get for overflow auto and then i'm

01:10:13.296 --> 01:10:16.456
like but you can also do better so let's make this really

01:10:16.456 --> 01:10:19.316
great feature because it has all these features when you do overflow auto

01:10:19.316 --> 01:10:22.156
just so many features like your keyboard you know your up and down arrows

01:10:22.156 --> 01:10:25.816
work the page up down buttons work you can hit the home button scroll to the

01:10:25.816 --> 01:10:29.456
bottom you can hit the whatever there's like or page end there's all these different

01:10:29.456 --> 01:10:32.916
ways to interact with a scroller and so then scroll bar color is i'm like here's

01:10:32.916 --> 01:10:35.876
the first thing that you need to do to avoid looking like and then i show a

01:10:35.876 --> 01:10:41.136
bunch of websites that have a scroll area and they don't have scroll bar color on their site.

01:10:41.970 --> 01:10:47.610
And I'm browsing as a user with scroll bars set to inline, not overlay.

01:10:48.270 --> 01:10:52.430
Most developers are on a Mac. And on Mac, the default is overlay scroll bars,

01:10:52.530 --> 01:10:55.090
which means you don't see hideous scroll bars very often.

01:10:55.330 --> 01:10:58.730
If you are on a Windows machine, I think that's a big problem.

01:10:58.990 --> 01:11:01.210
See, thank you, dude. That was my thing. I was like, here's a big problem.

01:11:01.350 --> 01:11:05.070
I guarantee 90% of the people in this crowd, even though you're all CSS professionals,

01:11:05.290 --> 01:11:07.350
don't have this property on your site.

01:11:07.490 --> 01:11:10.070
And it's making your site look bad. If you have a scroll area,

01:11:10.270 --> 01:11:15.510
this is hideous. And so I walk them through bad cases and how one CSS property,

01:11:15.730 --> 01:11:21.010
which is scrollbar color, can make it look integrated and beautiful and nice on your site.

01:11:21.150 --> 01:11:24.850
And then I go even further into it. I'm like, here, we can add hover effects if the user can hover.

01:11:25.030 --> 01:11:27.530
So that way it's kind of faint until you hover in the scroll area.

01:11:27.650 --> 01:11:31.670
Now the scrollbar highlights and becomes higher contrast, letting the user know

01:11:31.670 --> 01:11:34.450
that the scrollbar is represented in the scroll area.

01:11:34.630 --> 01:11:38.750
If the keyboard focuses inside of there, highlight the scrollbar thumb a blue color.

01:11:39.230 --> 01:11:42.550
Make it look like if they use their arrow keys, it's going to control the scroller

01:11:42.550 --> 01:11:44.630
because that's what happens when you focus into a scroller.

01:11:44.810 --> 01:11:49.950
We just, most people don't build in these visual affordances to hint to a user

01:11:49.950 --> 01:11:53.450
about the behavior and functionality. Users tend to just explore.

01:11:53.650 --> 01:11:56.230
They're like, oh, I'll smash my keyboard keys and see if it scrolls the area.

01:11:56.690 --> 01:12:00.290
So yeah, we do scroll bar color. We talk about scroll bar. And then I go build

01:12:00.290 --> 01:12:03.570
really beautiful scroll examples where I'm like, here's all the layers.

01:12:04.190 --> 01:12:06.890
And then I did it with cascade layers too it's kind of fun so it's like

01:12:06.890 --> 01:12:09.830
you unveil a cascade layer and it adds a new feature to the scroller

01:12:09.830 --> 01:12:12.910
and so the talk was me unveiling cascade layers adding

01:12:12.910 --> 01:12:17.350
features to scrollers that worked across all the browsers um and

01:12:17.350 --> 01:12:21.010
the whole goal was making smooth beautiful scroll

01:12:21.010 --> 01:12:23.810
experiences and so i put scroll bar color on here because yeah i wanted to

01:12:23.810 --> 01:12:26.650
talk about inline scroll bars and how i actually think they're better

01:12:26.650 --> 01:12:29.570
and how to style them so they don't make your site look hideous

01:12:29.570 --> 01:12:33.690
um yeah yeah we

01:12:33.690 --> 01:12:36.350
will link to your slides but i think it's not

01:12:36.350 --> 01:12:39.250
the real deal so we have to watch your talk and it's

01:12:39.250 --> 01:12:42.770
not yet published they might not be either it now

01:12:42.770 --> 01:12:45.410
i think it won't be published until this will be

01:12:45.410 --> 01:12:48.310
published but we'll so once it is

01:12:48.310 --> 01:12:55.110
we'll just edit this episodes show notes and put it in so yeah or have an eye

01:12:55.110 --> 01:12:59.590
out for like the css day videos yep they might not get released this year so

01:12:59.590 --> 01:13:04.410
i might end up doing my talk oh okay just for free on youtube or something like

01:13:04.410 --> 01:13:05.410
that and just post it we'll see.

01:13:06.690 --> 01:13:10.930
Ah, okay. I get it. Yeah, I just wanted to add,

01:13:11.110 --> 01:13:18.150
so, like, I think every Mac user should plug in, like, a mouse or pointing device

01:13:18.150 --> 01:13:23.130
into the laptop, and then I think, like, scroll bars appear, right?

01:13:23.130 --> 01:13:26.170
Nice so it's uh just when

01:13:26.170 --> 01:13:29.630
you're like just working with your touch uh

01:13:29.630 --> 01:13:32.550
pad that you don't that you get yeah these

01:13:32.550 --> 01:13:35.350
overlaid scroll bars that appear and

01:13:35.350 --> 01:13:38.970
disappear depending on where your mouse is where your

01:13:38.970 --> 01:13:41.790
pointer yep i had a slide in there that shows the

01:13:41.790 --> 01:13:45.310
before and after so that you could see like um what

01:13:45.310 --> 01:13:48.450
the scroll bars look like if you haven't written this style and then you slide

01:13:48.450 --> 01:13:51.190
over on the image comparison widget or whatever and then you see that

01:13:51.190 --> 01:13:54.230
they're all nice and you'll find that in the slides everybody

01:13:54.230 --> 01:13:59.050
it's like slide four okay is

01:13:59.050 --> 01:14:05.030
a scroll bar the scroll bar also attached to accent color or it's not um and

01:14:05.030 --> 01:14:10.150
part of my advice too was um generally don't change much about the root scroller

01:14:10.150 --> 01:14:13.870
so the you know the main document scroller but your nested scrollers you can

01:14:13.870 --> 01:14:16.850
um customize those a little bit more but still the root scroller,

01:14:16.970 --> 01:14:18.810
you at least need to say scroll bar color.

01:14:19.690 --> 01:14:24.130
And you could just say canvas text space transparent.

01:14:24.750 --> 01:14:28.610
You need to make that track transparent. And then you need the thumb color to

01:14:28.610 --> 01:14:30.890
be some sort of dynamic adaptive color from your system.

01:14:30.970 --> 01:14:34.010
So you could use a system color like canvas text, or you could use,

01:14:34.030 --> 01:14:37.870
you know, var my text color one or whatever.

01:14:38.170 --> 01:14:41.710
And that way it matches your site and has a transparent track.

01:14:41.970 --> 01:14:45.050
And that'll really modernize the way that your inline scroll

01:14:45.050 --> 01:14:48.090
bars looked on your website so it's like a huge tip right

01:14:48.090 --> 01:14:52.810
there okay well

01:14:52.810 --> 01:14:55.910
looking forward to your uh to your talk uh just

01:14:55.910 --> 01:14:59.130
ping us when you have something uh online

01:14:59.130 --> 01:15:02.010
and then we'll link it in the show notes

01:15:02.010 --> 01:15:04.950
we'll do and watch it i did blog about it uh

01:15:04.950 --> 01:15:07.770
the nintendo switch home screen recreation so that's in

01:15:07.770 --> 01:15:10.810
the show notes here it's nerdy.dev slash nintendo switch home

01:15:10.810 --> 01:15:16.150
screen css recreation and i walk you through the whole process of taking a regular

01:15:16.150 --> 01:15:22.150
overflow uh hidden or overflow auto scroller of video games and then layering

01:15:22.150 --> 01:15:29.050
in piece by piece really meaningful additions that help it look elegant integrated and feel good for users.

01:15:32.212 --> 01:15:38.092
All right, cool. So then you have sibling index and sibling count.

01:15:38.212 --> 01:15:44.672
Those are also, I think, very eagerly awaited by the programmers, I guess.

01:15:44.872 --> 01:15:50.152
Yeah, this solves just the classic problem of, I want to know if this is the

01:15:50.152 --> 01:15:54.272
third item so that I can stagger its animation or I can change its background

01:15:54.272 --> 01:15:57.272
color to be this shade of a hue.

01:15:58.772 --> 01:16:01.692
And it all comes down to just getting the right words

01:16:01.692 --> 01:16:04.652
for the name of the function and it turns out we're going to use sibling

01:16:04.652 --> 01:16:07.432
index and sibling count so you you can know how

01:16:07.432 --> 01:16:10.172
many siblings you have like i'm one

01:16:10.172 --> 01:16:13.072
of 12 and then you can be like what's my position you're

01:16:13.072 --> 01:16:16.052
like oh but i'm position three of 12 and you

01:16:16.052 --> 01:16:19.552
can use that information to do whatever you want and there's all sorts of cool

01:16:19.552 --> 01:16:24.212
demos and examples and it'll get it'll get this work out of our template syntax

01:16:24.212 --> 01:16:28.052
which is usually where people put it is they'll you know whether it's in jsx

01:16:28.052 --> 01:16:31.452
or if they're in php or wherever their template syntax is and they have an each

01:16:31.452 --> 01:16:35.312
for each and they'll put the index on the element,

01:16:36.712 --> 01:16:39.732
but that also doesn't work if you shuffle it and stuff like that so anyway this

01:16:39.732 --> 01:16:43.332
will be a really cool function i mean you're just talking about new what's new

01:16:43.332 --> 01:16:47.852
in css and cool stuff sibling count is in chrome canary i think it's set to

01:16:47.852 --> 01:16:51.732
ship soon and there's very positive signals across support from developers to

01:16:51.732 --> 01:16:55.252
implementers that that's just a cool sibling index.

01:16:57.077 --> 01:17:00.657
Yeah i think it's also one one of the missing puzzle

01:17:00.657 --> 01:17:04.857
pieces to like really replace uh scss

01:17:04.857 --> 01:17:07.477
and these kinds of things like for example if you

01:17:07.477 --> 01:17:10.737
have 10 elements and you want them like to be

01:17:10.737 --> 01:17:13.637
animated into the screen but you want like the delay

01:17:13.637 --> 01:17:16.617
to uh to increase with every element

01:17:16.617 --> 01:17:19.397
so that you have them animating one after the other

01:17:19.397 --> 01:17:22.097
uh that's something you that you could

01:17:22.097 --> 01:17:25.257
do with sibling count instead of doing a

01:17:25.257 --> 01:17:29.037
for each and then nth child selector

01:17:29.037 --> 01:17:33.557
thing in scss for example yeah as

01:17:33.557 --> 01:17:38.037
are the next functions or next features some big game changers here we got at

01:17:38.037 --> 01:17:43.897
function and at mixin and uh a mixin could use a function but a function function

01:17:43.897 --> 01:17:48.137
can't use a mixin and then we have if statements here and so this is just uh

01:17:48.137 --> 01:17:50.397
really digging more into some of those SaaS features,

01:17:50.437 --> 01:17:54.357
digging more into the fact that this is a robust language that's looking to really.

01:17:55.597 --> 01:17:59.017
Expand itself into being more dry.

01:17:59.317 --> 01:18:02.937
So repeating yourself even less, creating healthy utilities.

01:18:03.317 --> 01:18:06.297
So I like to think of at function as returning a value.

01:18:06.657 --> 01:18:11.337
So if you've got like a property value, like overflow colon auto property colon

01:18:11.337 --> 01:18:14.897
value, at function fits on the right hand side of the colon.

01:18:15.137 --> 01:18:16.717
It can't go anywhere else.

01:18:17.177 --> 01:18:21.877
Whereas at mixin can replace all sorts of property value combinations.

01:18:22.377 --> 01:18:26.137
And so, and it works just like at apply. So at mixin defines it,

01:18:26.217 --> 01:18:30.437
it can take some parameters and at apply applies it and at function can take

01:18:30.437 --> 01:18:31.877
parameters and return a value.

01:18:32.237 --> 01:18:35.517
And these two things are going to be wild.

01:18:35.717 --> 01:18:38.677
And their functions and mixins are prototyped in Chrome Canary.

01:18:38.857 --> 01:18:42.317
You can go try them right now. And those specs are in early phases and you can

01:18:42.317 --> 01:18:44.537
have your voice heard and help impact them.

01:18:44.677 --> 01:18:51.517
And anyway, these are just really cool to hear if mixing and functions coming to CSS is pretty sweet.

01:18:53.674 --> 01:18:56.194
Yep, absolutely. I think so. What

01:18:56.194 --> 01:19:02.414
I use function a lot for is to translate pixel values into RAM values.

01:19:02.634 --> 01:19:05.914
I think that should then also be possible with add function, right?

01:19:07.454 --> 01:19:14.674
Because I just don't want to calculate, and I also don't want to mess with the root font size.

01:19:14.854 --> 01:19:20.434
So yeah, that's super cool. and mix-in is like fantastic to to organize code

01:19:20.434 --> 01:19:25.614
and also maybe to minimize the the size of your css if you have like repeating

01:19:25.614 --> 01:19:30.554
patterns everywhere then you can just import these mix-in blocks,

01:19:31.574 --> 01:19:37.254
totally cool and if else of course is also fantastic yeah i'll kind of get rid

01:19:37.254 --> 01:19:41.094
of our hacks that we're doing right now you know clamp or what do we do right

01:19:41.094 --> 01:19:44.094
now we take calc and we multiply it by a really high number,

01:19:45.774 --> 01:19:50.134
and then we see if it's over a threshold or under a few dirty tricks. Yeah.

01:19:53.874 --> 01:20:01.634
We can also link a very short video from Juna where she shows off if and also

01:20:01.634 --> 01:20:04.814
something else that I've forgotten, but that was nice.

01:20:06.174 --> 01:20:08.234
Yep, awesome. Took a note.

01:20:10.194 --> 01:20:13.194
Yeah, I think we're almost through we

01:20:13.194 --> 01:20:16.174
talked about css day a lot already yeah you

01:20:16.174 --> 01:20:21.554
also did like a few other things like mixed and i i apparently like a few view

01:20:21.554 --> 01:20:26.414
transition the whole the whole talk all the slides are view transitions gsap

01:20:26.414 --> 01:20:32.534
split text and starting style and wow uh and my view transitions are 3d view

01:20:32.534 --> 01:20:34.454
transitions which i don't think a lot of people have seen,

01:20:35.034 --> 01:20:37.834
and so uh the browser just so

01:20:37.834 --> 01:20:40.734
you rebuilt uh reveal jess i did yeah

01:20:40.734 --> 01:20:43.594
it's or even um keynote you know

01:20:43.594 --> 01:20:46.394
because it's all auto animate i don't i don't like all

01:20:46.394 --> 01:20:49.134
those animations that you see as you go through there i don't tell

01:20:49.134 --> 01:20:51.974
those what to do all i did is i have like a little framework that

01:20:51.974 --> 01:20:55.014
automatically gives view transition names to children and

01:20:55.014 --> 01:20:57.874
tries to find and create unique ones and then the browser

01:20:57.874 --> 01:21:00.734
just finds the pages and says oh here's the title from this

01:21:00.734 --> 01:21:03.654
page and the title for the next page i'll just morph them and

01:21:03.654 --> 01:21:06.754
i'm like cool during that morph i want you to do a 3d flip and it's

01:21:06.754 --> 01:21:09.534
like all right so the browser uh and i

01:21:09.534 --> 01:21:12.674
just had a blast making those slides they're very modern feeling

01:21:12.674 --> 01:21:18.874
very um animated and interactive and it's all just web pages they're each web

01:21:18.874 --> 01:21:25.754
pages i build in astro it's pretty cool wow so it's not just what's inside the

01:21:25.754 --> 01:21:30.094
slides it's also the slides themselves that are worth having a look at.

01:21:33.572 --> 01:21:36.712
Cool and then the final two things that we with

01:21:36.712 --> 01:21:39.632
here is a custom select which a

01:21:39.632 --> 01:21:44.012
few people might already know uh it's

01:21:44.012 --> 01:21:46.672
it's basically just the the beginning of a

01:21:46.672 --> 01:21:50.692
lot of like more form

01:21:50.692 --> 01:21:53.952
input elements that are going to

01:21:53.952 --> 01:21:56.892
end up being styled one day

01:21:56.892 --> 01:21:59.672
yep yep you got it and it's just

01:21:59.672 --> 01:22:02.652
like in terms of new css it's just really fun still to to

01:22:02.652 --> 01:22:06.572
know that a select can be customized um and

01:22:06.572 --> 01:22:09.412
you know there's not a whole lot of exploration that's been done here

01:22:09.412 --> 01:22:12.412
yet so if you're a hand crafting ui developer you

01:22:12.412 --> 01:22:16.152
can go make some really cool stuff with these i gotta check out brecht he's

01:22:16.152 --> 01:22:19.672
done a lot of really fun things with custom selects i've done mostly custom

01:22:19.672 --> 01:22:25.332
selects that are very business oriented they're not as fun um or whimsical um

01:22:25.332 --> 01:22:29.492
but yeah i gotta gotta go check those things out in terms of new CSS,

01:22:29.812 --> 01:22:33.712
it's just really cool that we're finally going to be able to customize input elements,

01:22:34.552 --> 01:22:36.092
a lot. That'd be great.

01:22:38.292 --> 01:22:44.032
Yeah. I think the elephant in the room there is still the multi-select. Yep.

01:22:45.632 --> 01:22:52.432
But it's like, this is such a train wreck on every platform,

01:22:53.092 --> 01:22:56.432
in every incarnation that I've seen.

01:22:56.432 --> 01:23:04.692
And so it's, yeah, I don't, I'm not surprised that people focus on the non-multi version.

01:23:05.412 --> 01:23:10.832
Yep, I agree. It's got a lot of warts and a lot of old features they're going

01:23:10.832 --> 01:23:12.852
to have to patch to get that worked up.

01:23:13.172 --> 01:23:17.372
But I'm looking forward to it. And it's fun to see Apple right now really looking

01:23:17.372 --> 01:23:21.572
into these customized inputs and putting a lot of effort and thought process

01:23:21.572 --> 01:23:25.852
into how to empower us to make these beautiful. Yep, it's nice.

01:23:26.692 --> 01:23:31.572
And the last thing we have here is CSS 4 and 5.

01:23:32.412 --> 01:23:39.732
So we did talk about it in, I don't know when, with Quentin. Oh, nice. Yeah.

01:23:42.272 --> 01:23:47.732
Probably a year ago, I would guess. It was November 2024.

01:23:49.352 --> 01:23:53.972
640, I think. Yes, 640. Not that long ago. Nice.

01:23:56.432 --> 01:24:03.472
Yeah so yeah we have a new logo that uh you designed or co-designed but uh i

01:24:03.472 --> 01:24:10.452
think you you really did most of the work i yeah and it's really nice thank

01:24:10.452 --> 01:24:13.932
you i was really happy to see that logo has done so good um.

01:24:14.866 --> 01:24:19.246
And it was very much a community effort, but I was there shepherding it and,

01:24:19.246 --> 01:24:22.626
you know, kind of helping create submissions,

01:24:22.886 --> 01:24:26.346
create a platform for people to collaborate in, creating some guidelines and

01:24:26.346 --> 01:24:30.606
rules to help us make sure we create something that's accessible and desirable all at the same time.

01:24:30.726 --> 01:24:34.466
And yeah, it took a while and I really like what we landed at,

01:24:34.546 --> 01:24:39.546
but I put a CSS4.5 on here just because it was fun at the beginning.

01:24:39.706 --> 01:24:42.706
It was like, oh, it was last time we talked, it was pretty much CSS4.

01:24:42.946 --> 01:24:46.846
Now we're in CSS5. Hey, CSS6, we even talked about some CSS6 items today.

01:24:47.526 --> 01:24:50.866
And I think those are still really nice. So that group is still together.

01:24:50.866 --> 01:24:56.326
But since I've left Google, my activity has dropped, but I intend to get back into it.

01:24:56.466 --> 01:24:59.846
And we have pretty much everything labeled right now.

01:25:00.006 --> 01:25:05.946
So every CSS property that's ever come out is in a bucket of CSS4, 5, or 6 with a reason.

01:25:06.186 --> 01:25:10.626
And we even have this website you can go to to kind of explore and look at features

01:25:10.626 --> 01:25:14.566
and be like, well, hey, what's in CSS5? because we feel like that's one of the

01:25:14.566 --> 01:25:16.286
most valuable things that people are going to do.

01:25:16.426 --> 01:25:18.906
It's just like, I'm feeling behind on CSS, what's new?

01:25:19.186 --> 01:25:21.406
And then they can be like, oh, snap, there's CSS four.

01:25:21.766 --> 01:25:24.586
I didn't even, I mean, I remember CSS three, what's in four?

01:25:24.686 --> 01:25:25.986
And they're like, what four, there's a five.

01:25:26.166 --> 01:25:31.566
And so each of these little moments can create meaningful learning opportunities

01:25:31.566 --> 01:25:34.566
for people who just kind of want to see the breadth of what's come out.

01:25:34.746 --> 01:25:36.586
And they don't want to look at a huge list.

01:25:37.366 --> 01:25:40.646
And they want to see things that sort of like have rolled out together or things

01:25:40.646 --> 01:25:45.986
that rolled out um as part of an era and so that's uh i just wanted to bring

01:25:45.986 --> 01:25:49.306
that back up that it's still there uh we still intend on finishing it and i

01:25:49.306 --> 01:25:51.006
still think it's got some high value impact

01:25:51.446 --> 01:25:54.146
but just in case anyone was curious they're like adam what's happening with

01:25:54.146 --> 01:25:59.186
css 4 5 and 6 or whatever and like it's still there the community group is still

01:25:59.186 --> 01:26:03.126
talking about it um and we're just kind of in like you know how like the 80

01:26:03.126 --> 01:26:06.466
20 rule where 80 of it was easy to do and 20 of it is hard.

01:26:07.061 --> 01:26:10.501
We're definitely in that 20 finishing style uh

01:26:10.501 --> 01:26:13.421
phase and we'll get we'll get there so just

01:26:13.421 --> 01:26:16.841
wanted to let everyone know yeah but people already people

01:26:16.841 --> 01:26:20.121
are already talking about it getting the word out so i've

01:26:20.121 --> 01:26:23.161
found plenty of blog posts

01:26:23.161 --> 01:26:26.261
or talks where people were talking

01:26:26.261 --> 01:26:29.181
about css four and five of course

01:26:29.181 --> 01:26:32.381
it's it's like not not the broad mass of

01:26:32.381 --> 01:26:35.481
talks but it's it's mostly people

01:26:35.481 --> 01:26:38.981
that are like really deep into css but it's

01:26:38.981 --> 01:26:42.241
nice to see these terms being coined

01:26:42.241 --> 01:26:45.221
and appear everywhere now

01:26:45.221 --> 01:26:48.921
yeah awesome wonderful so

01:26:48.921 --> 01:26:57.701
that was a mouthful a lot of things i think to read up on we we have our document

01:26:57.701 --> 01:27:05.321
here with plenty of links and notes for links to to add and we'll put them all in show notes.

01:27:05.721 --> 01:27:07.681
Everybody can look it up.

01:27:08.201 --> 01:27:13.621
And to you, thanks a lot for your time, for being here, for enlightening us.

01:27:15.401 --> 01:27:22.501
For, but not us alone, but everyone and doing these nice experiments and talking

01:27:22.501 --> 01:27:24.101
about it. You are welcome.

01:27:24.821 --> 01:27:31.261
And if there are questions to you, people will find your contact data also in

01:27:31.261 --> 01:27:33.341
our show notes, if they don't have it already.

01:27:33.341 --> 01:27:42.701
And with that we wish everyone a nice day evening or a night and listen to you

01:27:42.701 --> 01:27:46.421
next week bye thank you bye.

01:27:47.440 --> 01:28:15.931
Music.

