It’s not every day we get to talk to someone who actually helps shape the CSS of tomorrow - which is why we were thrilled to welcome back Adam Argyle (LinkedIn / Bluesky / Mastodon), creative tinkerer…
Audio and video play straight from the show's own hosting. PodSubs stores and serves no media.
Transcript
From the show. Tap a time to play from there.
As the front end developer, you have to look at the design and try to decide how much am I going to translate into like directly based on what they have? Or how much am I going to transform a little bit in the translation to make it adapt better to the web? But we do need an infinite list view on the web. We need something that is competitive with a UI table view that they have on native and, you know, React. The whole reason React got invented like 12 years ago or whatever was for an infinite list. Thank you, dude. That was my thing. I was like, here's a big problem.
I guarantee 90% of the people in this crowd, even though you're all CSS professionals, don't have this property on your site and it's making your site look bad. Music.
Revision 672 we are three people two from the team one is vanessa hello vanessa hi, my name is shep and that means we have a guest and that guest is adam argyle hello adam hello happy to be here yeah thank you for joining us from seattle and also across not just the pond, but also all kinds of time zones. Very cool that we could make this happen.
You have been guest with us already, but we looked up when that was, and that was 2020, so five years ago. So our guess is that a lot of our listeners, and maybe also listeners that just listened to this episode, won't know you. So would you maybe tell us who you are and what you're doing? Yeah, of course. Oh, I can't believe that was like CSS4 five years ago. Now we're on CSS5. There's been a whole bunch of stuff that's happened. Woo!
My name's Adam Do, and I hail from the States. I'm on the West Coast, the best coast, the fresh coast. I'm just a kind of excited, easy-going UI developer. I love sweating all the details. I like nerding out about border radius and, you know, nested border radius and all the weird little things that can happen along the way of making a desirable user experience. I just want to make UIs that people go, oh, that wasn't just functional. That was kind of delightful. Or there was a moment there where I didn't feel
like I was making a business transaction. I was entertained by the cute little bird that flew by or something. And so I've just always spent my time acquiring skills and tools so that I can make nice user experiences. And sometimes that means getting into the back end. Sometimes in the front end, it doesn't matter. I'll do what it takes to make a good user experience. And that's led me to a lot of focus on CSS because a lot of people don't focus on CSS and you need someone to. And so I always stepped in and was happy to learn the skills and learn the language to, again, just deliver delightful user experience.
And so it's a little bit about me. I was at Google for seven years, but I'm not anymore. Yeah, and I think you also picked the right topic because I would say since you concentrated on CSS, CSS really went off and went through the roof with features and new developments and advancements. So CSS is the new JavaScript, maybe? Yeah, I think so. I even showed up and that's kind of how I got that role on
Chrome doing CSS was I was like, hey, you have like six people doing JavaScript dev rel things. Where's the CSS one? And they were like, you do it. And I was like, nope, I don't have any skills doing this, whatever. Anyway, I got talked into it and I already loved the language. So at that point, it's just learning how to dev rel. But yes, I didn't do all the work. That's definitely not the case. But I do feel like Like I lit a fire under it at Chrome specifically and said there's more work to do here and there's a lot
of value that we can get out of this for users and developers. And that pitch really resonated with them for a long time. And I was happy to see that grow. Yeah, and also I have the impression that the whole focus also of the DevRel team moved a lot more towards CSS. So, yeah. Yeah. And you were DevRel, which means basically you were in touch with us developers, like feeding back the wishes and all the real world problems that we have to the team.
And the other way around, you also took the new stuff and explained it. Yeah. I did. And that was really fun. Yeah, I have years and years of developer interview experience just in my mind, from designers to developers to product managers to project managers to anyone kind of working to build something on the web. I did. I kept friction logs. I kept notes like, okay, so I focused on scroll for five years. And that's because five years ago, I noticed very much so that scroll was difficult
or that scroll wasn't competing well with native apps. For example, native apps had well they had multi-threading and they had uh over scroll effects and scroll driven animations and all the stuff that we didn't have and i categorized it all i made a big old list and then went down to that list and they were like well we can't ship all those features and i was like well here's the top five most meaningful ones and that's what spawned uh things like scrolling to view uh with like additional options the scroll markers and scroll buttons as well as scroll start.
It's just the ability to like start the scroll. Anyway, it's just like all of these were born out of problems that users had. And you're right. I would walk those through and then I'd be the first developer to try the feature in Chrome and make sure it was validating and solving the problems that we set out to fix and eventually get on stage and show everybody the cool stuff that's in the web platform they asked for because they allowed us to interview. So a lot of kudos goes out to people just allowing me to interview them. And yeah, I missed that about it. It was really cool staying in touch with so many developers all the time very very meaningful stuff
yeah yeah i remember that uh once you gave this uh old snap talk at css day uh just about scrolling and and it was like you didn't just show features but you like you i wouldn't say misused you had like a lot of tricks. That you showed which were in retrospect they were like okay it makes total sense,
you have to think of this and like these these things where you have this um i know i remember you had these pseudo elements at the start and end of scroll areas which were like extra space, but they wouldn't snap so that made like a bit elastic um if you you could scroll further than like the end that that so and that was or you also had this pull to refresh thing that you showed.
Yeah uh yeah you blew blew my mind oh you were in that talk too because you blew my mind with your keyframe hacky trick to make uh carousels auto progress i think was the deal right and it could pause with css and is this the whole thing with css with buttons yeah that was a very wild demo too um but yeah over scroll effects i still use that one all the time making that elastic effect uh it was in my talk at css day and i was like hey it doesn't all have to be business because like that's a good business use case right like oh add a nice little moment of elastic delight to
a scroller oh isn't that so fancy and so in the talk at css day i was like hey those are cool they're fancy they're great but also you can make it silly and i showed one where my face uh as you scroll that overscroll effect i scroll driven animation uh my face into the thing and it's like me doing this like really dorky face saying something like yeah and so you get to the end of the scroller and as you overscroll it it's like yeah and then you go back to the beginning anyway i should have added a soundbite into it it would have been really funny but it's not all business some of this stuff but you're right scroll is littered
with fun little quirks that you can, call them hacks or call them features it's up to you um but knowing that they're there It's creativity. They were not hacks. It was just assembling things that were there in a new way and that nobody thought of before. Yeah, but this is also what makes CSS so beautiful. And listening to you now, it reminds me of Zelda Breath of the Wild, not Breath of the Wild, but Tears of the Kingdom, where they gave you the possibility to build stuff with hundreds of items.
And the community just started. And I don't believe that Nintendo could foresee that the community will come up with. And I think it was on day three where this very cheap plane was already created, which was extremely powerful, but so simple. And then people just started to create so many very interesting and creative things. I do enjoy this revision now. My only problem in my day-to-day life is that
I hear about these CSS tricks, not hacks, but tricks. But Adam, you also provided a list of CSS attributes that we could go through today. But I think I have used none of those in my real life. What about ScrollSnap? Any ScrollSnap in your regular day? Scroll snap, yes, but only with a library, I think. No, I replaced a library with it, but this was really everything.
So I did not use the rest yet. And that always makes me a bit sad, but I'm always very happy if people talk about them. Awesome. And yeah, you touch on one of my favorite things about CSS too. You ask 10 different CSS developers how to accomplish something. You get 10 different results. Yes. Each be unique and fun. And I think about it like it's the same thing why I like making design tools or I like working on tools that enable expression because that's what we're talking about. Oh, the human shows up to all these kind of otherwise useless parts. And then we put them together and we express something unique and fun.
And in Zelda, we were making hover cars or I made a hover motorcycle. Yeah, the hover bike was really cool. I was like, yeah, hover bike. I tried to make a one wheel. It didn't work out very good because it didn't balance very good. But I think there's the balancing thing you can stick on there to stay balanced. Anyway, yes, I love expressing and just like being creative and taking things that maybe they didn't see would work, which is kind of like music too. Music, you get these really blunt building blocks, you know, notes. Oh, here's notes in a scale. Here's a chord. And then you're like, what am I supposed to do with those?
And you're like, well, look at this person over here they're making them sing and you're like whoa expression human expression is so so cool and yeah css sits right in there with the some of the highest most impressive expressive capabilities that we have on our little digital screens and yeah i love it what 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. These are only creative only artsy
css attributes that you don't need in your business life but my personal problem is also to come across the new features that css might have and to know where can i use it how can i test it um so i'm just very happy that we now have the chance to talk about them and also talk about maybe real-life business cases where we might need these where we might need to implement, css that behaves like this then maybe it's
also a bit problematic if you usually in businesses have uh ux or ui design prepared and then also from a developer perspective come in and say hey i have additional ideas how we can make it behave a bit more smooth maybe we change the ui design a bit so we can also support a bit of snapping or any of these other functionalities that we have now Yeah, you're right. There is definitely a tension or a collaborative moment to happen between design and development.
And yet designers often don't know what's available on the web because they're limited by their tools. Figma is not a web design tool. It's a tool to make native app designs or any kind of design. So it's not enabling designers to reach into the coolest parts of the web platform. And yeah, I think you nail something very specific, which is great, that we need business use cases for these things. You know, they can't just be cool. Like here in our list, we have at function and at mix in. Those don't really have business use case other than, you know,
developer ergonomics and making them faster and delivering less. I mean, you could like argue that that's a business use case, but it's not as easy as something like scroll state, which I think has great business use case. Color contrast has great business use case. These things can kind of be added like, or even scroll buttons. That's one of my favorite ones. That's an overflow five. You don't have to write JavaScript or anything. You can add buttons onto the scroll area, which is CSS. And those can bring a lot of value to the scenario, but designers aren't going to ask you for CSS scroll buttons.
So you're right. As the front-end developer, you have to look at the design and try to decide how much am I going to translate directly based on what they have, or how much am I going to transform a little bit in the translation to make it adapt better to the web? And yeah, these are some of the hard parts of front-end development is you never get the complete picture from anyone, you always have to kind of go in there and finish it, right? That's when I always go add animations. I'm like, I'm going to transition this little state change right here. They didn't ask for it, but it's only one more line of code.
But yeah, those are tough things to decide. Is there business value in this thing? And I don't know. It's kind of like these what's new in CSS podcasts or just episodes can be really good for you to hear. Maybe one day I'll get asked to do something and then I heard about that feature and now i know that it's there for me and so i think about these things is at first when you're learning about these things just put them in your tool belt you know you don't have to use it yet but just know it exists and that'll help you uh for when the time when the time comes,
yeah and it's also cool if you do some kind of demos and brownback sessions for your colleagues so that they also learn about it and then maybe they deliver a design that uses it so that's really cool and and the business values. Could also one business value could be you have to ship less javascript so that's also cool so even if on the surface everything is the same as before but you ship less javascript that's already,
like i or at least for me that's an improvement and it's also more robust, because css gets evaluated constantly so you don't have to like for example if you have a i remember back in the days when you did javascript uh slider and you had maybe like on desktop there were two elements sliding at once and then on mobile you had just one because the viewport was small then you had to like like destroy and re-instantiate this the thing when when like the screen went from
i don't know if you rotated the phone from like a portrait to landscape or these things um or at least if i wanted to do it correctly so maybe some people didn't um and that was yeah not a nice developer experience to to wield these scripts. Yep that was a lot of overflow five so scroll markers and scroll buttons and scroll start or now it's called scroll initial target these things are all so that um javascript can get out of the way so that you
can deliver a scrolling experience that resizes to the viewport that has buttons that move it back and forth and have little dots all from css and they're just nice to haves and now if your user's browsing without javascript enabled they also get a carousel through the you know 50 images or or whatever it is that you're kind of carouseling them through and it's responsive they turn their phone no javascript has to execute just regular page layout and totally, hit the nail on the head with that one yep. So uh yeah maybe we should start diving
in uh so i think it's not like super grouped the list that we have like i think we have like some scroll things here some scroll things there but the first one is already like yeah absolutely brilliant the contrast color well or in this case it's color contrast the color contrast function but there's also contrast dash color function so maybe we could start with the white why is there like these two even like,
oh it got renamed so i think you're remembering the old one contrast dash color okay i thought it's still like alive and just kind of paused for now well the whole function was supposed to be paused uh contrast color for two reasons the biggest reason being that the The WCAG contrast algorithm was made in the 90s and is not as good as we'd like it to be.
Or at least the CSS working group was like, hey, there's too many times where the WCAG guideline or the WCAG function gives you a color that's actually less readable than another color. Because it's a math operation. And it was a math operation made in the 90s to perform very quickly because our computers were slower. And so there's been work to be done to make new ones, a new contrast algorithm that would be more accurate for human eyes as opposed to just luminance in math. And they're pretty much all theories or none artificial parts of the WICIG 3.0.
So, there was one about to be, and it was called APCA. It was the Advanced Perceptional Contrast Algorithm that was supposed to overtake the WICIG one, but that's a whole conversation on its own about why that didn't go through. But anyway, so contrast color now does use the WICIG 2.0 algorithm. Kind of regrettably that people in the working group didn't want to support that and so the, compromise that got made was the contrast color or the color contrast function now,
exclusively in terms of it's version one that's been shipped in two browsers now is just to return, black text or white text given a color that you pass in and the the bummer is is it'll still return you the wrong text color in certain situations. But it's only those situations when it's like right on the edge, you know, like, oh, if you go one more hue nudge on this color, it becomes white text. And if you nudge it, the hue, the other direction becomes black text.
And sometimes it'll choose black text incorrectly or something like that. But that's the current function we have. But the original function was not just to return black or white text. It was going to return you a color from your design system. You could pass it 10 colors, for example, like here's all my blues. Here's the background that this text is on. Pick the best light blue to fit on this background, given the user's contrast preferences. And that just ended up being way too complex. And so for now, we have the very simple one that just returns white or black text based on a
color using the Wicked 2.0 algorithm. But one day, we might have a very powerful one that can be very dynamic and take your contrast settings so that maybe you have low contrast preference in your users or high contrast preferences in your user settings. This function could take those into account automatically and calculate a meaningful text color for users just in time and pull something from your design system because usually a designer doesn't make white or black text these days at least.
Usually it's a very, dark blue or it's a really really light blue if your theme is blue so it's a little useless to some designers anyway that's me i just there's a really long explanation of some color contrast yeah well but i don't think it's i don't think that it is useless at all i i remember that i had a real use case years ago. And it was not so everybody who is right now listening thinking of why do I need a function for that that is calculating a color because I could also preset
colors like here are my 10 background colors and for this you use white and for those you use black text. But we had a feature where users could set their background color. And yes, we did start with a fixed set of colors for them to choose. So we can have control about their text color then. But then one week the feature was out and users were asking, we want this colors. It needs to match my brand color, my brand, not your orange, my orange.
Exactly, my brand color, my brand color. And I'm like, I cannot go to the code base in the front end and write your company name inside and say, if this company, then those colors, please. And we don't have time in the back end to implement it like this. And so here's a color picker. Just choose whatever background you would like to have. And then here's a color picker for the text color or maybe just white and black. But so you think it might be a simple task to ask for, just use a contrast color,
please. But no, not a simple task. So then we get bug reports. Hey, I cannot read the text on your website. I'm like, yes, because you chose this background color. But this is user experience. And of course, in the moment when I get this bug report, I'm like, this is not a technical error. But still, it is a user experience. And it would have been great if I could have used the function like this at this point. Also understanding, I think, there are background colors where you might never
have a good contrast, neither with middle of gray, probably. Yep those all those scenarios are there and so that i'd used to talk to facebook about that because they have facebook groups or whatever and groups can set any color that they want and they have a wild back-end pipeline of javascript functions that convert the hex color into oklch or an lch equivalent and they try to dynamically generate a palette for that facebook group based off the color and they're managing all of this infrastructure just
to deliver good accessible color palettes to a dynamic user-based color picker of their website. So yeah, it's a tough problem. And I agree color contrast comes in really handy there and it would have automated a lot of it. But yeah, it just depends on how robust you want to control all the colors. If black and white are fine for you, then you're good to go. I also shared in our notes here, my proposal for contrast color, because I was one of the original people that proposed this and this was proposed uh in css color the specs because the users are having such
a hard developers and designers have a hard time picking contrasting colors it's also you look at the wicked reviews of all the websites and they're like contrast the the color is uh the number one issue across the board so we're like what if we just give people a function boom that's easy and so then i shared my proposal there uh which allows you to pass a color and then provide some other options. You could pick which contrast algorithm you want to use. So you could pick APCA or you could pick another one that, you know, there's been four or five of them created over the past 40, 50 years. And then you could also specify black or white by using a keyword and just saying,
pick the maximum contrasting value. And then you could also let it pick a color for you. So like, let's say you were just like, Hey, pick a really light pink on top of this red. I don't want it to be white. And it would find the nearest light pink within the same hue of your red button. That passes the color contrast requirements and my function also looked at user preferences so it looked at the prefers reduced contrast value and would automatically adjust the returned result based on the user's preference so that was my proposal um and very little or none of it made it into the current shape of the
the one but i still think it's a it's the one that from all the designers that i talked to this would be the most useful but it's a little hard to do also yeah it's one of these things where you are dependent on like an external group and if they don't move then you can't move and these kind of things so yeah yeah what can you do but i think the like the current solution with just returning white and black so the uh rationale behind that is that uh even
if it's like yes it's limited but the on the other hand you it's like people don't expect things to really break a lot when when color contrast then one day gets upgraded to to do all the things that we just discussed that that we wish it could right so uh the probability that uh a white now is like off a lot uh by a lot by a big margin
of the color that a future color contrast version would return is like not high. So that's the idea i think. Yep and speaking of preferring reduced contrast you see the new ios designs with the liquid glass, you got prefers reduced transparency also that's been in your browser for a while and some some users prefer no transparency and so you got to use that media query that media query became really valuable now as uh i
think a lot of people are going to be like i can't see through the glass i would like to not have glass and just be a element i can read you know so anyway we could do that on our websites too and i think that's a fun media query that people don't think about very often and prefer reduce contrast that's that's also a new one uh right because i think it's prefers contrast and then the value i typed it wrong the value is more or less is your options this is actually also my trick um if i um
explain anybody to test also like the windows high contrast mode or something like this so if you don't have a windows machine or you don't have a browser stack that i think you can go to um your dev tools and chose the tab rendering and there's. Prefers contrast less inside and I think it also simulates a bit I'm not sure if it's exactly like this but it does somehow assimilate maybe like a high contrast mode and then everybody can test it at least everybody was very happy as I told
them about the trick so I think it's a good trick, It's a great trick. I did on my CSS day talk for all the scrollers that I made, they were light, dark, and had forced colors. So yeah, you're talking about there's two things you can change in rendering to emulate. There's the contrast preference, more or less. So someone wants a high contrast or low, but then there's also forced colors, which is like, it's like high contrast, but super high contrast because it doesn't care what your page colors are anymore. And forced colors, when that's active, your borders become really important because you can't rely on your card background
color or box shadow to even appear anymore and so yeah you get a bunch of yeah so i like forced colors too i think it looks really cool um and yeah you can emulate that in dev tools yeah yes and you don't have to be a developer you don't have to have a browser stake or so account but hey it's in your dev tools i don't think a lot of people know either there's light forest colors mode active and dark forest colors mode active um so beware everyone there's there's two um
but i mean really if you handle one you're going to handle both but it's nice to see your site in light forest active and dark forest active. Yeah and i think the the big takeaway is really what you said um like hacking things like doing fake borders with box shadows these these things like they fall back on you then yep they can come back to get you i really like transparent borders that's like one of my favorite things now it's like if i've got a a surface or if i'm
even considering the element like it has its own surface which means a text color and a background put a border on it and a transparent border that way when everything becomes forced colors active you're in the clear you and all you did was put a one pixel transparent border on something and now, you're handling that accessibility use case really well and you can still do all your box shadows and your gradient backgrounds on the cards and all the sort of different surface experiences but if you got that transparent border you're checking a good accessibility box that's a neat trick, taking notes.
So you mean you don't even have to write in CSS if mode is on, then set a border instead? That's correct. Just by default you add a border that is transparent. Maybe even something with a margin of a negative pixel to get your. Size and your area size back? Sure. Do you do that? or do you say no, it does not matter? I don't do it because you've got a box-sizing border box. And so that transparent
border, you can have it overlay the background color instead of create space. Well, that would be transparent. It would be box-sizing content box. So if you want, you can sort of dance with those. But I haven't found that the one-pixel border is actually as disruptive as it seems. But it's a good question. Yeah, it could throw off alignment. It could throw off sizing. You know, there's all sorts of things. But yeah. Then you also listed prefers-reduced data, which is like a rather old,
in quotes, old media query. I think it's around for maybe 10 years already. But I think the uptake on the other browsers is not there, right? Yeah, it's about six years old. it was proposed by um chi uh hang chen chen hui because they were looking at hey the browser has save data modes hey the operating system has like a save data thing where it's trying hey well can the kind of website uh from css
tap in it looks like javascript hey javascript has access to the users in a reduced data state how do we get that into css and so it became it hit the spec very very quickly everyone was like oh yeah totally that's a great media query but at the same time there was a lot of privacy concerns around these media queries because they expose a user's setting and when you expose a user's setting like reduced data attackers can use this as a vector and they can be like oh reduced data you must be poor you must be coming from somewhere with no money and so then they
can use that or whatever to try to attack or section you into some type of user and then sell your data so this this particular media query which i also helped work on and tried to unblock it because i i made so many. Demos of it all i also put the chrome for it in chromium so if you open canary and turn on web experiments and try the prefers reduced data thing that's my code running in chromium which is kind of cool um but this this comes up in talks this was in like three css day talks but hey make sure to remember prefers reduced data
i'm sitting in my chair going this thing's like six years old no one's using it it's not shipped in any browser yet it's constantly on screen people want to be considerate of user data but there's no browser that shipped it and it's blocked in the css working group because it's a new attack vector so it might not ever ship but javascript can do it you know like all of my images on the server know if the user's in a save data mode and i can ship a different image because uh that uh header travels with that user when they make requests. So I'm like, the attack vector is already there. CSS is not exposing anything new.
And it's a really difficult battle. But I think that's a meaningful media query that we just kind of need to ask for more or something. I don't know. I'm not sure how to unblock it at this point. But I put it there because, yeah, it means something to me. And I'd like to see you go somewhere. I thought it had already shipped in chrome so that was just my remembering but that was apparently wrong so i thought because you already have like these client hint headers and also the javascript thing that it was also in css already but apparently
it wasn't it got locked yeah that also be like nice to use as a feature query for example in a responsive image thing maybe, or video also yeah i have a demo of like a site kind of like netflix and if you're in reduced data you don't get any thumbnail images you just get titles and it's kind of better it's almost like the images are really showy and they make for like it feels like a good browsing experience But in the end,
they're kind of noise, like the cover of the movie isn't actually that important. It's more about like, what's the genre? When did it come out? Who are the actors? And so it's kind of interesting. You can ship a reduced data experience that does. It saves 90% of the page load because, well, most of the page is images. If you don't ship any of the images and CSS is hiding them because the user's in this state and you have lazy loaded, the lazy attribute on all the images, they never download at all. And so the user gets this like super fast loading web page and they can start interacting with it right away even
though they're on low data i mean yeah there's a lot of examples that show this can be really cool but uh i don't know maybe we just got to do it from javascript you know just let javascript do it it's okay no no maybe yeah i don't know uh so i i once had a like a real use case so i traveled to the us and i had a phone that was 4g enabled that's a few years already back and the problem was that the frequencies in europe are not the same ones that i use in the us so my
phone only supported the european 4g so it tried to fall back to 3g but in florida they already turned 3g off because nobody used it anymore so it then fell back to 2g and it was super slow and that was a situation where i. I i would have wished for more websites offering uh data saving modes yeah yeah
so it was accessibility where um you know like oh accessibility doesn't matter until your arms are broken and you have to use a website with like your nose or something or just like a different input device and you're like hey this site should be built easier for me to hit my keyboard tab key and you're like yeah it should and it also shouldn't take you breaking your arms dork to realize uh that there's people out there that might want to use a site with their not a mouse you know i'm sorry i'm not you're not a dork uh shatman's just making that clear, but yeah you felt you felt the pain yeah not
far from it um yeah also so uh what i also so after this experience i worked as a at a news um publisher uh and we so one of my tasks was also to integrate ads of course um and but but what i did was uh i checked so if there was the uh the connection type uh info on the uh so if there was a like if it was a chrome device and that
would that tells me the connection type and it was too slow then i would just bail out loading the ads So that was one takeaway that I implemented in code later on. Nice. Yeah. So these little tools letting us as developers express a meaningful user experience, that's kind of what we're going for. Yeah, because otherwise the whole page, like the ads as well as the content would both be unusable.
So then throw out one of the two and be able to use the other one. That was the idea. Well, there's a lot more in this list. How about I fast share a couple of them? Yeah. So control value is the next. I have never heard of that one. Yeah. So, you know, talking about what's new in CSS, some of the stuff down below isn't super new, but this one is really new. And this is, if you ever wanted the value of an input in CSS, so that you like a slider, hey, I want to know what the current slider value
is so I can fill the GU track up to look like it's that full. And so we have to use JavaScript. If we say JavaScript on input, set a custom property that says the values. Anyway, so this would just do the whole thing from CSS. You get control value. So as the selector inside of there, you can ask for the value of the input that you have selected and use that input in a calc or whatever. And I think that is really cool. Yeah, super useful. Super useful. Then there's transition behavior here,
which is a weird sounding one, but comes in really handy when you so a discrete property in css if you animate from like display block to display none for example that's a discrete property there's no in-betweens none and block i mean there's opacity but that's different so anyway the browser immediately flips these things if you put them in a css transition or in keyframes as soon as it sees that it's headed towards display none or as soon as it sees it's currently none and about to be blocked it does it right away. And transition behavior allows you to delay this and integrate that moment of
flipping into something that matches more with your other transitions. So you could transition opacity out and then flick to display none, for example. And so transition behavior is like a weird word and the value is called allow discrete. And you have to say which property, if you want, you can say which property to be transition behavior on. But anyway, it ends up being a pretty cool feature that allows you to control these discrete moments that are great for displaying a dialogue, for example, or the custom select element that pops up with its little pop over.
Those things you need to, if you want to animate those, you need to time the display none and display block that the browser's flipping on those for you. You need to time those with your transitions. And so transition behavior allows you to sneak that timing right in line with your other animations and it's adds for a nice smooth user experience. Yeah very cool a little bit like uh visibility hidden and visible i think that's that was so far the only thing that would only be flipped at the like visibility hidden would only be flipped at the very end
and the other way around i think interesting i think yeah that was the only thing that worked like that so yeah super cool super cool and that transition behavior comes in handy with animating to summary details the dialogue elements popovers and select elements so yeah kind of a cool one to know and then there's calc size and interpolate size if you've ever wanted to animate height this is your this is how you do it now you set interpolate size on the element and you
say allow keywords and this tells the element that things like min height or auto So these keywords can be used in an animation to go from zero to something intrinsic inside of that calc size function. So then calc size can say, calc size is like calc, except the size portion of the function specifically calls out to the browser to measure and use the measured size. And there's keywords that you can put inside of calc size also that allow you
to derive the perfect height animation value that you want to go to. Then you can go from height zero to height something and again this comes into play with like a summary details accordion when it opens it needs to transition to an intrinsic height to show all the paragraphs or the contents inside of there and you can now animate that with a combination of calc size and interpolate size which is pretty cool yes this is an example i think in my bubble everybody has waited for and I'm happy that the calc size function is part of this year's state of
CSS survey so people might get aware that there is this new cool thing, Mm-hmm. I share a little link here, too, to a, I call it a nice accordion. It kind of takes all these little modern features and tries to layer them on so that you get a summary details that looks modern. It doesn't look like it was from the 90s. Just because I see so many bad summary details elements, and I'm like, let's make a cute one. It's got cool little micro interactions in there. So check that out in the show notes, y'all.
Yes. There's also probably all the, like the new sudo element inside the what is a details content thing details content yeah so colon colon details content accessing the slot that uh your content is inserted into yeah yep really nice and also i i guess progressive or graceful degraded degrading on on non-supporting browsers right yeah if they can't select it they can't select it they're going to get just an accordion that opens and closes like regular yeah no big deal yeah like
that just flips open and close and it's not animated and yeah how like the way we we had it for years if we didn't use javascript right same as it's always been or it's better yeah at least lighter so the next one is It's scroll state. So state. Yes, this one I find has a lot of business value for upgrades.
So at CSSD, I talked about building the Nintendo Switch home screen. And scroll state is what allowed me to know which element was snapped and put the little highlighting flashing blue box around it. And to show the title of the game you have selected, I could use scroll state because scroll state exposes which element is snapped just from CSS. And it does it in the same way that container queries works. So on your scroll container, you say container type is scroll state. And then you have a child that is a snapped element inside that scroller.
And children of that snapped element can ask the snapped element, just like a container query. I don't want to know your width snapped element, but I want to know if you're snapped or not. And you can use that just in CSS to show and hide a title of the selected item or animate in a focused selected state and all sorts of things. And scroll state has two other features on top of snapped. It also has overflowing or is it called overflow? I think it's overflowing. and so you literally know if the scrollable
area is actually scrolling right now so like this was impossible to know before you know like sometimes you have a box and you put one paragraph in it there's no scroll bar you put five paragraphs in it there's a scroll bar how do you know from css if there's a scroll bar or not you didn't know and now with scroll state queries you can know you can ask the container can you scroll which direction can you scroll and it will say i have scrollable runway down. And then if you reach the bottom, that is no longer true, but it does have scrollable up.
And so you can show and hide little buttons that help people scroll. You can show and hide the scroll to top button really easy because you're like, hey, can they scroll upwards at all? If the answer is no, don't show the button. But as soon as you scroll down and as soon as you can scroll up at all, show that little helpful button to scroll to the top. So you're like giving CSS all sorts of cool little features. Oh, and then there's, so there's scrollable, snapped and stuck. So you now know if something is stuck in a scroller from CSS by using a container query.
For a position sticky for example yeah so if you have a position sticky child in that scroller that just became this sticky header you know the classic example is put a shadow on it as soon as it sticks like okay now you can do that with CSS and there used to be a little annoying chunk of JavaScript you had to deploy yeah very very useful. But it's not like stuck like a bug stuck because the first, maybe it's a German thing for me when I hear the word stuck, it's like, oh, I'm stuck.
I cannot move anymore. But it's position sticky or is there another possibility that anything can be stuck? Um i think it's just position sticky um okay but yeah sticky yeah sticky is funny too even in the states we're like oh sticky situation i'm stuck yeah uh it's like we know as the css developer like oh no that's a good thing to be stuck if you're a sticky element like you know it's okay we wanted that pretty funny um any
more questions on scroll state that one's pretty sweet i wrote an article too for chrome on that one i should pull that up scroll state yeah maybe one question and that is what is the do you know the view of the other browser vendors on that thing because on scroll state queries yeah are they like positive or are they just do they have no opinion so oh they definitely are positive and helped it all all happen so a lot. Of these this is like a common question about some of the scroll stuff like scroll
buttons and scroll markers people are like that seems uh like chrome shipped it really fast and are you know did other browsers even know this was happening and the answer is totally like these things like scroll state queries took multiple years tons of conversations there's uh you know these get before they can even become a a draft you have to pitch it to the working group and the working group has to accept it as a as a group so all of these things went through group approval and all of the refactors this
it wasn't originally called scroll state um and that is scroll they're called scroll state because we're anticipating other type of container queries that are like a style query it's kind of a style state query you might get input. State queries at some point so they're kind of prepping and going through revisions to make sure that the future is covered on how this can extend more and more but uh as far as i know other browsers would love to implement this as soon as they can but same thing with like style queries although i think firefox doesn't like style queries that's one where i've
heard firefox say we don't want to implement that even though there's a whole bunch of developers out there like tailwind the creator of tailwind wants style queries really bad um but firefox is the last holdout i don't know uh what their deal is there but yeah scroll state is all good same with scroll buttons and scroll markers these things went through years of uh revisions and they'll still go through changes and it'll be better every time it gets talked about. And then we can follow up with scroll markers and buttons right away. Yeah. Awesome.
I'm trying to see if I have a link to any of the working group discussions on scroll state. Uh here's the explainer anyway you can go find uh past conversations and see the the interest of the other browsers but as far as i know these ones aren't contentious like people want to know if something's stuck or snapped and this is a way to do it using the container query methodology, yeah i think there's there's a lot of these states that that people would love to to know about like For example, if you have text clamp,
and for example, if you want to know if text is clamped or not, because if it's short enough to not get clamps, then everything is fine. But if it's being clamped, I would like to maybe put in an expand text button, for example, or like a dot, dot, dot thing. So for these use cases, such a state query would be helpful.
Also, sometimes text will be clamped on mobile, but not on desktop. Also, these kind of things. So, yeah. Yep you need that dynamic ability to it's like it's a simple question from us as developers like hey is it snapped um and you don't even have to care if the scroller is even a snapping container at that time um but when it is because maybe it's now on a mobile layout which has gone into a constricted view which caused it to go into a horizontal scroller now you do have snap items and you do want to know which one is snapped and
yeah that was a lot of javascript you had to dance around and manage state that now the browser does it for you. It's pretty sweet. Speaking of snapping uh there's two new uh dom events uh related to snaps snapping right yeah and these took a lot of years to get in there also but they were really important so you know you listen to developers building things with scroll and they want to know uh when something snaps uh
and then sometimes they want to know um that it's maybe going to snap there but hasn't snapped yet. And so that's what these two events help you isolate is snap change means that the scroller has rested on a new snap element and it actually changed. So let's say you scroll with your finger, but then you scroll it back and you let go. Snap didn't change. So the event wouldn't fire. Scrolling did occur and scrolling ended, but snap didn't change. And then snap changing is if you pan with your finger and enough that the next
item would snap if you let go, the snap changing event fires to tell you eagerly and as soon as possible that there's a new snap element that's going to be snapped if the user lets go of their gesture and so you can highlight the dot underneath it for example but then if they pan back the other way then it could snap changing says oh i'm going to snap to this one and then you can change the bottom dot so you can kind of provide this feedback to the user while they're scrolling and then when they let go you can confirm the gesture and these two events uh integrate really well with snap to help you create an even better scroll snap experience.
And you briefly mentioned scroll end as as an event which is also a new event i would say, yeah so you get notified if if a scroll that happened is finished is finished and that one is extra tricky so that one also helped spec um and uh i was really happy to see that one get really quickly adopted because i always thought it was crazy that there was no scroll end event you know uh why isn't there one and so all the all the javascript we had to write was hey infinitely
do a set timeout uh but if the set timeout goes longer than 100 milliseconds and there's still no scroll has changed then they probably stopped scrolling and that was like as good as we had but that that didn't work if the user was panning with their thumb and they, scrolled a little bit and then just stood still for 100 milliseconds scroll and would fire and steal the scroll from the user who wasn't done with the gesture. And it turns out even in JavaScript, it's really hard to know if the user has a finger on the screen or not during a scroll gesture.
So this was like really difficult stuff for even JavaScript to solve. And so we got that into the platform that literally waits for all of the gestures to end. And when the scroll maybe smoothly goes to a new place, as soon as it rests, and as soon as it's done, you know, the frame scroll has ended. So instead of you being delayed 100 milliseconds and maybe getting the scroll end event, you literally get the scroll end event at the exact perfect time, which is really important. So yeah, there's scroll end also.
There's this next one here, which is scroll into view, and you can pass the container, which is a weird way of saying you can scroll into view and not have it bubble up to all the other containers. I think that was something that I wished for, that I didn't notice that it's in the web platform. Yeah, I bet you did wish for that one. It's super annoying. it's like a and they did it for accessibility reasons but i don't really think they thought it through as good as they could have but yeah so eventually
and it's specced and i think it's prototyped in chromium right now that you can scroll an item to interview and specify the container that you want it to be trapped within and that way we can literally we can finally like i don't use scroll interview ever because of the way that it makes the page scroll also it's like it's a very leaky um you know it has a lot of side effects yeah i think the problem is that scroll interview works itself from the like the top most to the like deepest
like the way down into the dom and it tries to scroll like the uh like as many parents as possible before then starting to scroll the thing that you really wanted to scroll yeah that that sucks and and this like the option that you mentioned that will probably reverse that or something like that, it'll probably just say where it starts so it sounds like if it works top to bottom this would be like hey start at the container uh and maybe only affect
this container maybe it won't even crawl into child scrollers you know it'll just be isolated to the one scroll view that you pass in. Cool. I also recently learned that, so I was always wondering why does, I think, Firefox support scroll into view if needed, and why do the other browsers not implement it? I think Chrome has it, right? Yeah, they do have it, and they just implemented it as an option for scroll into view.
So, didn't know about that. And if needed that one's funny too because it has the same issue with the container where it continues scrolling all the containers so i was like oh it sounds neat you know scroll it into view only only if you need to which also kind of feels like how the original one should have just always operated but you can't change history so you gotta just layer in new functions and new parameters to sort of handle these uh more modern cases that's just the way it is yep it's just the way it is yep it's okay i mean we like it too
i mean it's kind of nice that it doesn't break old stuff right it's pretty sweet yeah yeah i think that's that's also like it's sometimes it sucks but i think it's also the biggest uh plus side for the web platform so, it's just amazing that you can build things and they will work forever, yeah i love it and you don't need to upgrade or touch them anymore not the case with anything else like be it javascript or php everything breaks.
Yeah but css it's typed and resilient what an amazing language. Uh here i need to air out some dirty laundry a lot of people think the css carousel features are carousel features uh they are not they are additions to scrollers so that's why i have it here is overflow five introduced scroll markers and scroll buttons it does not this is not css carousels carousels are something you can do with these but it's not exclusively
all that you can do with them and the idea of these two additions is to make it easier for developers to not screw it up like you need buttons not links to scroll your scroller, And so to make that easier so that there are always buttons, we have a CSS pseudo selector that will create a button for you and make it so that you can attach it to a scroller. And it'll also handle the amount that scrolls and all that sort of stuff. And then scroll markers are like, hey, you have all these snap points, but they're invisible to users. They don't know what they can snap to or not.
But if you show the little dots at the bottom for each of the snap items, you're now increasing the visibility and telling a user that this is a snapping area because they can see the dots or they can see the thumbnails. They can click the thumbnails and jump to an item, right? So the browser handles all this stuff. And these are just, I like to think of them as affordances on a regular scroll area. So you've got a regular scroll area that has a little bar at the bottom that you can grab and get the thumb, go back and forth, or you can add some
buttons to the scroll area now they can click the buttons and that nudges the scroller back and forth and or you can add these scroll markers and again just these are affordances we didn't interrupt the way that the thing scrolled at all it's still just overflow auto but we've added these nice things for users to have additional interaction points that also provide feedback and information to the user about the state of the scroller and what's even available for them inside of it so that's my that's my little soapbox here is that they're not css carousel features they're just overflow five new affordances that
you can put onto a scroller with css so progressive enhancement super easy to do and uh yeah there wasn't there like a carousel api also or is that something like is it something else or is it just so did it start off as carousel api and now it's it's it's scroll markers and buttons it there's never been a carousel api it's just a i think a well at least for the chrome team it was framed as carousel uh centric because
that was one of the main pain points that we were targeting with it like we're looking at all these e-commerce stores um pinterest or whatever they all have a carousel of images in them or a carousel of products. And in every design system that we spoke with, the carousel ended up being way harder than they thought it was going to be. Just like one of the things you said in the beginning, kind of like a responsive one, right? Hey, on a big screen, I want to scroll by three items at a time. But on a mobile, I want to scroll by one at a time. That alone is a lot of work for someone to write in JavaScript,
let alone all the buttons, the statefulness of the dots and the thumbnails. Just the whole thing became, it was a lot, it was always more complicated than people thought, which meant that they were not doing a lot of things. Like a lot of carousels don't have mobile touch support. You can't swipe them because they're not scrollers. They don't think of them as scrollers. So the engineer that built it to save themselves on trouble, they transform, slide everything around, which meant a touch user can't just swipe it. Or if they do swipe it, they get the, oh, they get the worst version,
which is like, I call it an uncanny swipe where, I mean, back in the day with jQuery, you would swipe on an image and then after your swipe was done, then the image moved over. You know, it wasn't even attached to your finger. And then these days, you might have someone that does something a little bit like that, where like it follows your finger with JavaScript, you know, translating X. And then when you let go, it animates to the new position. And to you as a user, you're like, that's not the same as scroll snap. This didn't feel like my operating system. This felt like somebody animated the thing to the new position. And so you get this like uncanny experience. Like I'm not interacting with a scroller.
I can feel it. um so anyway it's like all these and you had all these accessibility issues people so not only just like no touch support but there's all sorts of littered with issues and so these things kind of got rid of all that where you could just put markers or put buttons on there they would be as accessible as the browser could do and they're going to get more accessible over time and you could liberate your carousel component from having piles of javascript there was a google one that had seven scripts that loaded just to manage the carousel.
And we got to delete all of the scripts and just put in a chunk of CSS. And so their page load performance went up. Their scroll experience was better for mobile. Users with JavaScript disabled got a carousel. Screen reader users were really happy because the things actually said what they were and said that they were in a list of this many items. And it was just much more descriptive about what was going on. so it's just like all these wins across the board and to me these again are still just scroll enhancements it's not a carousel it's just ways to make a scroller
better for everybody yeah yeah i think for like for a carousel there's still things that are not solved yet like for example like the endless scroll. Possibility yeah so that's a really hard thing to to crack i don't know if that ever ever happens, um but yeah it's on it's on the task list so is infinite so you have uh you have lazy scrolling or like um what is the difference hold on do you have infinite scroll and you have cyclical scroll okay so what you described was cyclical
scroll which is as i get to the last item as i keep scrolling it goes back to the beginning automatically browser engineers have an idea of how to do cyclical scroll. Infinite scroll though, we currently have contain intrinsic size and content visibility auto. And these will delay rendering of the items until they approach the viewport and then paint them. So you can save on rendering, but it's not the same thing as an infinite list where users expect to load more data by the time they reach a bottom. You know, oh, I scrolled to the bottom. Now I need to get a hundred more.
Oh, I'm going to get a hundred more. And that's different than the virtualized scrolling that you can get with contained intrinsic size. Anyway, these are all things that were on my list of paint points and things that we needed to make better. And cyclical scrolling is probably going to get done before infinite. But we do need an infinite list view on the web. We need something that is competitive with a UI table view that they have on native. And, you know, React, the whole reason React got invented like 12 years ago or whatever was for an infinite list. So if we can get rid of that need, we could get rid of a lot of the requirements
that folks are reaching for these tools just to do that one little thing. Yes, I agree. I remember there was, wasn't there also one, some kind of web component or like a built-in web component thing that was supposed to implement an infinite list in Chrome? Oh, there was a Lappy at one point. Yeah, the layered API. They had a couple of them. They had Toast. And was it an infinite list one? yeah it was it was i think it was a similar thing to to toast
so it was also that at that same time i think that uh chrome the chrome engineers yeah that was the layered apis at chrome dev summit lapi's lappies and they got pushed back hard from the community and uh crushed a lot of those developers a lot of developers quit after that they were like geez uh all we wanted to do is help you and you all got so mad at us and they were like fine bye and they left well i i can totally imagine yeah happens yeah
i wanted to see the i wanted to see the scroll marker in action and i went to the mdn web docs and maybe i asked you to also go to this page and try it out the And one thing I'm confused with is there is this example with the red buttons below the item list, which you can click. And when I click it, it also scrolls down the page. And I think it scrolls down too much because there is this sticky stuck header
on top, which is an overlying. Is it on purpose that it also scrolls down instead of only left and right? We were talking about earlier where scroll into view is toggling too many scrollers. I wonder if they've written JavaScript and that those aren't CSS markers. Let me see. Here it's a scroll marker but maybe they have javascript clicking on it yeah it shouldn't scroll the page like that that's not good if you want to see good examples here i just sent a link on our thing there it's chrome.dev slash carousel and
i built about 20 so you're talking about business use cases um i use overflow 5 so scroll buttons and scroll markers and scroll driven animations and a few of these things and i layer them in to all of these um business use cases where you have either a media player you have weather widgets you have testimonials you have a product slider with product images you have an app switcher you have a tv series where you're scrolling through tv series like your series one series two the seasons uh hubs pages a gallery a wizard
which is like a form-based wizard which uses the scroll uh overflow five features and then you have like a the vertical wheel which to me looks like a retro video game system um and so yeah my goal of this was to take these primitives like we're talking about earlier like hey what am i supposed to do with buttons and markers and it's like well it's css yo you could do whatever you want so here it is like a whole bunch of meaningful use cases using these features um and for things way more than carousels although you could.
Argue they're all carousels but maybe they're not i don't know you decide no they feel better i i why you were joking i played around with the horizontal cards all of the time because they have this nice effect of showing additional information when they are in focus yeah scroll state query that's when it snapped when it snapped you present the caption it's also so smooth, Yeah, no JavaScript in there. Pretty amazing, huh? So yeah, that's scroll state. One more use case for the scroll markers is also
this thing where you have like a table of contents and when you scroll on the page and if it's like a position fixed, for example, and you scroll in the page, then you could, for example, highlight the section, like the link that points to the section that you're currently in, right? Yeah, that's the vertical scrollsby. And that's because a marker, a marker is not a dot for a carousel. A scroll marker is a way for you to select an element in a scroll area.
And I call it making a point of interest and surfacing that point of interest into the scroll marker list. And so, yeah, you've got an article, you wrote an article, all your headers. Those are you usually can scroll to them, right? You put a little hashtag tag there. You can also make them a scroll marker. So your table of contents is now generated from CSS based on the selectors and content that you specify. So you could highlight all the headers and be like, hey, add those to my scroll marker list.
And now the browser manages highlighting them, clicking them and scrolling them down to that header, everything. You don't have to do any of it. And it's because you said these are points of interest. I want to surface and make them easier for my users to find into this one little group called a marker group. It's pretty cool. If you go to the TV series demo too, in the horizontal TV series, the season one and season two are generated markers off of a group of content. So you don't have to make a point of interest. A marker doesn't have to be one item.
It can represent a group. And so in this case, season one and season two are generated dynamically based off the content. It's kind of cool. You know, really cool stuff to play with and to like refactor the code. Uh then you you list scroll bar color yeah uh that was because why did you do that at my talk at css day i one of the opening things was i was like here's here's the problem is most people just do overflow auto and they're done to them it scrolls it's it's done
i'm all done and i'm like no you're not done you just did one and i also talked about how overflow auto is a really wildly powerful CSS property value pair. Because think about all this stuff. You get a stateful bar that gets added to your scroll area with a stateful thumb that then you can grab back and forth. The size of the thumb grows and shrinks based on how much the scroll area is, blah, blah, blah. I basically am like, overflow auto is very similar to a video tag where you get all these controls for free. They just pop up. The browser just generates controls.
And it's like, I don't think... So it's like step one, audience, was I don't think you've thought very hard about how much magic you get for overflow auto and then i'm like but you can also do better so let's make this really great feature because it has all these features when you do overflow auto just so many features like your keyboard you know your up and down arrows work the page up down buttons work you can hit the home button scroll to the bottom you can hit the whatever there's like or page end there's all these different ways to interact with a scroller and so then scroll bar color is i'm like here's the first thing that you need to do to avoid looking like and then i show a
bunch of websites that have a scroll area and they don't have scroll bar color on their site. And I'm browsing as a user with scroll bars set to inline, not overlay. Most developers are on a Mac. And on Mac, the default is overlay scroll bars, which means you don't see hideous scroll bars very often. If you are on a Windows machine, I think that's a big problem. See, thank you, dude. That was my thing. I was like, here's a big problem. I guarantee 90% of the people in this crowd, even though you're all CSS professionals, don't have this property on your site.
And it's making your site look bad. If you have a scroll area, this is hideous. And so I walk them through bad cases and how one CSS property, which is scrollbar color, can make it look integrated and beautiful and nice on your site. And then I go even further into it. I'm like, here, we can add hover effects if the user can hover. So that way it's kind of faint until you hover in the scroll area. Now the scrollbar highlights and becomes higher contrast, letting the user know that the scrollbar is represented in the scroll area. If the keyboard focuses inside of there, highlight the scrollbar thumb a blue color.
Make it look like if they use their arrow keys, it's going to control the scroller because that's what happens when you focus into a scroller. We just, most people don't build in these visual affordances to hint to a user about the behavior and functionality. Users tend to just explore. They're like, oh, I'll smash my keyboard keys and see if it scrolls the area. So yeah, we do scroll bar color. We talk about scroll bar. And then I go build really beautiful scroll examples where I'm like, here's all the layers. And then I did it with cascade layers too it's kind of fun so it's like you unveil a cascade layer and it adds a new feature to the scroller
and so the talk was me unveiling cascade layers adding features to scrollers that worked across all the browsers um and the whole goal was making smooth beautiful scroll experiences and so i put scroll bar color on here because yeah i wanted to talk about inline scroll bars and how i actually think they're better and how to style them so they don't make your site look hideous um yeah yeah we will link to your slides but i think it's not the real deal so we have to watch your talk and it's not yet published they might not be either it now
i think it won't be published until this will be published but we'll so once it is we'll just edit this episodes show notes and put it in so yeah or have an eye out for like the css day videos yep they might not get released this year so i might end up doing my talk oh okay just for free on youtube or something like that and just post it we'll see. Ah, okay. I get it. Yeah, I just wanted to add, so, like, I think every Mac user should plug in, like, a mouse or pointing device
into the laptop, and then I think, like, scroll bars appear, right? Nice so it's uh just when you're like just working with your touch uh pad that you don't that you get yeah these overlaid scroll bars that appear and disappear depending on where your mouse is where your pointer yep i had a slide in there that shows the before and after so that you could see like um what the scroll bars look like if you haven't written this style and then you slide
over on the image comparison widget or whatever and then you see that they're all nice and you'll find that in the slides everybody it's like slide four okay is a scroll bar the scroll bar also attached to accent color or it's not um and part of my advice too was um generally don't change much about the root scroller so the you know the main document scroller but your nested scrollers you can um customize those a little bit more but still the root scroller, you at least need to say scroll bar color.
And you could just say canvas text space transparent. You need to make that track transparent. And then you need the thumb color to be some sort of dynamic adaptive color from your system. So you could use a system color like canvas text, or you could use, you know, var my text color one or whatever. And that way it matches your site and has a transparent track. And that'll really modernize the way that your inline scroll bars looked on your website so it's like a huge tip right there okay well
looking forward to your uh to your talk uh just ping us when you have something uh online and then we'll link it in the show notes we'll do and watch it i did blog about it uh the nintendo switch home screen recreation so that's in the show notes here it's nerdy.dev slash nintendo switch home screen css recreation and i walk you through the whole process of taking a regular overflow uh hidden or overflow auto scroller of video games and then layering in piece by piece really meaningful additions that help it look elegant integrated and feel good for users.
All right, cool. So then you have sibling index and sibling count. Those are also, I think, very eagerly awaited by the programmers, I guess. Yeah, this solves just the classic problem of, I want to know if this is the third item so that I can stagger its animation or I can change its background color to be this shade of a hue. And it all comes down to just getting the right words for the name of the function and it turns out we're going to use sibling
index and sibling count so you you can know how many siblings you have like i'm one of 12 and then you can be like what's my position you're like oh but i'm position three of 12 and you can use that information to do whatever you want and there's all sorts of cool demos and examples and it'll get it'll get this work out of our template syntax which is usually where people put it is they'll you know whether it's in jsx or if they're in php or wherever their template syntax is and they have an each for each and they'll put the index on the element,
but that also doesn't work if you shuffle it and stuff like that so anyway this will be a really cool function i mean you're just talking about new what's new in css and cool stuff sibling count is in chrome canary i think it's set to ship soon and there's very positive signals across support from developers to implementers that that's just a cool sibling index. Yeah i think it's also one one of the missing puzzle pieces to like really replace uh scss and these kinds of things like for example if you
have 10 elements and you want them like to be animated into the screen but you want like the delay to uh to increase with every element so that you have them animating one after the other uh that's something you that you could do with sibling count instead of doing a for each and then nth child selector thing in scss for example yeah as are the next functions or next features some big game changers here we got at
function and at mixin and uh a mixin could use a function but a function function can't use a mixin and then we have if statements here and so this is just uh really digging more into some of those SaaS features, digging more into the fact that this is a robust language that's looking to really. Expand itself into being more dry. So repeating yourself even less, creating healthy utilities. So I like to think of at function as returning a value. So if you've got like a property value, like overflow colon auto property colon
value, at function fits on the right hand side of the colon. It can't go anywhere else. Whereas at mixin can replace all sorts of property value combinations. And so, and it works just like at apply. So at mixin defines it, it can take some parameters and at apply applies it and at function can take parameters and return a value. And these two things are going to be wild. And their functions and mixins are prototyped in Chrome Canary. You can go try them right now. And those specs are in early phases and you can
have your voice heard and help impact them. And anyway, these are just really cool to hear if mixing and functions coming to CSS is pretty sweet. Yep, absolutely. I think so. What I use function a lot for is to translate pixel values into RAM values. I think that should then also be possible with add function, right? Because I just don't want to calculate, and I also don't want to mess with the root font size.
So yeah, that's super cool. and mix-in is like fantastic to to organize code and also maybe to minimize the the size of your css if you have like repeating patterns everywhere then you can just import these mix-in blocks, totally cool and if else of course is also fantastic yeah i'll kind of get rid of our hacks that we're doing right now you know clamp or what do we do right now we take calc and we multiply it by a really high number,
and then we see if it's over a threshold or under a few dirty tricks. Yeah. We can also link a very short video from Juna where she shows off if and also something else that I've forgotten, but that was nice. Yep, awesome. Took a note. Yeah, I think we're almost through we talked about css day a lot already yeah you
also did like a few other things like mixed and i i apparently like a few view transition the whole the whole talk all the slides are view transitions gsap split text and starting style and wow uh and my view transitions are 3d view transitions which i don't think a lot of people have seen, and so uh the browser just so you rebuilt uh reveal jess i did yeah it's or even um keynote you know because it's all auto animate i don't i don't like all
those animations that you see as you go through there i don't tell those what to do all i did is i have like a little framework that automatically gives view transition names to children and tries to find and create unique ones and then the browser just finds the pages and says oh here's the title from this page and the title for the next page i'll just morph them and i'm like cool during that morph i want you to do a 3d flip and it's like all right so the browser uh and i just had a blast making those slides they're very modern feeling very um animated and interactive and it's all just web pages they're each web
pages i build in astro it's pretty cool wow so it's not just what's inside the slides it's also the slides themselves that are worth having a look at. Cool and then the final two things that we with here is a custom select which a few people might already know uh it's it's basically just the the beginning of a lot of like more form
input elements that are going to end up being styled one day yep yep you got it and it's just like in terms of new css it's just really fun still to to know that a select can be customized um and you know there's not a whole lot of exploration that's been done here yet so if you're a hand crafting ui developer you can go make some really cool stuff with these i gotta check out brecht he's done a lot of really fun things with custom selects i've done mostly custom selects that are very business oriented they're not as fun um or whimsical um
but yeah i gotta gotta go check those things out in terms of new CSS, it's just really cool that we're finally going to be able to customize input elements, a lot. That'd be great. Yeah. I think the elephant in the room there is still the multi-select. Yep. But it's like, this is such a train wreck on every platform, in every incarnation that I've seen.
And so it's, yeah, I don't, I'm not surprised that people focus on the non-multi version. Yep, I agree. It's got a lot of warts and a lot of old features they're going to have to patch to get that worked up. But I'm looking forward to it. And it's fun to see Apple right now really looking into these customized inputs and putting a lot of effort and thought process into how to empower us to make these beautiful. Yep, it's nice.
And the last thing we have here is CSS 4 and 5. So we did talk about it in, I don't know when, with Quentin. Oh, nice. Yeah. Probably a year ago, I would guess. It was November 2024. 640, I think. Yes, 640. Not that long ago. Nice. Yeah so yeah we have a new logo that uh you designed or co-designed but uh i
think you you really did most of the work i yeah and it's really nice thank you i was really happy to see that logo has done so good um. And it was very much a community effort, but I was there shepherding it and, you know, kind of helping create submissions, create a platform for people to collaborate in, creating some guidelines and rules to help us make sure we create something that's accessible and desirable all at the same time. And yeah, it took a while and I really like what we landed at,
but I put a CSS4.5 on here just because it was fun at the beginning. It was like, oh, it was last time we talked, it was pretty much CSS4. Now we're in CSS5. Hey, CSS6, we even talked about some CSS6 items today. And I think those are still really nice. So that group is still together. But since I've left Google, my activity has dropped, but I intend to get back into it. And we have pretty much everything labeled right now. So every CSS property that's ever come out is in a bucket of CSS4, 5, or 6 with a reason.
And we even have this website you can go to to kind of explore and look at features and be like, well, hey, what's in CSS5? because we feel like that's one of the most valuable things that people are going to do. It's just like, I'm feeling behind on CSS, what's new? And then they can be like, oh, snap, there's CSS four. I didn't even, I mean, I remember CSS three, what's in four? And they're like, what four, there's a five. And so each of these little moments can create meaningful learning opportunities for people who just kind of want to see the breadth of what's come out. And they don't want to look at a huge list.
And they want to see things that sort of like have rolled out together or things that rolled out um as part of an era and so that's uh i just wanted to bring that back up that it's still there uh we still intend on finishing it and i still think it's got some high value impact but just in case anyone was curious they're like adam what's happening with css 4 5 and 6 or whatever and like it's still there the community group is still talking about it um and we're just kind of in like you know how like the 80 20 rule where 80 of it was easy to do and 20 of it is hard. We're definitely in that 20 finishing style uh
phase and we'll get we'll get there so just wanted to let everyone know yeah but people already people are already talking about it getting the word out so i've found plenty of blog posts or talks where people were talking about css four and five of course it's it's like not not the broad mass of talks but it's it's mostly people that are like really deep into css but it's nice to see these terms being coined
and appear everywhere now yeah awesome wonderful so that was a mouthful a lot of things i think to read up on we we have our document here with plenty of links and notes for links to to add and we'll put them all in show notes. Everybody can look it up. And to you, thanks a lot for your time, for being here, for enlightening us.
For, but not us alone, but everyone and doing these nice experiments and talking about it. You are welcome. And if there are questions to you, people will find your contact data also in our show notes, if they don't have it already. And with that we wish everyone a nice day evening or a night and listen to you next week bye thank you bye.
Mit dieser Revision setzen wir unsere Reise durch die State of HTML 2026 fort. Nachdem wir in der vorherigen Folge bereits Performance, Web Components und Formulare behandelt haben, nehmen wir uns die…
Gemeinsam mit Stefan Judis nehmen wir uns die State-of-HTML-Umfrage 2026 vor. Statt auf die noch ausstehenden Ergebnisse zu warten, gehen wir die abgefragten Webtechnologien durch und diskutieren, wel…
In dieser Revision begrüßen wir Moritz Glantz (LinkedIn / Mastodon), UX Engineer und Accessibility-Spezialist aus Karlsruhe, den einige von euch vielleicht noch aus dem Podcast Wo wir sind ist vorne k…
Wir haben uns auf der code.talks in Hamburg mit Nico Martin zusammengesetzt, den ihr auch auf LinkedIn und YouTube findet. Nico war bereits 2022 bei uns zu Gast, damals ging es um WebBluetooth, WebUSB…
Für diese Ausgabe unseres Glücksrads haben wir uns Stefan Judis eingeladen. Stefan war schon einige Male zu Gast, zuletzt in Revision 542, ist Frontend-Entwickler, DevRel bei Checkly, schreibt den wöc…