Search
Efficient Infinite Utility Helpers Using Inline CSS Custom Properties and calc()
6.8.2021
I recently wrote a very basic Sass loop that outputs several padding and margin utility classes. Nothing fancy, really, just a Sass map with 11 spacing values, looped over to create classes for both padding and margin on each side. …
The post Efficient Infinite Utility Helpers Using Inline...
Creating a Maintainable Icon System with Sass
28.8.2019
One of my favorite ways of adding icons to a site is by including them as data URL background images to pseudo-elements (e.g. ::after) in my CSS. This technique offers several advantages:
They don't require any additional HTTP requests other than the CSS file.
Using the background-size property...
Do CSS Custom Properties Beat Sass Loops?
2.3.2019
I reckon that a lot of our uses of Sass maps can be replaced with CSS Custom properties – but hear me out for a sec.
When designing components we often need to use the same structure of a component but change its background or text color based on a theme. For example, in an alert, we might need...