The Color Input & The Color Picker

By Chris Coyier on

HTML has a color input that is pretty decent: That’s it. Support across the board. However, browsers can and do have different approaches to what happens when the input is used. Ultimately: the user activates the input, may choose a color using the provided UI, and the color becomes the inputs value. It’s not my […]

Dispatching an Event

By Chris Coyier on

Sometimes when crafting up some quick interactive vanilla JavaScript, I add an event listener and write the functionality I want to happen right there. For example, here’s a super basic character counter: Totally works. But, you won’t see any character count until you start typing something. That’s probably not ideal. It should count the characters […]

@media (scripting: enabled)

By Chris Coyier on

Ahmad Shadeed: Today I learned about the media scripting feature. It’s about detecting JS support via a CSS media query. Soon, we won’t need the .no-js or .js classes once this is widely available. Currently supported in Chrome 120, Firefox 119, Safari 17. Tweet

Light-DOM-Only Web Components are Sweet

By Chris Coyier on

First: the Light DOM is just… the regular DOM. When people talk about native Web Components, the Shadow DOM comes up a lot. I have extremely mixed feelings about the Shadow DOM. On one hand, it’s a powerful scoping tool. For example, CSS applied inside the Shadow DOM doesn’t “leak” outside, meaning you can be […]

Invokers

By Chris Coyier on

Keith Cirkel demonstrates a brand new concept (requires Chrome Canary and the Experimental Web Platform Features flag right now) called Invokers, a proposal from the Open UI group that is polyfillable. You “invoke” events directly on a specific element in the DOM: Then you can listen for the invoke event on that element. Adding interactive […]

Numeric Separators

By Chris Coyier on

Did you know you can declare number values in JavaScript with notation like 1_000_000? This is especially useful for large numbers where you might be used to seeing commas within the number to help readability (but commas themselves are invalid). It’s perhaps even more useful when declaring numbers in binary, hexadecimal, or BigInt notation.

Did you know?

Frontend Masters Donates to open source projects. $363,806 contributed to date.