Search
CSS Functions and Mixins Module Notes
31.7.2024
Most days, I’m writing vanilla CSS. Thanks to CSS variables and nesting, I have fewer reasons to reach for Sass or any other preprocessor. The times I reach for Sass tend to be when I need a @mixin to loop …
CSS Functions and Mixins Module Notes originally published on CSS-Tricks...
State of CSS 2022 Survey Now Open
4.10.2022
The State of CSS survey recently opened up. Last year, the survey confirmed everyone’s assumptions that TailwindCSS is super popular and CSS variables are mainstream. It also codified what many of us want from CSS, from Container Queries to …
State of CSS 2022 Survey Now Open...
Interpolating Numeric CSS Variables
30.8.2022
We can make variables in CSS pretty easily:
:root {
--scale: 1;
}
And we can declare them on any element:
.thing {
transform: scale(--scale);
}
Even better for an example like this is applying the variable on a user …
Interpolating Numeric CSS Variables originally published...
Quick and Dirty Bootstrap Overrides at Runtime
10.11.2021
Oh, Bootstrap, that old standard web library that either you hate or you spend all your time defending as “it’s fine, it’s not that bad.” Regardless of what side you fall on, it’s a powerful UI framework that’s everywhere, …
The post Quick and Dirty Bootstrap Overrides at Runtime appeared...
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...
A Complete Guide to Custom Properties
27.4.2021
Everything important and useful to know about CSS Custom Properties. Like that they are often referred to as "CSS Variables" but that's not their real name.
The post A Complete Guide to Custom Properties appeared first on CSS-Tricks.
You can support CSS-Tricks by being an MVP Supporter
Platform News: Rounded Outlines, GPU-Accelerated SVG Animations, How CSS Variables Are Resolved
2.4.2021
In the news this week, Firefox gets rounded outlines, SVG animations are now GPU-accelerated in Chrome, there are no physical units in CSS, The New York Times crossword is accessible, and CSS variables are resolved before the value is inherited.…
The post Platform News: Rounded Outlines...
Want to Write a Hover Effect With Inline CSS? Use CSS Variables.
26.3.2021
The other day I was working on a blog where each post has a custom color attached to it for a little dose of personality. The author gets to pick that color in the CMS when they’re writing the post. …
The post Want to Write a Hover Effect With Inline CSS? Use CSS Variables. appeared first...
Use CSS Variables instead of React Context
19.2.2021
Turns out you can use several different libraries to pass color information around components. Or, you could use custom properties, built right into CSS, have no decline in your own developer experience, and deliver a faster experience to your users. …
The post Use CSS Variables instead...
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...
Collective #626
8.10.2020
With Code * CSS Grid full-bleed layout tutorial * Why Tailwind CSS * CSS Variables 101
The post Collective #626 appeared first on Codrops
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...
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...
Collective #608
4.6.2020
ScrollTrigger * A user’s guide to CSS variables * Twin * CUBE CSS * Consoleimg * Colors in CSS
The post Collective #608 appeared first on Codrops
Making dark theme switcher with PostCSS.
7.5.2020
Building a dark theme switcher that take care of users OS preferences.
The post Making dark theme switcher with PostCSS. appeared first on CSS-Tricks
How to Make a Line Chart With CSS
11.3.2020
Line,  bar, and pie charts are the bread and butter of dashboards and are the basic components of any data visualization toolkit. Sure, you can use SVG or a JavaScript chart library like Chart.js or a complex tool like D3 to create those charts, but what if you don't want to load yet another...
Use and Reuse Everything in SVG… Even Animations!
28.1.2020
If you are familiar with SVG and CSS animations and started to work with them often, here are some ideas you might want to keep in mind before jumping into the job. This article will be about learning how to build and optimize your code with <use> element, CSS Variables and...
Multi-Thumb Sliders: General Case
8.1.2020
The first part of this two-part series detailed how we can get a two-thumb slider. Now we'll look at a general multi-thumb case, but with a different and better technique for creating the fills in between the thumbs. And finally, we'll dive into the how behind the styling a realistic 3D-looking...
Multi-Thumb Sliders: Particular Two-Thumb Case
7.1.2020
This is a concept I first came across a few years back when Lea Verou wrote an article on it. Multi-range sliders have sadly been removed from the spec since, but something else that has happened in the meanwhile is that CSS got better — and so have I, so I recently decided to make my...