Opens profile photo
Follow
Click to Follow KevinJPowell
Kevin Powell
@KevinJPowell
CSS Evangelist Helping people fall in love with CSS: YT: YouTube.com/kevinpowell Twitch: twitch.tv/kevinpowellcss Courses: kevinpowell.co/courses
Montréal, Québeckevinpowell.coJoined March 2009

Kevin Powell’s Tweets

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
  • One long video
    40.2%
  • Playlist
    59.8%
440 votesFinal results
12
27
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> link below! 🔥
Embedded video
0:14
28.4K views
Quote Tweet
Blink: Intent to Ship: The Popover API groups.google.com/a/chromium.org
12
710
Show this thread
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 😅
8
57
Show this thread
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🔥 link && expl. below! 👇
Embedded video
1:23
16.4K views
12
622
Show this thread
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!
Quote Tweet
Chrome 111 beta is here. Features include new CSS color types and spaces, CSS trigonometric functions, and the View Transitions API. developer.chrome.com/blog/chrome-11
4
132
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.
twitter.com is blocked
twitter.com refused to connect.

ERR_BLOCKED_BY_RESPONSE
16
43
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...
.media-group:nth-child(1):target ~ .navigation-indicators > *:nth-child(1) { … }
Quote Tweet
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…
Show this thread
1
27
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)
4
23
Show this thread
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 🤷
* selector matching 10005 items: 1.518ms
element selector matching 10000 items: 1.626ms
class selector matching 10000 items: 1.713ms
[data-item] matching 10000 items: 1.992ms
[data-item*="test="] matching 10000 items: 2.856ms
1
29
Show this thread
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...
1
11
Show this thread
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...
Quote Tweet
I've just put out a new video! How to write Semantic CSS youtu.be/lWu5zf_S9R4
6
54
Show this thread
A nice "Pop out" hover effect featuring some CSS masters 😎 ( ) Demo: codepen.io/t_afif/full/zY via Want to know the secret behind? Read my new article 👉 css-tricks.com/a-fancy-hover- Share a demo with your own avatar 👇 #CSS
Embedded video
0:05
8.5K views
Quote Tweet
Embedded video
0:05
💡 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: codepen.io/t_afif/full/MW via @CodePen #CSS
6
279