Links
Limit the reach of your selectors with the CSS `@scope` at-rule
What if CSS gave you a way to be both pretty specific about which elements you select, without requiring you to write selectors of high specificity or ones that are tightly coupled to your DOM? Well, that’s where
@scope
comes into play, offering you a way to select elements only within a subtree of your DOM.
Color Me Curious
Asking “what color space should I use?” is sort of like asking “what’s the best font to use?” Context here is everything and the answer totally depends on what kind of problem you’re trying to solve. Color spaces are designed to solve different kinds of problems.
The selected date must be within the last 10 years
Present me helps past me by sharing lessons learned when validating an input that requires a date value within a specified range.
event.target.closest
Instead of adding lots of event handlers to lots of elements, you can add one event handler to the root element. Then figure out whether the element that just got clicked is special or not.
Nine things automated accessibility tests can’t test
In my mind, automated tests are a first step in the journey to creating accessible experiences. They are also the first line of defense in detecting regressions. With the low-hanging fruit managed and out of the way, you’re able to apply more time, attention, and education towards harder problems.
Videos
Using CSS custom properties like this is a waste
Custom properties are amazing, but a lot of people don’t take advantage of how awesome they are. They set them up in the
:root
and that’s it, but they can be so much more useful than that! So, in this video I explore how we take them up a notch and make our code a lot more efficient in the process.
Sponsor
Sponsored by Cloud Four
Thanks to Cloud Four for sponsoring this week’s newsletter! They solve complex responsive web design and development challenges for ecommerce, healthcare, fashion, B2B, SaaS, and nonprofit organizations.
If you’d like to help with the costs of running Friday Front-End, you can back our Patreon for as little as a dollar a month.