🔥 There are 446 Hot Tips!!

Hot tips are spicy lil' nuggets related to web development and tooling that I share on my twitter account. I've logged them here to make them easier to find.

I am so happy this is being implemented.

If every tab being named page in Next.js/Sveltekit folder based routing makes you go loopy, this new VS Code feature is going to be a life saver!

1.1K11433515130K
1.1K962731K
69022

I can't believe you can do this in JavaScript! In the browser. With local AI models. 🤯

3629
30724512731K
367151911K

Raw dog your CSS selectors with @scope

45621329K
69919
7891063727084K

AI based emotion detection for video thunbnails

69023.1K

Running Promises concurrently - but not too many at once!

p-map is a nice balance between Promise.all() and sequential await when working with compute heavy functions.

435401418838K
40616
493143813K

Love the use of mix-blend-mode: difference; on the site logo for this striped t-shirt

1K631229364K
53013513K

I did it! Gutted an old iPad 3, and stuck a $20 driver board to turn the high resolution display into an external monitor. Pretty fun project!

7893533182116K
185397.7K

Here are 10 hot tips for using CSS :has() 👉🏻

1: CSS :has() Basics Select an element based on its children. Handy when you want to style a parent differently when it contains media.

2: The anywhere selector! When The body has a checkbox checked, you can grab literally any other element in the body and style it. Useful for toggling settings without JS.

3: The Previous Element Selector! Grab the item before the selected item. Never before (heh) possible!

4: Layout Targeting! I use this in my slide decks. Based on the contents of the slide, I can create a few commonly used layouts.

Adding or removing elements will automatically change the layout.

  1. Form Validation Styling. Style the label, fieldset or wrapping element based on the validation of the input.

You can pair this with the previous element selector as well if your label and inputs are siblings.

  1. All Siblings! When you are hovering a child, select all the siblings, but not the hovered one. Useful if you want to focus or scale up an element while dimming the rest. Works well table rows too!

  2. Quantity Queries. When a parent has more than 5 children, style it differently.

Perhaps you want to add CSS mask and fade out the rest of the items.

  1. Empty Children Select the parent when it's children are empty.

Maybe you want to show skeleton loaders, or flag an element for debugging?

  1. Nested dropdown navs. Add a ↓ when there is a dropdown available.

  2. Attribute Selectors! Style the parent based on it's child file type!

889722316K
30
3K571422K299K

auto-growing <textarea> without JavaScript!

CSS is getting field-sizing: content; to size inputs by their contents.

Dropped in Chrome Canary today, demo here:

2K26433766203K
1.2K24
2.5K1635644K

Suuuper handy new CSS:

:user-invalid and :user-valid pseudo selectors let you style inputs only once they have been interacted with

Just landed in Chrome + Safari, been in Firefox for years.

2.1K35721907177K
2.2K1094240K