Published at
Updated at
Reading time
10min
The Web Weekly newsletter keeps you up to date, teaches you web development tricks and covers all things working in tech.

Guten Tag! Guten Tag! ๐Ÿ‘‹

Do you know what autocomplete="one-time-code" does? Or have you used the command HTML attribute already? And do you think it's OK to call CSS custom properties "CSS variables"?

Turn on the Web Weekly tune and find some answers below. Enjoy!

Lars listens to "The Meltdown - Better Days" and says:

There's no song I've been listening to more than this one. I love the mix of nostalgia and optimistic desire for brighter days!

Do you want to share your favorite song with the Web Weekly community? Hit reply; there are two more songs left in the queue.

Let's open this Web Weekly with some form tips and tricks people were talking about this week!

Tyler shared how you could build a one-time password UI. And look at this beauty!

<input type="text"   inputmode="numeric"   autocomplete="one-time-code"   maxlength="6"   pattern="\d{6}"   required>

The inputmode="numeric" enforces numbers on all the virtual keyboards, autocomplete="one-time-code" enables automatic autofill for password managers, and the input values are restricted to six numbers using the pattern attribute. Man, I love HTML!

If you wonder why the input isn't of type number, even though one-time passwords often consist of number characters, they're not really number values.

Speaking of numbers, Ollie shared how to build a step counter with attached increment/decrement buttons.

HTML snipped including buttons that use `commandfor` and `command` attributes.

Do you see what's going on there? The buttons trigger events for the input element using command and commandfor. And these events are then caught in a single event listener on the input itself.

const numberInputs = document.querySelectorAll('input[type="number"]'); numberInputs.forEach((input) => { input.addEventListener("command", (event) => { if (event.command === "--increment") { input.stepUp(); }}); });

Isn't this wild? I didn't realize that the new command attributes will work like that. Now, you probably wonder if you can use these attributes already? command and commandfor work in Chromium and Firefox, and will land in Safari soon. So you might want to check them out!

If you enjoy Web Weekly, share it with your friends and family.

A quick "repost" really helps this indie newsletter grow. Thank you! โค๏ธ

A huge bag of karma points goes to Tony, Lars and Kristofer this week! Thank you for buying me a monthly coffee and covering a small fraction of sending over six thousand emails every week! โค๏ธ

If you enjoy Web Weekly, join 29 supporters and support this indie newsletter on Patreon or GitHub Sponsors. It really makes a difference.

Something that made me smile this week

Doctype โ€” '80s BASIC type-in mags are back, but this time for HTML!  10 wonderful web apps, including games, toys, puzzles and utilities  No coding knowledge needed, you just type

I probably won't buy the Doctype magazine but I love everything about it! If you miss the good old days of reading source code on paper, you'll enjoy it!

Read the source

And, by the way, if you enjoy this one, you're gonna love the Internet Phone Book!

No code

  • Derek's post is not the usual Web Weekly material because it covers men, society and gambling but, oh boy, it ends with a banger quote worth sharing: If you want two people who disagree to actually talk to each other, you build them a space to talk. If you want them to hate each other, you give them a phone. โ†’ The Monks in the Casino
  • And here's another banger from Brooklyn: You can't call it the "online world" if you never leave your feed. โ†’ How to use the internet again: a curriculum
  • The older I get the more I start to question myself. Who am I and who do I want to be. I haven't done this exercise yet, but it's a great starter to figure yourself out. โ†’ 10 Values Discovery Questions

I recognize that this week's "No code" section is a bit different than usual. What do you think of it? Yay or nay? Let me know!

New on the blog

I've had some time on my hands this weekend and blogged some quickies:

Visualized TypeScript types

An interactive visual explaining different TypeScript "extend" operations.

I still remember how intimidated I was when I started to learn TypeScript. Saying that it was challenging would be an understatement. Who did need types anyway, right?

If you're starting out today, "Visual Types" is a fabulous tool explaining the type system and it's so much fun that I just did all the lessons myself.

Learn all the types

The beautiful CSS future

/* Range style query in an if() statement */ .weather-card {   background: if(     style(--rain-percent > 45%): blue;     else: gray;   ); }

Una shared that the range syntax works with style queries now which, of course, is pretty cool. I just checked the style query browser support and it turns out Chromium and modern Safari support style queries already. CSS if is still a Chromium-only thing, though.

But regardless of the browser support, can we take a moment and appreciate the beauty of this CSS snippet? ๐Ÿ‘† CSS has come a looooong way!

Be fancy

If this post isn't enough fancy CSS, this guide on style queries, CSS if and container queries is also worth a read.

GitHub bans toasts because of their bad accessibility

Toasts โ€” GitHub no longer uses toasts because of their accessibility and usability issues. Toasts pose significant accessibility concerns and are not recommended for use.

You probably have seen these "fancy" notifications that usually show up in the bottom area after you click a button or complete a task. They're called "toasts" โ€” no idea why they're called like that โ€” and GitHub's design system team now published a new rule. Don't use toasts because they're bad for UX and accessibility.

I can't say that I've ever noticed GitHub making heavy toast usage ๐Ÿฅช, but I feel like this page might become a reference piece for frontend developers! It includes recommendations on what to do instead, too! ๐Ÿ’ฏ

Make things accessible

Node.js type stripping is now considered stable

Terminal session with the command "node index.ts"

Node.js allows you to run TypeScript for a while but now with v25.2 type stripping is considered stable! If you haven't heard and want to learn more about erasing all the types, this official Node.js guide will get you up to speed!

Strip the types

You're halfway through!

Wowza! Would you enjoy getting Web Weekly straight to your inbox?

The wonderful weird web โ€“ Super Mario Bros in your URL bar

"Tiny Mario" next to a URL bar which includes dots and blocks representing a Super Mario Bros game.

This link brings back many happy memories. If you've ever wondered if it'll be possible to play Super Mario Bros in the URL bar (who doesn't, right?), here's your answer!

Play SNES

Good code principles

It's much easier to end up with good code by (dogmatically) sticking to the principles above than it is to have bad code and make it good again.

What rules do you follow when you want to write "good code"? Do you religiously believe in DRY code ("Don't repeat yourself")? Is KISS your thing ("Keep it simple and stupid")? Or do you ignore all these old school "computery terms"?

Kilian shared his approach to coding and his post includes quite some wisdom!

Keep things maintainable

CSS variables or custom properties?

 It is OK to Say "CSS Variables" Instead of (or Alongside) "Custom Properties"

Let me be honest; when people call CSS custom properties "CSS variables" something in me wants to say "But they're not called like that!". Well, it turns out I was wrong.

Call them whatever you like

Side note: Roma has been blogging the entire November and you should definitely check out his work when you're into CSS nerdery!

Be a good colleague and review your own PRs

When you create a pull request in GitHub, click on the Files changed tab, and scroll through the diff. Anywhere you've done something new that's not already explained by in-code comments, add a comment in the GUI about what you did and why.

If you want to stand out, make your colleagues' lives easier and land your PR changes quicker, do everyone a favor and review your own pull requests. It'll make a huge difference!

Review your stuff

Random MDN โ€“ :out-of-range

input:out-of-range { background-color: orangered; }

From the unlimited MDN knowledge archive...

Did you know that there's an :out-of-range CSS pseudo-class? Now you do!

Stay in range

TIL recap โ€“ every and some Array surprises

[].every((item) => item === 'great'); // true [].every((item) => item !== 'great'); // true [].some((item) => item === 'great'); // false [].some((item) => item !== 'great'); // false

Let's pretend that I didn't spend 1 1/2h debugging simple array operations this week...

Do you know how the every and some Array methods treat empty arrays? ๐Ÿ‘† Isn't this super confusing and strange?

Watch out for the emptiness

Find more short web development learnings in my "Today I learned" section.

New on the baseline Interop updates

Jen Simmons post: The overall interoperability score for Interop 2025 has reached 92% test pass rate. Looking good!

I haven't seen any great baseline updates this week, but Jen posted about interop 2025. And I think this is very interesting!

This year's focus areas have a 92 interop score right now. This sounds great but what were the focus areas again? My favorites are:

  • an interoperable details element (done)
  • CSS @scope (done โ€” yes, it's shipping in Firefox soon!)
  • View transitions (not done, but close)
  • Core Web Vitals (not done, but close)
  • CSS anchor positioning (not done, but close)

When you look at the list, it's huge to see how much the web progressed in a year. However, have a look yourself.

Check what has shipped

GitHub's finest

A new Tiny Helper

Your browser scores 64%. Recognized 950 out of 1485 features in 13ms.

If you want to quickly check if your (or your friends') browser supports a certain CSS feature, browserscore.dev does this for you!

Score!

Find more single-purpose online tools on tiny-helpers.dev.

Thought of the week

Comic: Let's talk about AI art.

I won't spoil what you'll find in this comic about AI art, but if you don't enjoy looking at AI-generated pictures and videos, you'll love this one because it's creative, cute and made by a human.

AI art is an interesting technology because despite its growing popularity, nobody seems to want it.

Did you learn something from this issue?

โค๏ธ If so, join 29 other Web Weekly supporters and give back with a small monthly donation on Patreon or GitHub Sponsors.

This is all, friends!

Loved this email? Hated this email? I want to hear about it!

If you think something needs improvement or something sparked some joy, reply to this email because I want to know more!

And with that, take care of yourself - mentally, physically, and emotionally.

I'll see you next week! ๐Ÿ‘‹

If you enjoyed this article...

Join 6.2k readers and learn something new every week with Web Weekly.

Web Weekly โ€” Your friendly Web Dev newsletter
Reply to this post and share your thoughts via good old email.
Stefan standing in the park in front of a green background

About Stefan Judis

Frontend nerd with over ten years of experience, freelance dev, "Today I Learned" blogger, conference speaker, and Open Source maintainer.

Related Topics

Related Articles