Like Cirrus 0.6.0, 0.7.0 was another large undertaking that brought a large refactor of the entire codebase to prioritize configurability and enhance overall developer experience. This rewrite represents the first step in how Cirrus is repositioning as a component-and-utility-centric SCSS framework.
There are a ton of things that were added in this new update, but below are a few big ones I want to highlight. For a full list, please visit the release notes to learn more.
With previous versions, the only ways to use Cirrus was to either linking the CDN link at the top of your page or importing cirrus-ui into your Node project.
This is fine, but it lacked any sort of customization. The only way to change Cirrus was to clone the project and build your own version locally. Dart Sass has given me immense opportunity to improve Cirrus's usability and fix technical debt and hacks. One of the things it also enabled was directly importing Cirrus into your Sass/Scss project directly.
Not only can you import different pre-configured versions of Cirrus, but also take advantage of all the functions, mixins, constants, etc. that Cirrus comes built with.
// main.scss@use "cirrus-ui/cirrus-core" as *;// Core build OR@use "cirrus-ui/src/cirrus-ext" as *;// Extended build@screen-above($md){.my-class {background-color:rgba(#{hex-to-rgb(fill('blue','600'))},.25);}}
No more having to build Cirrus separately and then copying and pasting the generated styles to your project. Read more on this here.
One of the things this rewrite aimed to accomplish was configurability. In the past, CSS frameworks were just things we plop into our project and we either accepted styles it gave us or we spent countless hours overriding them to fit our needs. Why should we continue to subject ourselves to that amount of torture?
0.7.0 marks a big step in dynamic class generation. Whether you are building Cirrus locally or you're importing Cirrus directly into your Sass files, you can take advantage of defining a configuration object in both scenarios when you import the framework. Use the configuration object to specify viewports for classes, extend existing component and utility styles, toggle features, and more.
@use "cirrus-ui/src/cirrus-ext" as * with ($config:(excludes:( ABSOLUTES,),opacity:null,// Disable default opacity classesextend:(// Add your ownopacity:(25:.25,50:.5,75:.75,))),);
Currently most utility classes and components can be customized through here in this release, but I hope to extend this capability a lot more in future updates. Read more on this here.