Search
The Fixed Background Attachment Hack
27.8.2021
What options do you have if you want the body background in a fixed position where it stays put on scroll? background-attachment: fixed in CSS, at best, does not work well in mobile browsers, and at worst is not even …
The post The Fixed Background Attachment Hack appeared first...
World Of Warships Employee Suspended After Sending Abusive Message In Promo Code
27.8.2021
This has not been a good month for World of Warships! Then again, running a shady monetisation scheme then having employees send an insulting message to a prominent streamer will do that to a game.Read more
Some Articles About Accessibility I’ve Saved Recently III
26.8.2021
The perfect link — Rian Rietveld defines them: “When you click on them, they take you somewhere else.” Not much code in here (we’ve got that), just a lot of practical accessibility advice. For example, the alt text
…
The post Some Articles About Accessibility I’ve Saved...
One Way to Convert Code Indentation
26.8.2021
A question:
If you copy a code sample that uses two-space indentation and you want to convert it to four-space indentation, what’s the *fastest* and easiest option?
Matt Stauffer, Twitter
I wrote about doing this in Sublime Text a …
The post One Way to Convert Code Indentation...
Introduction to the Solid JavaScript Library
24.8.2021
Solid is a reactive JavaScript library for creating user interfaces without a virtual DOM. It compiles templates down to real DOM nodes once and wraps updates in fine-grained reactions so that when state updates, only the related code runs.
This …
The post Introduction to the Solid...
Detecting Media Query Support in CSS and JavaScript
23.8.2021
You can’t just do @media (prefers-reduced-data: no-preference) alone because, as Kilian Valkhof says:
[…] that would be false if either there was no support (since the browser wouldn’t understand the media query) or if it was supported but the
…
The post...
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...