Search
Rotated Table Column Headers… Now With Fewer Magic Numbers!
1.6.2020
Rotated <table> column headers is something that’s been covered before right here on CSS-Tricks, so shout-out to that for getting me started and helping me achieve this effect. As the article points out, if you aren’t using trigonometry to calculate your table styles, you’ll have to rely...
Overlapping Header with CSS Grid
1.6.2020
Snook shows off a classic design with an oversized header up top, and a content area that is “pulled up” into that header area. My mind goes to the same place:
Historically, I’ve done this with negative margins. The header has a height that adds a bunch of padding to the bottom...
China Passes Law Protecting Cryptocurrency Inheritance
30.5.2020
China has passed the country’s long-awaited civil code which expands the scope of inheritance rights to include cryptocurrency, such as bitcoin. Inherited cryptocurrencies will be protected under the new law. Meanwhile, several Chinese courts have recently ruled that bitcoin and ethereum...
Global CSS options with custom properties
30.5.2020
With a preprocessor, like Sass, building a logical “do this or don’t” setting is fairly straightforward:
$option: false;
@mixin doThing {
@if $option {
do-thing: yep;
}
}
.el {
@include doThing;
}
Can we do that in native CSS with custom properties? Mark Otto shows...
A First Look at `aspect-ratio`
29.5.2020
Oh hey! A brand new property that affects how a box is sized! That’s a big deal. There are lots of ways already to make an aspect-ratio sized box (and I’d say this custom properties based solution is the best), but none of them are particularly intuitive and certainly not...
Background Patterns, Simplified by Conic Gradients
28.5.2020
For those who have missed the big news, Firefox now supports conic gradients!
Starting with Firefox 75, released on the April 7, we can go to about:config, look for the layout.css.conic-gradient.enabled flag and set its value to true (it’s false by default and all it takes to switch...
The Many Bad (and Good!) Patterns for Close Buttons
27.5.2020
Manuel Matuzović details 10 bad HTML patterns for a close button. You know, stuff like this:
<a class="close" onclick="close()"×</a
Why is that bad? There is no href there, so it really isn’t a link (close buttons aren’t links). Not to mention the missing href makes this...
The Fastest Google Fonts
22.5.2020
When you use font-display: swap;, which Google Fonts does when you use the default &display=swap part of the URL , you’re already saying, “I’m cool with FOUT,” which is another way of saying web text is displayed right away, and when the web font is ready...
A “new direction” in the struggle against rightward scrolling
21.5.2020
You know those times you get a horizontal scrollbar when accidentally placing an element off the right edge of the browser window? It might be a menu that slides in or the like. Sometimes we to overflow-x: hidden; on the body to fix that, but that can sometimes wreck stuff like position:...
Flexbox-like “just put elements in a row” with CSS grid
21.5.2020
It occurred to me while we were talking about flexbox and gap that one reason we sometimes reach for flexbox is to chuck some boxes in a row and space them out a little.
My brain still reaches for flexbox in that situation, and with gap, it probably will continue to do so. It’s worth noting...
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...
Bitcoin-Backed Ethereum Token tBTC Paused Due to Poorly Tested Redemption Code
20.5.2020
A bug in tBTC meant the dapp couldn't tell different bitcoin addresses apart, the team has disclosed
Unprefixed `appearance `
18.5.2020
It’s interesting how third-parties are sometimes super involved in pushing browser things forward. One big story there was how Bloomberg hired Igalia to implement CSS grid across the browsers.
Here’s another story of Bocoup doing that, this time for the appearance property. The story...
CSS fix for 100vh in mobile WebKit
15.5.2020
A surprisingly common response when asking people about things they’d fix about anything in CSS, is to improve the handling of viewport units.
One thing that comes up often is how they relate to scrollbars. For example, if an element is sized to 100vw and stretches edge-to-edge, that’s...
Offscreen Text for Copy & Paste
15.5.2020
The relationship between HTML and CSS is special: mixing content via HTML with presentation from CSS to make an awesome presentation. Sometimes, however, you need to employ CSS tricks solely to enhance functionality. This could be one of those cases. When browsing through the Firefox DevTools...
How to Tame Line Height in CSS
15.5.2020
In CSS, line-height is probably one of the most misunderstood, yet commonly-used attributes. As designers and developers, when we think about line-height, we might think about the concept of leading from print design — a term, interestingly enough, that comes from literally putting pieces of lead...
Online Together
14.5.2020
(This is a sponsored post.)
An Event Apart: Online Together is a single-day online conference with an intense focus on digital design, UX, content, code, and more, giving you deep insights into where we are now and where things are going next.
AEA! With a brand new online version of their...
Equal Width Columns in CSS Grid are Kinda Weird
14.5.2020
Everything is flexible these days. If you write grid-template-columns: 200px 200px 200px;, sure, you’d have equal-width columns, but that’s a rare day. What you usually mean is three columns of equal fluid width.
We’ve got fractional units for that, like grid-template-columns:...
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...
Using CSS Masks to Create Jagged Edges
12.5.2020
I was working on a project that had this neat jagged edge along the bottom of a banner image.
Looking sharp… in more ways than one.
It’s something that made me think for a second and I learned something in the process! I thought I’d write up how I approached it so you can use it on your...