Search
Additive Animations in CSS
3.11.2020
Daniel C. Wilson explains how with CSS @keyframe animations, when multiple of them are applied to an element, they do both work. But if any properties are repeated, only the last one works. They override each other. I’ve seen this limitation overcome by applying keyframes to nested elements...
The CSS Custom Property Toggle Trick
29.10.2020
Back in July 2020, I got an email from James0x57 (I always try to refer to people by their name, but I think I get the sense they prefer to go by screen name) that says:
The entire world of branching conditional logic and bulk feature toggling for custom CSS properties is possible and only exists...
Creating CSS Shapes with Emoji
24.10.2020
CSS Shapes is a standard that lets us create geometric shapes over floated elements that cause the inline contents — usually text — around those elements to wrap along the specified shapes.
Such a shaped flow of text looks good in editorial designs or designs that work with text-heavy contents...
Mastermind of Alleged Billion Dollar Spanish Pyramid Scheme Arrested, Faces 16 Year Prison Sentence
23.10.2020
The CEO of Arbistar the Spanish investment company, Santiago Fuentes, has been arrested and arraigned on charges of fraud, belonging to a criminal organization and money laundering. Fuentes, who has been in hiding since September, was arrested at one of his properties in the south of Tenerife....
Announcing the 2020 State of CSS Survey
20.10.2020
Last year’s State of CSS Survey yielded interesting results. There’s the quick adoption of features, like calc() and CSS custom properties. There’s also the overwhelming opinion that CSS is fun to write even as we see a growing reliance on CSS-in JS. We also saw some predictable...
How to Conditionally Add Attributes to Objects
16.10.2020
JavaScript is full of tricks that you don’t know you want until you … want … them. Or maybe just until you see them. One trick I recently realized was conditionally adding attributes to React elements. Of course this trick essentially boils down to conditionally adding properties...
Shoelace 2.0: A Forward-thinking Library of Web Components
29.9.2020
A few years ago, I released a lightweight alternative to Bootstrap affectionately named Shoelace. Shoelace was small and fast because of its minimal design and pure CSS approach to styling. It used CSS custom properties extensively to enable customizations, even when loaded via CDN — something...
Using @property for CSS Custom Properties
3.9.2020
Una Kravetz digs into how Chrome now allows you to declare CSS custom properties directly from CSS with more information than just a string.
So rather than something like this:
html {
--stop: 50%;
}
…can be declared with more details like this:
@property --stop {
syntax:...
How to Use CSS Grid for Sticky Headers and Footers
2.9.2020
CSS Grid is a collection of properties designed to make layout easier than it’s ever been. Like anything, there’s a bit of a learning curve, but Grid is honestly fun to work with once you get the hang of it. One area where it shines is dealing with headers and footers. With a little...
Can you get valid CSS property values from the browser?
19.8.2020
I had someone write in with this very legit question. Lea just blogged about how you can get valid CSS properties themselves from the browser. That’s like this.
CodePen Embed Fallback
That gives you, for example, the fact that cursor is a thing. But then how do you know what valid values...
Timer Bars in CSS with Custom Properties
18.8.2020
I was working on a thing the other day that needed a visible timer. There was UI precedent for this type of timer on the project. People didn’t want to see numbers ticking downward; it was more ideal to see a “bar” drain away from full to empty. I mention that because there...
The Cicada Principle, revisited with CSS variables
5.8.2020
Lea Verou digging up the CSS trickery classic and applying it to clip the backgrounds of some code blocks:
The main idea is simple: You write your main rule using CSS variables, and then use :nth-of-*() rules to set these variables to something different every N items. If you use enough...
Using Flexbox and text ellipsis together
22.7.2020
You can truncate a single line of text with an ellipsis (…) fairly easily with text-overflow and a few friends. But, as you might expect, that truncation happens at the end of the line of text. What if you want to truncate content in the middle?
Leonardo Faria details good use cases for this...
Backdrop Filter effect with CSS
16.7.2020
I love these little posts where some tricky-looking design is solved by a single line of CSS using a little-known property. In this case, the design is a frosted glass effect and the CSS property is backdrop-filter.
The approach? Easy peasy:
.container {
backdrop-filter: blur(10px);
}
The...
Displaying the Current Step with CSS Counters
8.7.2020
Say you have five buttons. Each button is a step. If you click on the fourth button, you’re on step 4 of 5, and you want to display that.
This kind of counting and displaying could be hard-coded, but that’s no fun. JavaScript could do this job as well. But CSS? Hmmmm. Can it? CSS...
Bootstrap 5
7.7.2020
It’s always notable when the world biggest CSS framework goes up a major version (it’s in alpha now).
It has dropped jQuery and IE, started using some CSS custom properties, gone fully customized with form elements, started to embrace utility classes, and includes a massive icon...
700,000 Expedia Hotels Can Now Be Paid With Cryptocurrencies via Travala
6.7.2020
More than 700,000 Expedia Group hotels and accommodations are now available via crypto-friendly travel booking platform Travala. Bookings can be paid with more than 30 cryptocurrencies, including bitcoin. Despite covid-19, Travala saw a 170% increase in booking revenue from its 2 million properties...
Global and Component Style Settings with CSS Variables
1.7.2020
The title of this Sara Soueidan article speaks to me. I’m a big fan of the idea that some CSS is best applied globally, and some CSS is best applied scoped to a component. I’m less interested in how that is done and more interested in just seeing that conceptual approach used in some...
When Sass and New CSS Features Collide
29.6.2020
Recently, CSS has added a lot of new cool features such as custom properties and new functions. While these things can make our lives a lot easier, they can also end up interacting with preprocessors, like Sass, in funny ways.
So this is going to be a post about the issues I’ve encountered...
US Real Estate Market Crisis: 4.3 Million Mortgage Delinquencies, Commercial Properties Sink in Value
27.6.2020
The U.S. economy continues to look bleak as the American citizens and small businesses nationwide struggle to keep up with the government’s rules toward Covid-19 guidelines. In just 13 weeks, over 45 million Americans filed for unemployment benefits and many citizens cannot pay their...