The latest in Web UI (Google I/O ‘24)

Chrome for Developers
16 May 202445:47

Summary

TLDRThe video script by Yuna, a member of the Chrome team, delivers an enthusiastic presentation on the latest advancements in CSS UI components and interactions for web development. She discusses the importance of evolving web capabilities to meet user needs and highlights the team's focus on three key objectives: enhancing the smoothness of web navigation, simplifying UI component creation and styling, and improving the overall quality of life for developers. Yuna introduces new features such as native scroll-driven animations, view transitions for seamless page interactions, and the popover attribute for creating UI components like dropdown menus more easily. She also touches on the future of web development with cross-document view transitions, advanced styling capabilities for form controls, and the potential for more intuitive and responsive web design. The talk is a celebration of the current 'golden era' for web UI and a glimpse into the future possibilities that these new features unlock for developers and users alike.

Takeaways

  • 🎨 **CSS UI Components Evolution**: The web platform is continually evolving with new CSS UI components and interactions that enhance user engagement and successful product use.
  • 🌐 **Golden Era for WebUI**: Web developers are experiencing a golden era for WebUI with features like container queries and advanced selectors that were once considered impossible now being implemented.
  • 🚀 **Performance Improvements**: Native scroll-driven animations and view transitions are being introduced to improve performance by reducing reliance on custom scripts and third-party dependencies.
  • 🔄 **Progressive Enhancement**: New features support progressive enhancement, ensuring that users on unsupported browsers still receive a default experience, while those on supported browsers get enhanced interactivity.
  • 🌟 **View Transitions**: Airbnb and other companies are leveraging view transitions for smoother web navigations, and the technology is expanding to support cross-document transitions for multi-page applications.
  • 📐 **Anchor Positioning**: A new CSS function allows for native anchor positioning, making it easier to create UI components like dropdowns and menus without complex scripting.
  • 📊 **Form Controls Styling**: Efforts are being made to allow easier customization and styling of form controls like dropdowns, with new HTML and CSS features being proposed and experimented with.
  • 🎭 **Popover API**: The popover attribute simplifies the creation of popovers and dropdown menus, with GitHub already implementing it to reduce code and improve accessibility.
  • 📝 **Quality of Life Improvements**: There have been numerous smaller updates that improve the quality of life for developers, such as native CSS nesting, text layout improvements, and responsive design enhancements.
  • 🌈 **Color Theming**: Relative color syntax and the light-dark function have made color theming more dynamic and easier to implement, providing a more ergonomic approach to theme styling.
  • 📖 **Logical Selectors**: The `:has()` selector is a game-changer for logical styling, allowing for parent selector functionality and reducing the need for JavaScript in many cases.

Q & A

  • What are the core capabilities that bring websites to life according to Yuna?

    -The core capabilities that bring websites to life are the latest landings in CSS UI components and interactions for the web platform, which create a surface for users to interact with and successfully use the product.

  • What is the significance of the 'golden era for web UI' mentioned by Yuna?

    -The 'golden era for web UI' signifies a period where new features are landing across browsers at an unprecedented pace, unlocking capabilities like intrinsically responsive design with container queries, logical components using advanced selectors, and dynamic color theming.

  • What are the three primary objectives the Chrome team focused on for the web platform in the mentioned year?

    -The three primary objectives are: making the web feel super smooth with native scroll driven animations and view transitions, making it easy to build UI components and style them with interaction patterns, and resolving paper cuts to improve the quality of life for web developers from layout to architecture.

  • How does the native scroll driven animations API work?

    -The native scroll driven animations API allows developers to create scroll-based animations without relying on scroll observers or heavy scripting. It uses a scroll progress to start, pause, and reverse an animation, enabling the creation of partial or full page visuals with elements animating into and within the viewport.

  • What is the purpose of the Baseline initiative?

    -The Baseline initiative aims to provide better clarity on browser feature availability. Features discussed in the talk are either Baseline newly available, meaning supported by all major browser engines and interoperable, or not yet available across browsers.

  • How can view transitions enhance user experience in single page applications?

    -View transitions can create a seamless user experience by animating between web pages. They can be used for smooth navigations, updating list views on user interactions, and providing a fluid user flow, making the web more engaging without the need for third-party scripting.

  • What is the benefit of using the new CSS view transition types?

    -CSS view transition types allow for different kinds of visual transitions when animating to and from page views. This enables developers to customize the transition experience based on the context, leading to a more tailored and user-friendly interaction.

  • What is the significance of the new cross document view transitions feature?

    -Cross document view transitions allow for multi-page application support, enabling smooth transitions between pages that live within the same origin. This feature enhances the user experience by providing a more integrated and interactive web journey.

  • How does the popover attribute simplify the creation of popovers in web applications?

    -The popover attribute, when set on an element and linked to a button with the popover target, creates a basic popover that the browser handles natively. This includes behaviors like light dismiss functionality, tab focus management, and keyboard bindings, eliminating the need for JavaScript and reducing code complexity.

  • What is the role of the anchor positioning API in creating UI components?

    -The anchor positioning API allows developers to tether two elements to each other with just a few lines of code. It can be used to create anchored elements like menus, submenus, and tooltips that respond dynamically to the movement of their anchor elements, enhancing the visual relationship and user interaction.

  • What are the potential future enhancements for the popover API?

    -Future enhancements for the popover API include the introduction of interest Target to trigger popovers from user interactions like hover or tab focus, and an additional General invoker called invoke Target that supports a declarative developer experience for all interactive elements.

Outlines

00:00

🌟 Introduction to CSS UI Components and Web Platform Evolution

Yuna introduces the topic of the latest advancements in CSS UI components and interactions, emphasizing the importance of the web platform's evolution to meet user needs. She mentions the 'golden era' for web UI, highlighting new features like container queries, advanced selectors, and dynamic color theming. The focus for the year includes improving web smoothness, UI component building, and resolving minor issues to enhance developer quality of life. The Baseline initiative is also introduced, aiming to clarify browser feature availability.

05:00

🎨 Scroll-Driven Animations for Enhanced Web Interactions

The paragraph delves into scroll-driven animations, a new API that allows for creating scroll-based animations without heavy scripting. It discusses how this feature enables developers to build animations that progress with the scroll direction, enhancing user interactions. The technique is shown to be beneficial for progressive enhancement, with the ability to provide an enhanced experience to supported browsers while maintaining a default experience for others. Tokopedia's use case is highlighted, demonstrating the feature's impact on code management and performance.

10:01

🔄 View Transitions for Seamless Web Page Animations

View transitions are introduced as a feature for animating between web pages, aiming to create a seamless user experience. The implementation of view transitions in single-page applications is discussed, along with the simplification of the process using new updates. The support for view transition types is also covered, allowing for different visual transitions based on the page being navigated to or from. Airbnb's integration of view transitions is used as an example. The future of view transitions, including cross-document transitions and new JavaScript events, is teased.

15:03

🌐 Cross-Document View Transitions for Multi-Page Applications

The announcement of cross-document view transitions for multi-page application support is made, highlighting the ability to transition between pages within the same origin. The difference between same-document and cross-document view transitions is explained, along with the new CSS rule for handling view transitions. The use of JavaScript events for custom effects and the potential for scoped transitions and gesture-driven transitions are also discussed.

20:04

🛠 Building UI Components with Improved Styling and Interaction

The challenges of customizing and styling form controls are addressed, with the introduction of new primitives to simplify the process. The 'popover' attribute is highlighted for creating popovers with built-in behaviors like light dismiss functionality and keyboard bindings. The future of the popover API, including the 'interest-target' concept, is also mentioned. Native anchor positioning is introduced as a new feature for tethering elements, demonstrated with a tooltip example.

25:06

🔄 Advanced Anchor Positioning and Responsive UI Elements

The paragraph discusses advanced anchor positioning, including the use of the 'anchor' function in CSS for creating visual relationships between elements. The 'inset area' layout mechanism and logical properties for positioning are introduced. The concept of dynamic movement of anchored elements as their anchor moves is explained. The browser's ability to handle positioning rules and transitions for responsive UI elements is also covered.

30:08

🎯 Future of Popover API and Styling of Dropdowns

The future direction of the popover API is discussed, including the 'interest-target' feature for triggering popovers from user interactions like hover or tab focus. The 'invoke-target' concept is introduced for a broader range of interactive elements. The ongoing work on styling dropdowns is highlighted, with the mention of an experimental API for customizable selects, including new HTML elements and CSS properties for styling.

35:10

📋 UI Component Improvements and Quality of Life Updates

Various UI component improvements and quality of life updates are summarized, including the creation of exclusive accordions, user-valid and user-invalid pseudo-classes, field sizing content, and the ability to add HR elements in selects. The impact of these features on developer experience and the reduction of scripting requirements is emphasized.

40:13

🌈 CSS Theming, Logical Styling, and New CSS Features

The paragraph covers updates in CSS theming with relative color syntax and the light dark function for theme styles. The impact of the ':has' selector for logical styling is discussed, along with the benefits for companies like PolicyBazaar. The landing of container queries and the upcoming '@property' feature for CSS custom properties are mentioned, highlighting their potential for new interactions and robust features in CSS.

45:13

🚀 Conclusion and Invitation to Explore New Web Technologies

The conclusion of the presentation invites web developers to explore new web technologies such as scroll-driven animations, view transitions, anchor positioning, and styleable selects. It emphasizes the importance of the developer community's voice in prioritizing and bringing new capabilities to life. The speaker expresses excitement for the future of web development and encourages the audience to provide feedback and engage with the Chrome team.

Mindmap

Keywords

💡CSS UI components

CSS UI components refer to the visual elements used to create user interfaces on the web. In the video, Yuna discusses the latest advancements in these components, which are crucial for enhancing user interaction and the overall look and feel of websites. The script mentions features like native scroll-driven animations and view transitions, which are part of the ongoing evolution to meet user needs and improve the web platform.

💡Intrinsically responsive design

Intrinsically responsive design is an approach to web design that allows elements to adapt and respond to their content size, rather than relying on the viewport size. Yuna highlights the feature of container queries as a highly anticipated addition to CSS that enables this design approach. It allows developers to apply styles based on the size of the container element, which is a significant shift from the traditional use of media queries.

💡Logical components

Logical components in the context of web development refer to the use of advanced CSS selectors to style elements based on their logical relationships within the DOM (Document Object Model). Yuna mentions that logical components are now possible with new CSS functionalities, which enable developers to perform complex styling tasks such as parent selection, thus improving the capabilities of styling on the web platform.

💡Dynamic color theming

Dynamic color theming is the ability to create adaptive and responsive color schemes for web interfaces. Yuna discusses new color spaces and color functions that support dynamic color theming, allowing developers to build theme systems from just a few variables. This feature enhances the accessibility of interfaces and provides a more engaging user experience by allowing color schemes to adapt to different contexts or user preferences.

💡Scroll-driven animations

Scroll-driven animations are a new feature in CSS that allows for animations to be triggered and controlled based on the user's scroll position. Yuna provides an example of how this can be used to create engaging visual effects that respond to scrolling, such as animating elements as they enter the viewport. This feature contributes to a more dynamic and interactive web experience without the need for heavy scripting.

💡View transitions

View transitions are animations that occur when moving between different views or pages on a website, aiming to create a seamless user experience. Yuna explains how view transitions can be implemented using the `document.startViewTransition` method and custom animations. This feature is particularly useful for single-page applications and can enhance user engagement through smooth transitions between content.

💡Popover

A popover, as discussed in the video, is a user interface element that appears when a user interacts with a trigger element, like a button. Yuna introduces the `popover` attribute, which simplifies the creation of popovers by handling key behaviors such as display management, dismissal on outside clicks, and keyboard navigation. This feature is part of the effort to make building UI components more straightforward and accessible for web developers.

💡Anchor positioning

Anchor positioning is a CSS technique that allows elements to be positioned relative to other elements, known as anchors. Yuna mentions the new `anchor` function in CSS, which can be used to tether UI components to specific points on the page, creating a visual connection between related elements. This feature is powerful for creating interactive and dynamic UIs, such as menus and submenus, without complex scripting.

💡Native form controls styling

Native form controls styling refers to the ability to customize the appearance of HTML form elements, such as dropdowns and checkboxes, without losing their native functionality. Yuna discusses the challenges and ongoing work to allow developers to style these elements easily. The script mentions the `appearance` property and `selected option` element as part of the solution to enable extensive customization while maintaining accessibility and user experience.

💡Quality of life improvements

Quality of life improvements in the context of web development refer to updates and features that streamline the process of building websites, making it more efficient and enjoyable for developers. Yuna highlights several such improvements, including native CSS nesting, text layout enhancements, and the `:has` selector, which reduce the need for complex workarounds and allow developers to focus on creating better user experiences.

💡Container queries

Container queries are a CSS feature that allows styles to be applied based on the size of an element's content, rather than the size of the viewport. Yuna notes that container queries have landed as a feature, offering a more granular level of control over responsive design. This feature is significant for creating layouts that adapt to the size of their container, leading to more flexible and intrinsically responsive web design.

Highlights

CSS UI components and interactions are evolving to meet user needs and improve the web platform.

The Chrome team is focused on making the web platform smoother, easier for building UI components, and resolving minor issues to improve developer quality of life.

Native scroll-driven animations allow for creating scroll-based animations without heavy scripting.

View transitions provide a seamless user experience when navigating between web pages.

Cross-document view transitions support multi-page applications for a more robust web experience.

The popover attribute simplifies creating popovers for menus and tooltips without JavaScript.

Native anchor positioning allows developers to easily tether two elements together.

Inset area is a new layout mechanism for placing elements relative to their anchors on a nine-cell grid.

CSS nesting has improved to support lookahead nesting, making component styling more ergonomic.

The `:has` selector allows for logical styling based on the presence of children or their state.

Container queries enable styling based on an element's intrinsic size, offering more precision than media queries.

The `@property` rule in CSS provides semantic meaning to custom properties and enables new interactions.

Logical components using advanced selectors and dynamic color theming with new color spaces are now available.

The `light-dark()` function simplifies theme styling and makes it more concise.

Field sizing content allows form inputs to grow or shrink based on their content.

The exclusive accordion pattern enables an accordion where only one item is visible at a time.

User-valid and user-invalid pseudo-classes provide feedback based on user interaction with form inputs.

The addition of HR elements in `<select>` improves content separation within select lists.

Transcripts

play00:05

hello

play00:06

[Music]

play00:08

everyone I love you already um welcome

play00:11

web developers I'm so happy to have you

play00:13

here my name is Yuna and I'm very

play00:16

excited to be here today to talk about

play00:19

the latest Landings in CSS UI components

play00:23

and interactions for the web platform

play00:27

these are the core capabilities that

play00:29

really bring your websites to life

play00:31

creating a surface for your users to

play00:33

interact with and to successfully use

play00:36

your product which is why it's so

play00:38

important and critical that the web

play00:40

keeps evolving to meet these user needs

play00:43

and continually improve so I'm thrilled

play00:46

that on the Chrome team we're working on

play00:48

making the web platform a better place

play00:51

for users and for the developers that

play00:53

build for

play00:54

it last year we talked about how we're

play00:57

in a golden era for webui

play01:00

with new features Landing across

play01:02

browsers at a pace that we've never seen

play01:05

before unlocking things like

play01:07

intrinsically responsive design with

play01:10

container queries which was a highly

play01:12

anticipated feature and has finally

play01:15

landed logical components using Advanced

play01:18

selectors enabling the previously

play01:21

impossible task of parent selection and

play01:23

more complex styling

play01:25

capabilities and dynamic color theming

play01:29

with new color spaces and color

play01:31

functions supporting the ability to

play01:33

build accessible interfaces and build

play01:35

theme systems from just a few variables

play01:39

this year we haven't slowed down at all

play01:42

in fact we've continued to build on our

play01:45

investment in creating the powerful

play01:47

robust web platform that you

play01:50

deserve we've had a focus on three

play01:53

primary objectives the first is to make

play01:56

the web feel super smooth as users

play01:58

navigate the web platform and this

play02:01

includes native scroll driven animations

play02:03

and view

play02:05

transitions the second is to finally

play02:07

make it easy to build UI components and

play02:10

style them which includes interaction

play02:13

patterns like click away to dismiss and

play02:15

supporting positioning Logic for

play02:17

anchoring elements together these are

play02:20

core features that are platform gaps

play02:22

which shouldn't be so hard to

play02:25

implement and the third is resolving

play02:27

paper cuts and continually improving

play02:30

quality of life for web developers from

play02:33

layout to architecture these are the

play02:35

areas that we just wish were a little

play02:37

easier to manage like writing nested

play02:40

Styles and international typography that

play02:42

just works or being able to style Things

play02:46

based on the number of children that

play02:47

they have without resorting to added

play02:50

scripting these are the kinds of

play02:52

problems that we're solving to build a

play02:54

better web so I'm excited to get into

play02:57

some of the new features that we've

play02:58

landed that have landed in other

play03:01

browsers to reach Baseline newly

play03:03

available and talk about what we're

play03:05

Landing next speaking of Baseline this

play03:09

is a cross functional initiative to

play03:11

provide better Clarity on browser

play03:13

feature availability features in this

play03:16

talk will either be Baseline newly

play03:19

available meaning that the feature is

play03:21

supported by all major browser engines

play03:24

recently and therefore interoperable or

play03:27

not yet available across browsers so

play03:30

let's get into it a web experience is

play03:33

fundamentally a call and response

play03:36

between you and your users and that's

play03:38

why it's so important to invest in

play03:40

quality web experiences and user

play03:43

interactions and it shouldn't be so hard

play03:45

to build these robust engaging

play03:47

interactions with the native web

play03:49

platform no added third-party scripting

play03:52

to manage or to slow down Optimal

play03:55

Performance so we've been working on

play03:57

some really big improvements that unlock

play03:59

capabilities that we've never had before

play04:02

on the web platform for navigating

play04:04

within and between page

play04:06

views the first is native scroll driven

play04:09

animations like the name implies this

play04:12

new API enables developers to create

play04:15

scroll based animations without relying

play04:18

on scroll observers or other heavy

play04:20

scripting similar to how time-based

play04:23

animations work on the platform you can

play04:25

now use a scroller scroll progress to

play04:28

start pause and reverse an animation so

play04:32

as you scroll forward you see that the

play04:34

animation progresses and as you scroll

play04:36

backwards it'll go the other way around

play04:39

this lets you create partial or full

play04:41

page visuals with elements animating

play04:44

into and within the viewport also known

play04:46

as scrolly telling for dynamic visual

play04:52

impact you can also build more subtle

play04:55

effects like this animation of images as

play04:58

they enter the viewport and this can be

play05:00

done with just a few lines of code

play05:02

declaratively in CSS along with the rest

play05:05

of your

play05:06

Styles first you set up a CSS animation

play05:09

using key frames like any other

play05:11

animation effect and then use the

play05:13

animation property to attach it the

play05:16

differences start here where instead of

play05:19

setting a Time based duration like 1

play05:21

second you set an animation timeline in

play05:25

this case we're using the view function

play05:27

with its default values to track the

play05:30

image relative to the scroll Port which

play05:32

in this instance is also the

play05:35

viewport and we want this to happen from

play05:37

the moment the image is partially in

play05:39

view up to the point where it's in the

play05:42

center of the scroller at 50% and you

play05:44

can do this by setting the animation

play05:47

range so that the scroll D animation

play05:49

only occurs in a segment of the entire

play05:52

view timeline

play05:54

range you can animate images elements

play05:58

text or really anything in your view as

play06:00

you scroll and this demo adds a little

play06:03

bit more Dimension with a translation as

play06:05

it scales in and the Shadows get

play06:08

deeper one reason I particularly love

play06:11

this technique of animating elements is

play06:13

that it lends itself so nicely to

play06:16

Progressive enhancement this means that

play06:18

unsupported browsers will get the

play06:20

default user experience while users on

play06:23

supported browsers will see that little

play06:25

bit of enhanced

play06:27

interactivity you can use a CSS at

play06:30

supports rule to ensure that only

play06:32

developers on supported browsers get

play06:35

this enhanced

play06:37

animation and you can combine this with

play06:39

a user preference query to ensure that

play06:42

users with preferred reduced motion

play06:44

don't see this higher level of

play06:48

interactivity scroll driven animations

play06:50

can mean full page scrolly telling

play06:53

experiences but they can also mean more

play06:55

subtle animations like a header bar

play06:57

minimizing and showing a Shadow as you

play07:00

scroll a web

play07:02

app this demo is created by making a few

play07:05

different key frame animations for the

play07:07

header the text the nav bar and the

play07:10

background and then applying respective

play07:12

scroll driven animations to

play07:15

each while they each have a different

play07:17

animation style each of the these get

play07:19

the same animation timeline the nearest

play07:22

scroller in this case and the same

play07:25

animation range from the top of the page

play07:27

to 150 pixels

play07:31

not only does this native API reduce a

play07:33

code burden that you'd need to maintain

play07:35

whether that's custom script that you

play07:37

wrote or via an additional third-party

play07:39

dependency but it also removes the need

play07:42

to ship various scroll observers meaning

play07:44

some pretty significant performance

play07:46

benefits and this is because scroll D

play07:49

animations work off the main thread when

play07:51

animating properties that can be

play07:53

animated on the compositor like

play07:55

transforms and opacity whether you're

play07:57

using the new API directly in CSS or via

play08:00

the JavaScript

play08:02

hooks tokopedia recently used scroll

play08:05

driven animations to enable the product

play08:07

navigation bar to appear as you scrolled

play08:11

using the native API has had some

play08:13

serious benefits both for code

play08:15

management and for

play08:19

performance because it eliminated the

play08:21

need for third-party scripting they were

play08:23

able to reduce the over the overhead and

play08:26

maintenance for this feature by

play08:28

eliminating 8 0% of their scroll driven

play08:32

interactions code Additionally the

play08:34

tokopedia team saw significant

play08:36

performance improvements in CPU

play08:39

utilization reducing it from 50% to 2%

play08:43

while

play08:44

scrolling we know these effects will

play08:46

continue to make the web a more engaging

play08:49

place and we're already thinking about

play08:51

what might come next including the

play08:53

ability to not just use new animation

play08:55

timelines but to also use a scroll point

play08:58

to trigger the the start of an animation

play09:01

and you've likely seen effects like this

play09:03

all over the web we hope to make this a

play09:05

reality as an addition to this powerful

play09:08

feature set in the months to

play09:10

come and there are even more scroll

play09:12

features coming to browsers in the

play09:14

future this demo by Adam Argyle shows a

play09:17

combination of these features CSS scroll

play09:19

start Target to set the initial date and

play09:22

time within the pickers and the

play09:24

JavaScript snap changed event to update

play09:27

the header date making it trivial to

play09:29

synchronize the data with the snapped

play09:32

event you can build on this to update a

play09:35

picker in real time with the JavaScript

play09:37

snap changing event like you see here

play09:40

while these features are only currently

play09:42

available in Canary behind a flag they

play09:45

unlock capabilities previously

play09:47

impossible or very difficult to build in

play09:49

the platform and highlight the future of

play09:51

scroll based interactions

play09:54

possibilities and the tooling for these

play09:56

features has had a nice Improvement

play09:58

recently as well well the def tools

play10:00

animations panel now supports the

play10:03

ability to inspect scroll driven

play10:04

animations see their start times

play10:07

relative to each other and relative to

play10:09

the scroller and to scrub through the

play10:12

timeline this visual representation

play10:14

along with the new more declarative API

play10:17

makes working with scroll driven

play10:18

animations so much

play10:21

easier to learn more about getting

play10:23

started with scroll driven animations

play10:25

our team just launched a new video

play10:27

series that you can find on the Chrome

play10:29

for Developers YouTube

play10:36

channel here you'll learn the basics of

play10:39

scroll driven animations from brahmas

play10:41

vam who's sitting in the front row here

play10:43

including how the feature Works

play10:45

vocabulary various ways to create

play10:47

effects and how to combine effects to

play10:50

build Rich experiences it's a great

play10:53

video series I highly recommend that you

play10:55

check it

play10:56

out we've just covered a powerful new

play10:59

feature for animating within web pages

play11:02

but there's also a powerful new feature

play11:04

called view transitions for animating

play11:06

between web pages to create a seamless

play11:09

user

play11:10

experience you might want to transition

play11:13

some small text in a card from one view

play11:15

into a larger title on the next view or

play11:18

animate a preview image into the

play11:20

following page for a nice user

play11:23

experience Airbnb is one of the

play11:25

companies who has already been leading

play11:27

the road with experimenting and

play11:29

integrating view transitions into their

play11:31

UI for a really smooth and Seamless Web

play11:35

navigations experience from the listing

play11:37

editor sidebar right into editing photos

play11:40

and adding amenities all within this

play11:43

really nice fluid user

play11:46

flow or maybe you're not switching

play11:49

between pages and you just have a micro

play11:51

interaction where your list view is

play11:53

getting updated on a user interaction

play11:56

this effect can be seamlessly achieved

play11:58

by using view transitions

play12:00

and the way to quickly enable view

play12:02

transitions in your single page

play12:04

application is as simple as wrapping an

play12:06

interaction using document. start viw

play12:10

transition and making sure that each

play12:12

element that is transitioning has a view

play12:14

transition name like so which you can do

play12:17

inline or dynamically using JavaScript

play12:20

as you create the Dom

play12:22

nodes which can then also be used to

play12:25

apply custom animations to your view

play12:27

transition

play12:29

but this can get kind of cumbersome so

play12:32

the First new update to view transitions

play12:34

this year luckily simplifies this

play12:36

problem and introduces the ability to

play12:39

create view transition classes that can

play12:41

be applied to custom

play12:44

animations and support begins in

play12:46

chromium

play12:48

125 another big Improvement for view

play12:50

transitions is support for view

play12:52

transition types view transition types

play12:55

are useful when you want a different

play12:57

kind of visual view transition when

play12:59

animating to and from page views for

play13:03

example you might want a homepage to

play13:05

animate into a Blog Page in a different

play13:08

way than you want that blog page to

play13:10

animate back to the homepage or you

play13:12

might want pages to swap in and out in

play13:14

different ways like in this example

play13:16

going from left to right and vice versa

play13:19

before this was pretty messy to do you

play13:22

could add classes to the Dom to apply

play13:24

these Styles but then you would have to

play13:26

remove the classes afterward and manage

play13:28

all of that yourself

play13:30

view transition types solve this problem

play13:33

you can set up types within your

play13:35

document. start view transition function

play13:37

which now accepts an object update is

play13:39

the Callback function that updates the

play13:41

Dom and types is an array with the types

play13:45

another advantage of types is that it

play13:47

enables the browser to clean up old

play13:49

transitions instead of requiring you to

play13:51

do this manually before initiating the

play13:53

new

play13:55

transitions what makes the web so

play13:57

powerful is how expansive it is many

play14:00

applications are not just a single page

play14:02

but a robust tapestry containing

play14:05

multiple pages and that's why we're so

play14:07

excited to announce today that we're

play14:09

shipping cross document VI transitions

play14:11

for multi-page application support in

play14:13

chromium

play14:14

126 this yeah this is an exciting

play14:18

one this is the final and most exciting

play14:21

addition to view transitions on the web

play14:24

platform this new cross document feature

play14:27

sets set includes web experiences that

play14:30

live within the same origin like

play14:32

navigating from web.dev to web.dev

play14:35

blog but this does not include

play14:38

navigating cross origin such as

play14:40

navigating from web.dev to blog. web.dev

play14:43

or to another domain like

play14:46

google.com one of the key differences

play14:49

with same document view transitions is

play14:51

that you no longer need to wrap your

play14:52

transition in document. start view

play14:55

transition instead you would opt in both

play14:58

of the pages involved in the view

play15:00

transition by using the CSS view

play15:02

transition at Rule now the page

play15:05

navigation itself is the trigger that

play15:07

runs the view

play15:08

transition for a more custom effect you

play15:11

can also hook in Via JavaScript using

play15:14

the new page swap or page reveal event

play15:16

listeners which give you access to the

play15:18

view transition object with page swap

play15:21

you can do some last minute changes on

play15:23

the outgoing page right before the old

play15:26

snapshots get taken and with page RW whe

play15:29

you can customize the new page before it

play15:31

begins to render after it has been

play15:34

initialized and finally to put it all

play15:36

together in this demo you can see that

play15:38

both the names and profile pictures are

play15:40

animating between page views and note

play15:43

how the URL bar updates as well these

play15:46

are multi-page view transitions in

play15:49

action this effect is created by using

play15:53

both the page reveal and the page stop

play15:55

events along with some other page data

play15:57

and custom animation

play15:59

and this is just a quick glimpse into

play16:01

the code snippet a part of it behind it

play16:04

all the feature is bright for view

play16:07

transitions with more exploration and

play16:09

iteration happening to bring even more

play16:11

features including scoped transitions

play16:14

which allow you to limit a transition to

play16:17

a Dom subtree enabling the rest of the

play16:20

page to continue to be interactive and

play16:22

supporting multiple view transitions at

play16:25

the same

play16:26

time the next one is gestur driven view

play16:30

transitions which support dragging or

play16:32

swipe gestures uh to trigger a cross

play16:35

doent view transition for more native

play16:38

like experiences on the web and finally

play16:40

in the future we'll have navigation

play16:42

matching in CSS which lets you customize

play16:45

your cross document view transitions

play16:47

directly in your CSS as an alternative

play16:50

to using the page Swap and Page reval

play16:53

events in

play16:55

JavaScript to learn more about view

play16:57

transitions from multi-page applications

play17:00

including how to most performant set

play17:02

them up with pre-rendering check out

play17:04

bramis Van Dam's talk multi-page

play17:07

application view transitions are here on

play17:10

the Chrome for Developers YouTube

play17:12

channel and now let's talk about

play17:14

building UI

play17:16

components this morning you heard about

play17:18

how our goal is to build a powerful web

play17:21

made easier and I think a lot of the

play17:23

advancements in the UI interaction space

play17:26

have certainly aligned with this goal

play17:28

but when we talk to developers and ask

play17:30

what folks are struggling with the

play17:32

answer is often customizing and styling

play17:36

Forum

play17:37

controls who here has dealt with that

play17:40

yeah yeah that's like everybody and we

play17:42

hear you as a frustrated front end

play17:44

developer I also asked myself this

play17:47

question in

play17:49

2017 why can we still not style form

play17:51

controls and

play17:53

dropdowns changing a font or adding a

play17:55

little flag icon to improve user parsing

play17:59

shouldn't mean that you have to

play18:00

completely rip out your code and build a

play18:03

drop down element out of divs adding

play18:05

scripts to manage the navigation

play18:07

interaction States and event changes

play18:10

then you also have to add those

play18:11

multimodal user inputs and additional

play18:13

accessibility properties to make it all

play18:15

work well it's just too hard to do this

play18:19

right luckily I found myself on the

play18:22

Chrome team just a few years later and

play18:24

with the cooperation of multiple

play18:25

Community groups and standards bodies

play18:28

where working on a solution this is a

play18:31

complex problem touching so many pieces

play18:34

of the platform from layout and

play18:36

rendering to scroll and interaction to

play18:39

user agent styling in CSS properties and

play18:42

even changes to HTML

play18:45

itself a drop down alone consists of

play18:48

many pieces like an open Button a

play18:50

selected value an arrow indicator a data

play18:54

list of options that's anchored to that

play18:56

opening button and this is just a simple

play18:58

drop down and the key states that you

play19:00

have to handle are keyboard bindings to

play19:03

enter and exit the navigation and to

play19:06

navigate that interaction dismiss

play19:08

capabilities when you click away the

play19:11

ability to close other dropdowns when

play19:13

you open one tab Focus management into

play19:16

the dropdown when you open it and many

play19:19

other small

play19:20

details so obviously it's really painful

play19:23

to do this by hand but the platform

play19:25

doesn't make it easy either to fix this

play19:28

we broke down those pieces and we

play19:30

shipping a few primitive features that

play19:32

will enable styling dropdowns would also

play19:35

do so much more first we shipped a

play19:38

global attribute called popover which

play19:40

I'm excited to announce just reached

play19:42

Baseline newly available status a few

play19:44

weeks ago popover elements are hidden

play19:47

via display none until opened with an

play19:50

invoker to create a basic popover you

play19:53

would simply set the popover attribute

play19:55

on said popover and Link its ID to a

play19:58

button with popover Target now the

play20:01

button is the invoker which opens the

play20:04

popover and this is all you need to

play20:06

create this basic popover with the

play20:08

popover attribute now enabled the

play20:11

browser handles many of those key

play20:13

behaviors that I just mentioned this

play20:15

includes promotion to the top layer

play20:17

which is a separate layer above the rest

play20:19

of the page so you don't have to worry

play20:21

about handling Z indexes anymore light

play20:25

dismiss functionality we're clicking

play20:27

outside of the popover area will

play20:29

optionally close the popover and return

play20:32

Focus there's also default tab Focus

play20:35

management since opening the popover

play20:37

makes the next tab stop inside the

play20:40

popover regardless of where it is on the

play20:42

page it does not have to be a sibling to

play20:44

the element that's invoking

play20:47

it these

play20:48

are I know it's so hard to do this we

play20:51

need to make it easier it also has

play20:54

built-in keyboard bindings where hitting

play20:56

the Escape key will uh exit the popover

play21:00

or double toggling will return focus and

play21:02

exit the popover and finally um default

play21:05

component bindings as the browser will

play21:08

semantically connect a popover to its

play21:10

trigger so you get all of this with one

play21:14

attribute all you need is the popover

play21:17

attribute popover Target and an ID on

play21:19

your popover no JavaScript required

play21:24

[Applause]

play21:28

it is important to note that popover

play21:31

does not have any inherent semantic

play21:34

meaning so you still need to use the

play21:36

proper HTML structures and Arya to

play21:38

provide more contextual meaning for what

play21:41

the popover element actually is and

play21:43

additionally popover does not inert the

play21:46

rest of the page so that means that it

play21:47

does not make the rest of the page

play21:49

non-interactive you can use it for menus

play21:51

tool tips and other elements if you do

play21:53

want to focus trap and make the rest of

play21:55

the page non- interactive you might want

play21:57

to use a dialog El element and you can

play21:59

do a lot of similar things with those

play22:01

two

play22:02

features you might even be using the

play22:04

popover API today without realizing it

play22:07

because gith help implemented popover on

play22:09

their homepage for their new menu and in

play22:12

their pull request overview

play22:14

progressively enhancing this feature

play22:16

today already and using a polyfill built

play22:19

by oddbird with some significant support

play22:21

from github's own keep Circle to support

play22:24

older

play22:26

browsers it's pretty awesome to to see

play22:28

this in the wild and to see a team so

play22:31

dedicated to Great UI deeply invested in

play22:34

the success of this API and it's clear

play22:37

why as it's already had a huge impact

play22:39

for the GitHub team they've been able to

play22:42

deprecate literally thousands of lines

play22:44

of Code by migrating these components

play22:46

over to

play22:48

popover additionally they've benefited

play22:50

from the top layer management that

play22:52

popover provides and the built-in

play22:54

accessibility relationships making it

play22:56

significantly easier to build this

play22:59

complex pattern in the correct

play23:03

way and when you have popovers you'll

play23:05

likely want to add some interaction as

play23:07

well and there are four new features

play23:09

that landed in the past year to support

play23:11

animating popovers and these include the

play23:14

ability to animate display and content

play23:17

visibility on a key frame

play23:19

timeline the transition Behavior

play23:21

property with the allow discreet keyword

play23:24

uh which transitions discret properties

play23:27

like display it puts you in a new

play23:28

transition mode the starting style rule

play23:31

to animate entry effects from display

play23:34

none um and into the top layer and the

play23:37

overlay property to control top layer

play23:40

behavior during an

play23:42

animation these properties work for any

play23:44

element that you're animating into the

play23:46

top layer whether it's a popover or a

play23:48

dialogue and altogether it looks like

play23:51

this for a dialogue with a

play23:53

backdrop first you set up the starting

play23:56

style so that the browser knows what

play23:58

style to animate this element into the

play24:00

Dom from this is done for both the

play24:03

dialogue and the

play24:05

backdrop then you style the open state

play24:08

for both the dialogue and the backdrop

play24:10

so for a dialogue this open state would

play24:12

be the open attribute if you're doing

play24:13

this for a popover it will be the

play24:15

popover open pseudo

play24:17

element and finally you animate the

play24:19

opacity display and overlay using the

play24:22

allow discrete keyword to enable the

play24:25

animation mode where discrete properties

play24:27

can transition

play24:30

but popover is just the start of the

play24:32

story today I'm really excited to

play24:35

announce that support for Native anchor

play24:37

positioning is now available in chromium

play24:39

125 which is landing in stable chromium

play24:42

based browsers

play24:44

today

play24:48

woo this means with just a few lines of

play24:51

code the browser can handle all the

play24:53

logic to tether two elements to each

play24:55

other in this example we have a simple

play24:57

tool TI being anchored to each of these

play25:00

buttons positioned at the bottom center

play25:03

and this one is the same idea combining

play25:06

popover anchor and CSS trigonometric

play25:09

functions to create this fund a twirl

play25:11

open effect for this menu anchoring this

play25:14

menu of options above the button that is

play25:17

invoking the menu which is this plus

play25:19

sign you can set up an anchor positioned

play25:22

relationship in CSS by using the anchor

play25:25

name property on the anchoring element

play25:27

in this case the button and the position

play25:29

anchor property on the positioned

play25:31

element in this case the tool tip and

play25:35

then you can apply absolute positioning

play25:37

or fixed positioning relative to the

play25:39

Anchor using the anchor function here

play25:41

we're positioning the top of the tool

play25:43

tip the positioned element to the bottom

play25:46

of the

play25:47

anchor alternatively you could use

play25:50

anchor name directly in the anchor

play25:52

function like so and skip the position

play25:55

anchor property altogether this can come

play25:57

in handy when you're anchoring to

play25:59

multiple elements

play26:01

too finally you can use the new anchor

play26:03

Center keyword to justify and align

play26:06

properties and center the positioned

play26:08

element to its

play26:10

anchor while it's very convenient to use

play26:13

anchor positioning with popover popover

play26:16

is not a requirement of using anchor

play26:18

positioning it works great with any two

play26:21

or more elements to create a visual

play26:23

relationship in fact this demo inspired

play26:26

by an article from Roman Co

play26:29

shows an underlined style being anchored

play26:31

to these list items as you hover or tab

play26:34

over them in this case we're using the

play26:37

anchor function to set up the anchor

play26:39

position using the physical properties

play26:41

of Left Right and bottom and when we

play26:44

hover over one of the links the target

play26:46

anchor custom property changes and the

play26:49

browser shifts the target to apply the

play26:51

positioning Styles we're also animating

play26:54

the color at the same time creating this

play26:56

pretty neat effect using

play27:00

anchoring in addition to the default

play27:02

directional absolute positioning that

play27:04

you've likely used before there's a new

play27:06

layout mechanism that has landed as a

play27:08

part of the anchor positioning API

play27:10

called inset area inset area makes it

play27:14

easy to place anchor positioned elements

play27:16

relative to their respective anchors and

play27:18

works on a nine cell grid with the

play27:21

anchoring element in the

play27:23

center for example inset area top places

play27:26

the element at the top and inset area

play27:29

bottom does what you would expect it to

play27:31

do as

play27:32

well with inset area this can be

play27:35

simplified to

play27:38

this you can combine these positional

play27:40

values with span keywords to start at

play27:42

the center position and span to the left

play27:45

span to the right or span to take up the

play27:47

full set of columns or rows that are

play27:50

available in this space you may also

play27:53

want to use uh logical properties

play27:56

instead of directional keywords for

play27:58

inset area which are also available as a

play28:00

part of this API to make it easier to

play28:03

visualize and to pick up this layout

play28:05

mechanism I built a tool at the

play28:07

following URL where you can explore

play28:09

these different position values and copy

play28:11

the

play28:12

code and because these elements are

play28:15

anchored the positioned element

play28:16

dynamically moves around the page as its

play28:19

anchor moves so in this case we have

play28:21

container query styled card Elements

play28:24

which resize based on their intrinsic

play28:26

size something that you could not do

play28:28

with media queries and the anchored

play28:30

element will shift to the new layout as

play28:32

the card UI

play28:35

changes menus and submenu navigation are

play28:38

so much easier to create with a

play28:40

combination of popover and anchor

play28:43

positioning but what happens when you

play28:45

hit the edge of a viewport with your

play28:47

anchored element well you can let the

play28:49

browser handle that for you too you can

play28:51

do this in a few ways the first is to

play28:53

create your own positioning rules in

play28:56

this case the submenu is initially

play28:58

positioned at the right of the

play29:00

storefront button with the code that's

play29:02

currently

play29:03

shown but you can create a position

play29:05

tribe block for when there's not enough

play29:08

space to the right of the menu and let's

play29:10

call that one

play29:12

bottom then you can connect that POS

play29:14

with position try options explicitly

play29:17

calling it by name like this so now the

play29:20

browser will switch between these

play29:22

anchored states trying the right

play29:25

position first and then shifting to the

play29:27

bottom and the browser can do all of

play29:29

this with a nice transition as

play29:32

well along with the explicit positioning

play29:35

logic there are a few keywords that the

play29:37

browser provides if you want some basic

play29:39

interactions like flipping your anchor

play29:41

in the block or inline directions for a

play29:44

simple flipping experience you can take

play29:46

advantage of these flip keyword values

play29:49

writing a position try definition uh

play29:51

skipping the position TR definition Al

play29:53

together so now you can have a fully

play29:55

functional location response of anchor

play29:58

positioned element with just a few lines

play30:01

of

play30:02

CSS it's pretty pretty

play30:08

cool we see these teered experiences

play30:10

everywhere and this set of features is

play30:13

an excellent start to unleashing

play30:15

creativity and better control over

play30:17

anchor positioned elements and layered

play30:20

interfaces but this is just the start

play30:23

currently popover only works with

play30:25

buttons as the invoking elements or with

play30:27

JavaScript as the invoker for something

play30:29

like these Wikipedia style previews a

play30:31

pattern seen all over the web platform

play30:34

we have to make it possible to interact

play30:36

with but also to trigger a popover from

play30:38

a link and from showing user interest

play30:42

not necessarily clicking through but

play30:44

doing something like a hover or a tab

play30:47

Focus so as a next step for the popover

play30:49

API we're working on interest Target to

play30:52

solve these needs and to make it easier

play30:54

to recreate these experiences with the

play30:57

proper accessib hooks built in this is a

play31:00

really challenging accessibility problem

play31:02

to solve with a lot of open questions

play31:04

around ideal behaviors but solving this

play31:07

and normalizing this functionality at a

play31:09

platform level should improve these

play31:11

experiences for

play31:12

everyone in addition to the interest

play31:15

Target invoker there's an additional

play31:17

future facing General invoker currently

play31:20

available to test in Canary thanks to

play31:22

the work of two thirdparty developers

play31:24

Keith Circle and Luke warlo called

play31:26

invoke Target invoke Target supports the

play31:29

declarative developer experience that

play31:31

popover Target provides but for all

play31:34

interactive elements including dialogue

play31:37

details video input type equals file and

play31:41

more we know that there are use cases

play31:43

that aren't covered yet by this API like

play31:46

styling the arrow that connects an

play31:48

anchored element to its anchor

play31:50

especially as the position of that

play31:51

anchor moves and shifts or enabling an

play31:55

element to slide and to stay in the

play31:57

viewport instead of snap to another

play31:59

position when it reaches its bounding

play32:00

box so while we're excited about this

play32:03

powerful API and about Landing these

play32:05

features we're also looking forward to

play32:07

expanding on its capabilities even more

play32:09

in the future I talked a bit about

play32:11

styling dropdown so you might be

play32:13

thinking well it's nice that we're

play32:14

getting these Primitives but what about

play32:16

those dropdowns the good news is this is

play32:19

something that we have been actively

play32:21

working on for a long time now and

play32:23

there's been a lot of progress the bad

play32:26

news is that this API is still very much

play32:28

in an experimental State at this time

play32:30

however I'm excited to share some live

play32:33

demos and updates of our progress and

play32:35

hopefully get some of your feedback

play32:37

first there has been progress on how to

play32:39

opt users into the new customizable

play32:42

select experience the current work in

play32:45

progress way to do this is to use an

play32:47

appearance property in CSS set to

play32:49

appearance based select now keep in mind

play32:52

this is an experimental API at this

play32:54

stage so the syntax might change once

play32:58

appearance is set regardless of what the

play33:01

final value name ends up being you'll be

play33:03

opting into a new customizable select

play33:07

experience in addition to

play33:08

appearance-based select there are a few

play33:11

new HTML updates these include the

play33:13

ability to wrap your options in a data

play33:16

list for customization and the ability

play33:19

to add arbitrary non-interactive content

play33:22

like images and other elements to your

play33:25

options finally you'll have access

play33:27

access to a new element selected option

play33:30

which will reflect the content of the

play33:32

options into itself that you can then

play33:34

use to customize to your own needs which

play33:37

is really really handy here's an example

play33:40

of customizing selected option in the

play33:42

Gmail UI where a visual icon represents

play33:45

the type of reply that you have selected

play33:48

to save space you can use basic display

play33:52

Styles within the selected option to

play33:54

differentiate the option styling from

play33:56

the preview Style

play33:58

in this case text which is shown in the

play34:00

option can be visually hidden in

play34:02

selected

play34:03

option one of the biggest advantages of

play34:06

reusing the select element for this API

play34:09

is having the backwards compatibility

play34:11

story in this country select you can see

play34:14

that we have customized the UI to

play34:16

include flag images in the options for

play34:19

easier user parsing of the

play34:21

content because non-supported browsers

play34:24

will just ignore the lines that they

play34:25

don't understand such as the C custom

play34:28

button the data list selected option and

play34:30

the images within the option the

play34:32

fallback will look like this which is

play34:34

similar to the current default select UI

play34:37

identical to the current default select

play34:40

UI with customizable selects the

play34:42

possibilities are endless and I

play34:44

particularly love this Airbnb style

play34:47

country selector because there's a

play34:48

clever style for responsive design you

play34:51

can do this and so much more with the

play34:53

upcoming styleable select making it a

play34:56

much needed addition to the platform

play34:58

form solving select and all the pieces

play35:00

that come along with it isn't the only

play35:03

UI component that the Chrome team has

play35:05

been working on there are quite a few

play35:07

others as well and the first addition to

play35:10

uh the component part of this talk that

play35:12

I want to share is the ability to create

play35:14

exclusive accordion which is an

play35:17

accordion where only one item is shown

play35:19

at a time the way to enable this is to

play35:22

apply the same name value for multiple

play35:24

details elements hence creating a

play35:26

connected group grou of details much

play35:29

like a group of radio

play35:31

buttons another UI component Improvement

play35:33

are the user valid and user invalid

play35:35

pseudo classes similar to how uh valid

play35:39

and invalid works these work only when a

play35:42

user has significantly interacted with

play35:45

the input and this is stable in all

play35:47

browsers recently this means

play35:49

significantly less code is needed to

play35:51

determine if a form value has been

play35:53

interacted with or has become dirty

play35:55

which can be very useful for provid

play35:57

providing user feedback and reduces a

play35:59

lot of scripting that would be necessary

play36:02

to do this in the

play36:04

past another handy component that has

play36:07

landed recently is field sizing content

play36:10

which can be applied to form controls

play36:12

like inputs and text areas this enables

play36:15

the size of the input to grow or

play36:17

strength depending on its contents field

play36:19

sizing content can be particularly handy

play36:21

for text areas as you no longer are

play36:24

resolved to the fixed sizes where you

play36:26

may need to scroll up to see what you

play36:28

wrote in earlier parts of your prompt in

play36:30

two small input

play36:33

boxes the ability to um add an HR or

play36:36

horizontal rule element into select it's

play36:39

another small but useful component

play36:41

feature that landed in Baseline this

play36:43

year while it doesn't have much semantic

play36:46

use it does help you nicely separate

play36:48

content within a select list especially

play36:51

content that you might not necessarily

play36:53

want to group in an Ops group like a

play36:55

placeholder value someone's excited

play36:58

about this feature I love that I would

play37:01

bucket all of these smaller changes as

play37:02

quality of life improvements for UI that

play37:05

constantly improve the developer

play37:07

experience when building on the web

play37:09

platform we're constantly iterating and

play37:11

it's not just for interactions and

play37:13

components but there are many other

play37:15

quality of life updates that have landed

play37:17

in the past year so I hope that you're

play37:19

ready for a little bit of a lightning

play37:20

Roundup here at the

play37:22

end native CSS nesting landed in all

play37:25

browsers last year and has since

play37:27

improved to support look ahead nesting

play37:30

which means that the Amper sand before

play37:31

element names is no longer a requirement

play37:35

this makes nesting feel so much more

play37:37

ergonomic and similar to what I've used

play37:39

in the past one of my favorite things

play37:41

about CSS nesting is that it enables you

play37:43

to visually block components and within

play37:46

those components include all of their

play37:48

states and modifiers such as container

play37:51

queries and media queries previously I

play37:53

was in the habit of grouping all of

play37:55

those queries at the bottom of my file

play37:57

for specificity purposes but now you can

play38:00

code them all in a way that makes sense

play38:02

right next to each other in line with

play38:04

the rest of your

play38:05

code another really nice change is the

play38:08

ability to use centering mechanisms like

play38:10

align content in Block layout this means

play38:14

that you can now do things like

play38:16

vertically centering a div without

play38:18

needing to apply Flex or grid

play38:22

[Applause]

play38:25

layout which means that you don't won't

play38:27

get the side effects from flex and grid

play38:30

like preventing margin collapse that you

play38:32

might not want from those layout

play38:34

mechanisms speaking of layout text

play38:37

layout got a nice improvement with the

play38:38

addition of Tex strap balance and text

play38:41

strap pretty here you can see the

play38:43

differences between the balanced and

play38:45

pretty headlines versus the unbalanced

play38:47

headlines teex strap balance is used for

play38:50

a more uniform block of text while

play38:52

pretty focuses on rendering reducing

play38:54

single tins on the last line of text

play38:58

we landed even more typographic layout

play39:00

updates for cjk text features which got

play39:03

a lot of nice updates in the past here

play39:05

like the word break Auto phrase feature

play39:08

that wraps the line at the natural phase

play39:11

boundary and text space a teex spacing

play39:15

trim which applies curing between

play39:17

punctuation characters to improve the

play39:19

readability of Chinese Japanese and

play39:21

Korean typography for more visually

play39:24

pleasing results by default

play39:27

and in the World of Color theming we saw

play39:29

a big update with relative color syntax

play39:32

in this example the colors here use OK

play39:34

lch based theming and the Hue value

play39:36

adjust based on the slider which changes

play39:39

the entire theme this can be achieved

play39:41

with relative color syntax here the

play39:44

background uses the primary color of

play39:46

each of these list items based on the

play39:48

Hue and adjust lightness chroma and Hue

play39:50

channels to adjust the overall value I

play39:53

is the sibling index in the list which

play39:56

enables this gradation of values showing

play39:58

you how you can combine these stepping

play40:00

functions with custom properties and

play40:02

relative color syntax to build out these

play40:05

themes and along with the light dark

play40:07

function theming has become so much more

play40:10

Dynamic and simplified the light dark

play40:12

function is an ergonomic Improvement

play40:14

that simplifies color theming so that

play40:16

you can write theme Styles in a much

play40:18

more concise way as demonstrated so

play40:21

nicely in this visual diagram by Adam

play40:23

Argy before you would need two different

play40:25

blocks of code your default theme theme

play40:27

and a user preference query to set up

play40:29

your theme options where now you can

play40:31

write these Styles in the same line of

play40:33

code using the light dark

play40:35

function and I would be remissed to talk

play40:37

about modern UI without mentioning one

play40:39

of the most impactful inop features from

play40:41

the past year and this has to be the has

play40:44

selector laning across all browsers in

play40:46

December of last year this API is a game

play40:49

changer for writing logical Styles the

play40:52

has selector enables you to check if a

play40:54

child has a specific children or if

play40:56

those children are in a specific State

play40:59

and essentially can function as a parent

play41:01

selector as well has has already shown

play41:04

to be particularly useful for many

play41:06

companies including policy Bazaar who

play41:08

uses ha to style blocks based on their

play41:11

interior content such as this compare

play41:13

section here where the style adjusts if

play41:16

there's a plan to compare in the block

play41:18

or if it's

play41:20

empty with the has selector they were

play41:23

able to eliminate any added scripting

play41:25

based validation uh for the user's

play41:28

selection and replace it with a CSS

play41:30

solution that yielded the same results

play41:32

with much less code these logical style

play41:35

features that required a loot of

play41:37

JavaScript to ACH be achieved in the

play41:39

past can now be done in just a few lines

play41:42

of

play41:43

CSS another key addition to the web that

play41:46

is now newly available and growing in

play41:49

usage is container queries which enable

play41:51

the ability to query an element um and

play41:54

its parents intrinsic size to apply

play41:57

Styles which is a much more fine Toth

play41:59

comb than media queries which only query

play42:02

the viewport size angular recently

play42:05

launched a beautiful new documentation

play42:07

site on

play42:24

angular.js its own logical styling and

play42:27

without container queries something like

play42:29

this was really hard to do you would

play42:31

have to do resize observers element

play42:32

observers now it's trivial to build

play42:35

something like this based on a parents

play42:37

elements

play42:39

size and finally very soon we're excited

play42:42

to see at property land and Baseline

play42:45

this is a key feature for providing

play42:47

semantic meaning to CSS custom

play42:49

properties also known as CSS variables

play42:52

and enables a slew of new interactions

play42:55

possibilities from something as

play42:57

seemingly straightforward as animating a

play43:00

gradient to enabling contextual meaning

play43:03

typechecking defaults and fallback

play43:05

values in CSS opening the door for even

play43:08

more robust features like range style

play43:10

queries this is a feature that was not

play43:13

possible before but it now provides so

play43:16

much depth to the language of

play43:18

CSS with all of these new changes and

play43:22

Powerful UI capabilities Landing across

play43:24

browsers the possibilities truly do feel

play43:27

endless new interactions experienced

play43:29

with scroll different animations and

play43:31

view transitions make the web more fluid

play43:34

and interactive in ways that we've never

play43:36

seen before and Next Level UI components

play43:40

make it easier than ever to build robust

play43:42

beautifully customized components

play43:44

without ripping out the entire native

play43:47

experience and finally quality of life

play43:50

improvements in architecture layout

play43:52

typography and responsive design not

play43:55

only solve the little big things but

play43:57

they also give developers the tools they

play43:59

need to build complex interfaces that

play44:02

work on a variety of devices form

play44:05

factors and meet user needs with these

play44:08

new features you should be able to

play44:09

remove thirdparty scripting for

play44:11

performance heavy features like scrolly

play44:13

telling and tethering elements to each

play44:15

other with anchor positioning build

play44:17

fluid page Transitions and finally style

play44:19

dropdowns improving the overall

play44:22

structure of your code

play44:24

natively it's never been a better time

play44:27

to be a web developer and there hasn't

play44:28

been so much energy and excitement

play44:30

around UI since the announcement of CSS

play44:33

3 native features that we've needed but

play44:35

have only dreamed of in the past or

play44:37

actually Landing now and finally truly

play44:40

becoming a part of the web platform and

play44:43

it's because

play44:45

it's it's because of your voice that

play44:48

we're able to prioritize and finally

play44:50

bring these capabilities to life so

play44:52

thank you all for speaking up and doing

play44:54

that

play44:56

[Applause]

play45:00

we're working on making it easier to do

play45:02

the hard tedious stuff natively so that

play45:04

you can spend more time building the

play45:06

things that matter like the core

play45:08

features and design details that set

play45:10

your brand apart to learn more about

play45:13

these features as they land follow along

play45:15

at developer. chrome.com and web.dev

play45:17

where our team shares the latest in web

play45:20

Technologies try out scroll driven

play45:22

animations view transitions anchor

play45:25

positioning or even styleable select and

play45:27

let us know what you think we're here to

play45:29

listen and we're excited to help I can't

play45:32

wait to see what you build thank you so

play45:33

much

play45:36

[Music]

play45:38

[Applause]

Rate This

5.0 / 5 (0 votes)

Related Tags
CSS UIWeb DevelopmentNative ScrollingView TransitionsWeb PlatformUser InteractionFront-end DesignWeb StandardsChrome TeamYuna