Breaking Change: abs() Percentage

Sass has historically supported theabs() function. AfterCSS supported calculations in Values and Units Level 4, we had to workaround backwards-compatibility. However, for theabs() function we posses a compatibility problem supporting the% unit.

Theabs() global function in Sass supported the% unit as an input and wouldresolve theabs() function before resolving the% value. For instance, ifthe input wasabs(10%) the function will return10%. As a result, if thevalue of10% represented-50px the function would return-50px.

However, theCSSabs() abs function will resolve the% before resolving thefunction. Therefore if the value of10% represented-50px,abs(10%) wouldreturn-10% which in the browser would be50px.

For this reason, we are deprecating the global abs() function with a percentage.To preserve the current behavior, usemath.abs() instead.

Can I Silence the Warnings?Can I Silence the Warnings? permalink

Sass provides a powerful suite of options for managing which deprecationwarnings you see and when.

Terse and Verbose ModeTerse and Verbose Mode permalink

By default, Sass runs in terse mode, where it will only print each type ofdeprecation warning five times before it silences additional warnings. Thishelps ensure that users know when they need to be aware of an upcoming breakingchange without creating an overwhelming amount of console noise.

If you run Sass in verbose mode instead, it will printevery deprecationwarning it encounters. This can be useful for tracking the remaining work to bedone when fixing deprecations. You can enable verbose mode usingthe--verbose flag on the command line, ortheverbose option in the JavaScript API.

⚠️ Heads up!

When running from theJSAPI, Sass doesn’t share any information acrosscompilations, so by default it’ll print five warnings foreach stylesheetthat’s compiled. However, you can fix this by writing (or asking the author ofyour favorite framework’s Sass plugin to write) acustomLogger that onlyprints five errors per deprecation and can be shared across multiple compilations.

Silencing Deprecations in DependenciesSilencing Deprecations in Dependencies permalink

Sometimes, your dependencies have deprecation warnings that you can’t doanything about. You can silence deprecation warnings from dependencies whilestill printing them for your app usingthe--quiet-deps flag on the command line, orthequietDeps option in the JavaScript API.

For the purposes of this flag, a "dependency" is any stylesheet that’s not justa series of relative loads from the entrypoint stylesheet. This means anythingthat comes from a load path, and most stylesheets loaded through custom importers.

Silencing Specific DeprecationsSilencing Specific Deprecations permalink

If you know that one particular deprecation isn’t a problem for you, you cansilence warnings for that specific deprecation usingthe--silence-deprecation flag on the command line, orthesilenceDeprecations option in the JavaScript API.