Search
Web Frameworks: Why You Don’t Always Need Them
10.3.2021
Richard MacManus explaining Daniel Kehoe’s approach to building websites:
There are three key web technologies underpinning Kehoe’s approach:
ES6 Modules: JavaScript ES6 can support import modules, which are also supported by browsers.
Module CDNs: JavaScript modules can now
…
The...
A Super Flexible CSS Carousel, Enhanced With JavaScript Navigation
5.3.2021
Not sure about you, but I often wonder how to build a carousel component in such a way that you can easily dump a bunch of items into the component and get a nice working carousel — one that allows …
The post A Super Flexible CSS Carousel, Enhanced With JavaScript Navigation appeared first...
How to Map Mouse Position in CSS
1.3.2021
Let’s look at how to get the user’s mouse position and map it into CSS custom properties: --positionX and --positionY.
We could do this in JavaScript. If we did, we could do things like make make an element …
The post How to Map Mouse Position in CSS appeared first on CSS-Tricks.
You...
SmolCSS
24.2.2021
A wonderful collection of little layout-related CSS snippets from Stephanie Eckles that serves both as a quick reference and a reminder of how straightforward and powerful CSS has become.
Random things to note!
The resizeable containers aren’t some JavaScript library.
…
The post...
React Component Tests for Humans
23.2.2021
React component tests should be interesting, straightforward, and easy for a human to build and maintain.
Yet, the current state of the testing library ecosystem is not sufficient to motivate developers to write consistent JavaScript tests for React components. Testing …
The post React...
How to Create a Shrinking Header on Scroll Without JavaScript
16.2.2021
Imagine a header of a website that is nice and thick, with plenty of padding on top and bottom of the content. As you scroll down, it shrinks up on itself, reducing some of that padding, making more screen real …
The post How to Create a Shrinking Header on Scroll Without JavaScript appeared...
Lazy Load Routes in Vue with webpack Dynamic Comments
4.2.2021
The way routing works in JavaScript is usually that you specify which relative URL pattern you want for which component to render. So for /about you want the <About /> component to render. Let’s take a look at how to …
The post Lazy Load Routes in Vue with webpack Dynamic Comments...
Začněte používat ECMAScript moduly v Node.js už dnes
27.1.2021
Proč jsou ECMAScript moduly lepší než CommonJS? Už nastal ten správný čas přepsat všechny své NPM balíčky na ECMAScript moduly?
Začněte používat ECMAScript moduly v Node.js už dnes
27.1.2021
Proč jsou ECMAScript moduly lepší než CommonJS? Už nastal ten správný čas přepsat všechny své NPM balíčky na ECMAScript moduly?
JavaScript Wake Lock API
25.1.2021
An enjoyable web apps rely on engineers implementing the APIs that cover all of the small things. Those small things sometimes improve performance, usability, accessibility, and the app’s relationship with its host system. The Wake Lock API is the latter — an API that allows developers...
Servers: Cool Once Again
22.1.2021
There were jokes coming back from the holiday break that JavaScript decided to go all server-side. I think it was rooted in:
The Basecamp gang releasing Hotwire, which looks like marketing panache around a combination of technologies. “HTML over
…
The post Servers: Cool Once Again...
How to Play and Pause CSS Animations with CSS Custom Properties
21.1.2021
Let’s have a look CSS @keyframes animations, and specifically about how you can pause and otherwise control them. There is a CSS property specifically for it, that can be controlled with JavaScript, but there is plenty of nuance to get …
The post How to Play and Pause CSS Animations with...
Lightweight Form Validation with Alpine.js and Iodine.js
20.1.2021
Many users these days expect instant feedback in form validation. How do you achieve this level of interactivity when you’re building a small static site or a server-rendered Rails or Laravel app? Alpine.js and Iodine.js are two minimal JavaScript …
The post Lightweight Form Validation with...
Life with ESM
19.1.2021
ESM, meaning ES Modules, meaning JavaScript Modules. Like, import and friends.
Browsers support it these days. There is plenty of nuance, but as long as you’ve dropped IE, the door is fairly open.
Before ESM, the situation for JavaScript …
The post Life with ESM appeared first...
State of JavaScript 2020
18.1.2021
We rounded up a bunch of published 2020 annual reports right before the year ended and compiled them into a big ol’ list. The end of the list called out a couple of in-progress surveys, one of which was …
The post State of JavaScript 2020 appeared first on CSS-Tricks.
You can support...
Collective #644
14.1.2021
Front-End Performance Checklist * Bringing Spacer GIFs Back * Three-projected-material * 2020 JavaScript Rising Stars
The post Collective #644 appeared first on Codrops
Dynamic, Conditional Imports
13.1.2021
With ES Modules, you can natively import other JavaScript. Like confetti, duh:
import confetti from 'https://cdn.skypack.dev/canvas-confetti';
confetti();
That import statement is just gonna run. There is a pattern to do it conditionally though. It’s like this:
(async ()
…
The post...
Fading in a Page on Load with CSS & JavaScript
13.1.2021
Louis Lazaris demonstrates a very simple way of doing this.
Hide the body (with JavaScript) right away with opacity: 0
Wait for all the JavaScript to execute
Unhide the body by transitioning it back to opacity: 1
Like this:
CodePen…
The post Fading in a Page on Load with CSS &...
Two Issues Styling the Details Element and How to Solve Them
13.1.2021
In the not-too-distant past, even basic accordion-like interactions required JavaScript event listeners or some CSS… trickery. And, depending on the solution used, editing the underlying HTML could get complicated.
Now, the <details> and <summary> elements (which combine to form...
navigator.clipboard API
11.1.2021
Interacting with a user’s host clipboard is something web developers have wanted for both good and evil purposes. On the good side, it’s nice to allow users to easily copy text like wallet addresses or branch names; for evil, copying malicious text that the user may mistakenly paste...