Search
Native JavaScript Routing?
23.8.2021
We can update the URL in JavaScript. We’ve got these APIs:
// Adds to browser history
history.pushState({}, "About Page", "/about");
// Doesn't
history.replaceState({}, "About Page", "/about");
JavaScript is also capable of replacing any content in the DOM....
The Big Gotcha With Custom Properties
19.8.2021
I’ve seen this confuse more than a handful of people recently, including myself, so I’m making sure it’s written down.
Let’s chuck a couple of custom properties into CSS:
html {
--color-1: red;
--color-2: blue;
}
Let’s use them right …
The post The...
Using Nuxt and Supabase for a Multi-User Blogging App
19.8.2021
Nuxt is a JavaScript framework that extends the existing functionality of Vue.js with features like server-side rendering, static page generation, file-based routing, and automatic code splitting among other things.
I’ve been enjoying using frameworks like Nuxt and Next because they …
The...
Stay alert
12.8.2021
A few days ago, Chris wrote up his thoughts about how alert(), confirm(), and prompt() were being deprecated by Chrome and collected a bunch of thoughts from developers. If certain features can essentially be turned off by …
The post Stay alert appeared first on CSS-Tricks. You can support...
Poly Network Hacker Says ‘In the Defi World Code Is Law’ While Returning Millions in Defi Tokens
12.8.2021
Two days after the notorious Poly Network hack, the hacker continues to send funds back to the project. On August 12, the Poly Network hacker so far has returned millions worth of ether, thousands of uni tokens, 1,032 wrapped bitcoins, and 96 million in stablecoins. The day prior, after returning...
Wanna see a whiter white?
11.8.2021
Heck of a CSS trick here from Dongsung Kim.
There are hidden HDR videos playing at the corners of this page. When a HDR-capable browser encounters one, it switches to HDR mode. For some reason, CSS backdrop-filter + brightness >100%
…
The post Wanna see a whiter white? appeared first...
CSS Nesting, specificity, and you
10.8.2021
Here’s Kilian Valkhof on CSS nesting which isn’t available in browsers yet, but will be soon. There are a few differences he notes between CSS nesting and nesting in Sass or Less though. Take, for example, the following code:
div
…
The post CSS Nesting, specificity, and you appeared...
'A Code Red for Humanity' and a Reminder for Bitcoin Miners
10.8.2021
Source: Adobe/Андрей Трубицын
The Bitcoin (BTC) mining industry might want to accelerate its transition to green energy sources and decrease the risks of another regulatory pushback as the world’s top climate scientists have stated that "human influence has warmed the climate at a rate that...
Choice Words about the Upcoming Deprecation of JavaScript Dialogs
9.8.2021
It might be the very first thing a lot of people learn in JavaScript:
alert("Hello, World");
One day at CodePen, we woke up to a ton of customer support tickets about their Pens being broken, which ultimately boiled down to …
The post Choice Words about the Upcoming Deprecation of JavaScript...
The Large, Small, and Dynamic Viewports
9.8.2021
We’ve got viewport units (e.g. vw, vh, vmin, vmax), and they are mostly pretty great. It’s cool to always have a unit available that is relative to the entire screen. But when you ask people what …
The post The Large, Small, and Dynamic Viewports appeared first on CSS-Tricks....
Exploring the CSS Paint API: Image Fragmentation Effect
9.8.2021
In my previous article, I created a fragmentation effect using CSS mask and custom properties. It was a neat effect but it has one drawback: it uses a lot of CSS code (generated using Sass). This time I am …
The post Exploring the CSS Paint API: Image Fragmentation Effect appeared first...
SVG Gobbler
6.8.2021
Great little project from Ross Moody:
SVG Gobbler is a browser extension that finds the vector content on the page you’re viewing and gives you the option to download, optimize, copy, view the code, or export it as an image.
…
The post SVG Gobbler appeared first on CSS-Tricks....
gridless.design
6.8.2021
Donnie D’Amato built a whole site around the thesis that “digital designers still expect to use the grid while experienced layout engineers have moved beyond it.” The idea isn’t that we should never literally use display: grid; but rather that …
The post...
Three Buggy React Code Examples and How to Fix Them
5.8.2021
There’s usually more than one way to code a thing in React. And while it’s possible to create the same thing different ways, there may be one or two approaches that technically work “better” than others. I actually run into …
The post Three Buggy React Code Examples and How to Fix Them...
Serverless Functions as Proxies
3.8.2021
The first time cloud functions / serverless functions clicked for me was when I saw and tried Auth0’s (now defunct) Webtask. It was a little CodePen-like IDE but you didn’t really see anything aside from code and logs. The …
The post Serverless Functions as Proxies appeared first...
How to Code a Playable Synth Keyboard
2.8.2021
With a little knowledge of music theory, we can use regular HTML, CSS and JavaScript — without any libraries or audio samples — to create a simple digital instrument. Let’s put that into practice and explore one method for creating …
The post How to Code a Playable Synth Keyboard appeared...
A Shared ESLint Configuration
30.7.2021
Looks like it was almost 9 years ago when Airbnb first published their JavaScript Style Guide. 112k stars on GitHub later, it seems like the de facto preset for Babel / ES Lint. But it’s not the only company …
The post A Shared ESLint Configuration appeared first on CSS-Tricks. You...
South Korea Proposes Law Allowing Direct Seizure and Sale of Crypto Assets to Pay Overdue Taxes
28.7.2021
The South Korean government has proposed an amendment to the tax code to allow the country’s tax authority to seize and sell cryptocurrencies belonging to delinquent taxpayers. “The revision will allow direct seizing without court-approved change in ownership records. Assets held by...
Using Absolute Value, Sign, Rounding and Modulo in CSS Today
28.7.2021
For quite a while now, the CSS spec has included a lot of really useful mathematical functions, such as trigonometric functions (sin(), cos(), tan(), asin(), acos(), atan(), atan2()), exponential functions (…
The post Using Absolute Value, Sign, Rounding and Modulo in CSS Today appeared...
My petite-vue review
23.7.2021
Dave:
petite-vue is a new cut of the Vue project specifically built with progressive enhancement in mind. At 5kb, petite-vue is a lightweight Alpine (or jQuery) alternative that can be “sprinkled” over your project requiring no extra bundling steps
…
The post My petite-vue...