-
Notifications
You must be signed in to change notification settings - Fork 11
How to migrate from v1 to v2
Cooltipz.css v2 comes with an important update to the way we use Sass. If you are only using the .css of Cooltipz.css and you are not using the Sass of Cooltipz.css, then v2 will have no impact and no breaking changes to you and you can safely upgrade to v2 with no additional fuss.
Firstly, Sass have deprecated the node-sass package. So we have migrated to use sass and have dropped all support for node-sass.
Secondly, we refactored the project to replace the @import at-rule with the @use at-rule. We did this because Sass are deprecating the use of @import.
So what does this mean for you?
Well, this will only cause a breaking change for you if you are overriding any of the Cooltipz.css Sass !default variables, as described in the above point. If you are not overriding any of these using Sass, you can carry on using @import "~cooltipz-css/src/cooltipz"; exactly as you were before and you can safely upgrade to v2 without any more setup.
However, if you are overriding the !default Sass variables, then it is likely you are currently doing something like this:
$cooltipz-bg-color: #fff;
$cooltipz-font-size: 24px;
@import "~cooltipz-css/src/cooltipz";The above code will work with cooltipz-css@1.x because you are defining the variables before importing cooltipz-css, which means they get overridden. However, the new @use syntax in cooltipz-css@2.x will not work like this. We will refactor the above code to work with cooltipz-css@2.x.
@use '~cooltipz-css/src/cooltipz' as * with (
$cooltipz-bg-color: #fff,
$cooltipz-font-size: 24px
);