Static initialization blocks in JavaScript classes (#tilPost)
Stefan Judis Blog
by Stefan Judis
4d ago
I've been reading Jake's guide on custom elements and when/where to define a new custom element. It's a good and quick read, so go check it out! His final custom element snippet includes something I haven't seen before. class MyElement extends HTMLElement { // Static class property static tag = "my-element"; // Static class method static define(tag = this.tag) { // ... } // ? What's this is? static { // ... } } The class defines two static class members. One is a class property (tag), and the other is a class method (define). Both static class members can be called ..read more
Visit website
Use "translate" to turn off element translations (#tilPost)
Stefan Judis Blog
by Stefan Judis
1w ago
I just discovered an HTML attribute I haven't seen in my 15y of web development — translate. If certain elements are untranslatable, you can use the translate HTML attribute to opt out of automatic localization and signal browsers not to touch them. When would that be useful? I could come up with a made-up example, but let's just look at Cory House's website and translate it to German using Google Chrome. The translation isn't really good. "About" becomes "Um", which doesn't make sense in German, but the translation has a bigger issue. Cory's name was translated, too. The English House ..read more
Visit website
Web Weekly #147 (#blogPost)
Stefan Judis Blog
by Stefan Judis
1w ago
Frohes Neues! ? Do you know when forms are automatically submitted on ENTER key press? Or have you heard of Chrome's and Safari's tight mode? Oooooor should you replace your reduce function with Object.groupBy? Turn on the Web Weekly tune and find all the answers below. Enjoy! Mario listens to "Bolt Thrower — The Killchain": The Killchain is my energizer, when things need to be done! Although it´s Death Metal, it´s very groovy. Do you want to share your favorite song with the Web Weekly community? Hit reply; there is only one more song left in the queue. You might have noticed that Web W ..read more
Visit website
Default Apps 2024 (#blogPost)
Stefan Judis Blog
by Stefan Judis
1w ago
There've been some folks sharing their 2024 default apps; let me join the fun! Heads up! Some of this post's links are affiliate links. If this rubs you the wrong way, it's probably not for you. ? Browsers My daily driver remains Firefox. Not because it's the best or fastest browser but because I still want Mozilla to play a role in this world. It's not looking good, though (Firefox is currently down to 6% global desktop market share)... I tried the new Zen browser a few times (it's a Firefox with some UX sprinkles), but it still seems rough around the edges. Because I'm such a bad tab hoa ..read more
Visit website
Duplicated CSS @keyframes properties are valid (#tilPost)
Stefan Judis Blog
by Stefan Judis
2w ago
I'm not a big @keyframes user because I'm not good at manually creating animations. Trust me — I tried to become an animation virtuoso, but my animations failed to deliver the UI delight I imagined. So, I accepted my destiny and stopped looking into complex @keyframes animations. But apparently I'm missing out on some things. Here's Ryan with some @keyframes facts: CSS is cool with duplicate keyframe properties CSS allows the keyframe properties to have a random order CSS can apply custom easings for each keyframe ruleset All these facts can be valuable, but the first one will even make it ..read more
Visit website
To blog something to show (#note)
Stefan Judis Blog
by Stefan Judis
3w ago
Here's Simon Willison explaining his approach to link blogging. If you haven't heard of link blogging, it's social media's worst enemy. Instead of feeding third-party platforms with your thoughts and relying on algorithms for people to discover them, you post links on your corner of the internet (aka your website). The world can then follow your updates via RSS. You might be surprised how much your RSS feed can feel like if you subscribe to enough link blogs. But what if no one is following or reading along? What value do link posts have in your hidden internet corner? There's a saying that e ..read more
Visit website
Web Weekly #146 (#blogPost)
Stefan Judis Blog
by Stefan Judis
1M ago
Guten Tag! Guten Tag! ? Are you aware that the ::details-content pseudo-element is coming to the web? Or have you used the Picture in Picture API already? And do you know that emojis have different meanings in the world? Turn on the Web Weekly tune and find all the answers below. Enjoy! Carlos listens to "Yann Tiersen -- Bagatelle (feat. Dominique A) -- L'Absente": I hadn't heard it for a long time and had forgotten how wonderful and emotional it is, almost like a sung poem. Do you want to share your favorite song with the Web Weekly community? Hit reply; there is only one more song left ..read more
Visit website
Hide object properties with JavaScript symbols (#tilPost)
Stefan Judis Blog
by Stefan Judis
2M ago
I've just read Exploring JavaScript Symbols, and it's quite good. It includes a tiny JavaScript nugget that I wasn't very aware of. JS symbols are an underrated language feature that I probably should use for more things. And let alone the nicely nerdy well-known symbols that help you to really understand how JavaScript works under the hood. One of these symbol use cases is hiding properties in a good old JavaScript objects. const lastTouched = Symbol('lastTouched'); const record = { name: 'schnitzel' // use a symbol as a property key to hide the // property from "standard" object op ..read more
Visit website
How to open a local file from the URL bar in VS Code (#tilPost)
Stefan Judis Blog
by Stefan Judis
2M ago
I just discovered the React component click-to-component. The component adds a visual overlay to your React application, allowing you to click on an element and jump right into your code base. Magic! Obviously, there's some bundling and build magic involved to figure out the component file path, but I wondered how it opens the editor. Is the running server some shell commands? Nope. All it does is open a URL with the editor's protocol. Here's an example URL that opens a file of my site. vscode://file/Users/stefanjudis/Projects/github.com/stefanjudis/stefanjudis-website/index.html Pretty coo ..read more
Visit website
Web Weekly #145 (#blogPost)
Stefan Judis Blog
by Stefan Judis
2M ago
Guten Tag! Guten Tag! ? Have you heard of width: stretch? Do you include baseline widgets on your blog? And do you optimize your sites' network waterfall with fetchpriority? Turn on the Web Weekly tune and find the usual web dev goodness below. Enjoy! Christopher listens to "Flume - SKY SKY 1.3" I love the typical Flume style and the beginning of the singing which makes me always smile. It never fails to make me happy! Do you want to share your favorite song with the Web Weekly community? Hit reply; there is only one more song left in the queue. ? Do you use CSS resets? I admit I'm usual ..read more
Visit website

Follow Stefan Judis Blog on FeedSpot

Continue with Google
Continue with Apple
OR