Search
How to Convert a Date String into a Human-Readable Format
25.5.2020
I’ll be the first to admit that I’m writing this article, in part, because it’s something I look up often and want to be able to find it next time. Formatting a date string that you get from an API in JavaScript can take many shapes — anything from loading all of Moment.js to have...
“The Modern Web”
22.5.2020
A couple of interesting articles making the rounds:
Tom MacWrite: Second-guessing the modern web
Rich Harris: In defense of the modern web
I like Tom’s assertion that React (which he’s using as a stand-in for JavaScript frameworks in general) has an ideal usage:
There is a sweet spot...
Avoid Heavy Babel Transformations by (Sometimes) Not Writing Modern JavaScript
20.5.2020
It’s hard to imagine writing production-ready JavaScript without a tool like Babel. It’s been an undisputed game-changer in making modern code accessible to a wide range of users. With this challenge largely out of the way, there’s not much holding us back from really leaning into...
User agents
19.5.2020
Jeremy beating the classic drum:
For web development, start with HTML, then CSS, then JavaScript (and don’t move on to JavaScript too quickly—really get to grips with HTML and CSS first).
And then…
That’s assuming you want to be a good well-rounded web developer. But it might be that...
Pseudo-elements in the Web Animations API
14.5.2020
To use the Web Animations API (e.g. el.animate()) you need a reference to a DOM element to target. So, how do you use it on pseudo-elements, which don’t really offer a direct reference? Dan Wilson covers a (newish?) part of the API itself:
const logo...
Dealing With Stale Props and States in React’s Functional Components
12.5.2020
There’s one aspect of JavaScript that always has me pulling my hair: closures. I work with React a lot, and the overlap there is that they can sometimes be the cause of stale props and state. We’ll get into exactly what that means, but the trouble is that the data we use to build our UI can...
How I Put the Scroll Percentage in the Browser Title Bar
12.5.2020
Some nice trickery from Knut Melvær.
Ultimately the trick boils down to figuring out how far you’ve scrolled on the page and changing the title to show it, like:
document.title = `${percent}% ${post.title}`
Knut’s trick assumes React and installing an additional library. I’m sure...
10 Interesting JavaScript and CSS Libraries for May 2020
11.5.2020
A collection of our favorite web dev resources for the month of May, featuring useful JS tools, React components, and more!
Let’s Take a Deep Dive Into the CSS Contain Property
8.5.2020
Compared to the past, modern browsers have become really efficient at rendering the tangled web of HTML, CSS, and JavaScript code a typical webpage provides. It takes a mere milliseconds to render the code we give it into something people can use.
What could we, as front-end developers, do...
Making dark theme switcher with PostCSS.
7.5.2020
Building a dark theme switcher that take care of users OS preferences.
The post Making dark theme switcher with PostCSS. appeared first on CSS-Tricks
Static Hoisting
6.5.2020
The other day in “Static or not?” I said:
[…] serving HTML from a CDN is some feat.
What I meant is that serving resources like images, CSS, and JavaScript from a CDN is fairly straightforward. The industry at large has been doing that for many years. An asset with a URL can...
How to Create Custom WordPress Editor Blocks in 2020
6.5.2020
Peter Tasker on creating blocks right now:
It’s fairly straightforward these days to get set up with the WP CLI ‘scaffold’ command. This command will set up a WordPress theme or plugin with a ‘blocks’ folder that contains the PHP and base CSS and JavaScript required to create...
How to Fix ESLint Errors Upon Save in VS Code
6.5.2020
Two of the most prominent utilities in web development today are ESLint and Microsoft’s Visual Studio Code. I enjoy using both, and I love the integration between both tools, but warnings from ESLint inside Visual Studio Code aren’t fulfilling — I’d rather lint errors...
The Anatomy of a Tablist Component in Vanilla JavaScript Versus React
5.5.2020
If you follow the undercurrent of the JavaScript community, there seems to be a divide as of late. It goes back over a decade. Really, this sort of strife has always been. Perhaps it is human nature.
Whenever a popular framework gains traction, you inevitably see people comparing it to rivals....
Angular + Jamstack! (Free Webinar)
5.5.2020
(This is a sponsored post.)
It’s easy to think that working with Jamstack means working with some specific set of technologies. That’s how it’s traditionally been packaged for us. Think LAMP stack, where Linux, Apache, MySQL and PHP are explicit tools and languages. or MEAN...
Phuoc Nguyen’s One Page Wonders
2.5.2020
I keep running across these super useful one page sites, and they keep being by the same person! Like this one with over 100 vanilla JavaScript DOM manipulation recipes, this similar one full of one-liners, and this one with loads of layouts. For that last one, making 91 icons for all those design...
React Integration Testing: Greater Coverage, Fewer Tests
1.5.2020
Integration tests are a natural fit for interactive websites, like ones you might build with React. They validate how a user interacts with your app without the overhead of end-to-end testing. 
This article follows an exercise that starts with a simple website, validates behavior with unit...
IMA.js – Načítání a vykreslování dat
29.4.2020
V předchozím díle jsme si zajistili data pro naši aplikaci a jejich zpracování pomocí modelů. Nyní můžeme začít s jejich zobrazováním
Alpine.js: The JavaScript Framework That’s Used Like jQuery, Written Like Vue, and Inspired by TailwindCSS
29.4.2020
We have big JavaScript frameworks that tons of people already use and like, including React, Vue, Angular, and Svelte. Do we need another JavaScript library? Let’s take a look at Alpine.js and you can decide for yourself. Alpine.js is for developers who aren’t looking to build a single page...
The Cost of Javascript Frameworks
26.4.2020
I expect this post from Tim Kadlec to be quoted in every performance conference talk for the next few years. There is a lot of data here, so please check it out for yourself, but the short story is that JavaScript-framework-powered sites are definitely heavier and more resource-intensive than...