Did you know I have a newsletter?
I tend to share some random general musings, what I've been up to in the past week, and other links and resources that I stumble across.
Goes out every Sunday.
I'm going to be making a mini-crash course soon-ish... do you prefer one long video for crash courses, with timestamps/chapters (2+ hours), or do you prefer playlists?P
Future UI Tip! 🔮
Create popups with HTML & CSS alone
– No z-index fighting 🙌
- Keyboard controls and autofocus
- Light dismiss
- Styleable backdrop
This is all you need! 👇
<button popovertarget=pop>Toggle</button>
<div popover id=pop>Popover!</div>
Blink: Intent to Ship: The Popover API https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAM%3DNeDibTKMw-JK97b4UE1Z6TdaODxUArcM8YsLDGwAV29mOYw%40mail.gmail.com…
The packing is complete!
Tomorrow the moving truck is here and hopefully not too late in the day we will head out for the first half of a ~1,250km drive to our new house!
Sidenote: I have *way* too much stuff 😅
Sitting down to record my last video in my current house (we're moving out on Monday!)
Managed to keep my recording area set free of the carnage... barely 😂
Future UI && CSS Tip! 🔮
Use anchor positioning to tether an element to multiple anchors 🤓
.link {
left: anchor(--a1 center);
bottom: anchor(--a2 center);
}
With some "magic", you could define links and let the browser draw them for you🔥
This is a huge one, y'all!
🌈 HD color spaces like oklch & the color() function
🎨 color-mix() function
👩🏻🔬 Advanced :nth-child selectors
🧮 Trigonometric functions in CSS
👗 Style queries w/custom properties
🎢 View transitions for SPA's
ALL IN ONE RELEASE!
Chrome 111 beta is here. Features include new CSS color types and spaces, CSS trigonometric functions, and the View Transitions API.
https://developer.chrome.com/blog/chrome-111-beta/…
Anyone else been running into this of late?
I open a new tab and go to Twitter and get it... refresh, same thing. Open *another* new tab and try again and works fine.
I'd say it's like, ~20% of the time or so, including following links.
I can't seem to let this go, lol, but I find it funny that I got so many comments about attribute selector performance being an issue, but I used this selector in a video a few months ago and I didn't get one comment about selector performance...
I've had *a lot* of comments on this video about attribute selectors being bad for performance compared to class selectors.
Where are people learning this?
The only article I found that says it (and only mentions it in passing) is 13 years old... twitter.com/KevinJPowell/s…
So yes, you could probably optimize things a bit, I guess, but I have a feeling there are *a lot* of other optimizations out there that could save you 0.3ms or more (assuming you have 10,000 matches on your attribute selector, which I think is a pretty big assumption)
And before posting I had to double check, so here are some stats thanks to Edge's Selector Stats...
So sure, you can save ~0.3ms selecting 10,000 elements with classes instead of attributes 🤷
The only thing I can think of is when using them with *=, $=, |= etc, which will be more intensive than simply using `=` (which is what I used in that video), since the browser will have to do substring searches...
I've had *a lot* of comments on this video about attribute selectors being bad for performance compared to class selectors.
Where are people learning this?
The only article I found that says it (and only mentions it in passing) is 13 years old...
who wrote this article that was the inspiration for my video: https://benmyers.dev/blog/semantic-selectors/…
Strongly recommend you give it a read (and check out others on his site, it's a fantastic resource!)
CSS Tip!
Add a nice hover effect to your profile picture using a minimalist code
No extra element (only the <img> tag)
No pseudo-element
Less than 20 declarations
Optimized with CSS variables
Demo: http://codepen.io/t_afif/full/MWBjraa… via @CodePen#CSS