Page 2 of 8
Posted 21 September 2022 by Miriam Suzanne and Natalie Weizenbaum
There’s been a lot of exciting work in the CSS color specifications lately, and as it begins to land in browsers we’ve been preparing to add support for it in Sass as well. The first and largest part of that is adding support for color spaces to Sass, which represents a huge (but largely backwards-compatible) rethinking of the way colors work.
Historically, all colors in CSS have existed in the same color space, known as "sRGB". Whether you represent them as a hex code, an
hsl()function, or a color name, they represented the same set of visible colors you could tell a screen to display. While this is conceptually simple, there are some major downsides:
As monitors have improved over time, they’ve become capable of displaying more colors than can be represented in the sRGB color space.
sRGB, even when you’re using it via
hsl(), doesn’t correspond very well with how humans perceive colors. Cyan looks noticeably lighter than purple with the same saturation and lightness values.
Posted 15 June 2022 by Natalie Weizenbaum
Do you know what
margin: $a -$bdoes in Sass? If you said "the same thing as
margin: $a (-$b), I’m sorry, but you’re wrong. It’s actually the same thing as
margin: $a - $b. Don’t worry, you’re not the first person to get tripped up by this weird corner of Sass’s parser! But our new language proposal aims to fix that.
In the Strict Unary Operators proposal, which is currently open for community feedback, we propose to first deprecate and then eventually disallow expressions of the form
$a -$b. We know deprecations are never pleasant, but this should be fairly painless as they go: you can simply write
$a - $bor
$a (-$b), depending which you intend. We’ll also provide a Sass migrator migration to automatically update your stylesheets.
$a -$bwill no longer be allowed, because it’s unclear what the author intended and the current behavior is likely to be incorrect.
$a - $bwill continue to work, since it’s…
Posted 1 February 2022 by Natalie Weizenbaum
After several years of planning and development, I’m excited to finally announce the stable release of Embedded Dart Sass along with its first official wrapper, the
sass-embeddedpackage available now on npm!
Embedded Sass is an ongoing effort to make a highly-performant Sass library available to as many different languages as possible, starting with Node.js. Although Node.js already has access to the pure-JS
sass-embeddedto be a major boon to developers for whom compilation speed is a concern, particularly the remaining users of
node-sassfor whom performance has been a major reason to avoid Dart Sass.
sass-embeddedpackage fully supports the new JS API as well as the legacy API other than a few cosmetic options. You can use it as a drop-in replacement for the
sasspackage, and it should work with all the same build plugins and libraries. Note that
sass-embeddedis a bit…
Posted 21 November 2021 by Natalie Weizenbaum
Because this is such a substantial addition, we want to give users a chance to kick the tires a bit before we set it in stone, so we’ve released it as a release candidate in Dart Sass 1.45.0-rc.1. Download it, try it out, and let us know what you think by filing issues or sending us a tweet. Unless major changes are necessary, we plan to make a stable release some time next week.
How to use itHow to use it permalink
The new API comes with four new entrypoint functions:
compileAsync()take Sass file paths and return the result of compiling them to CSS, while
compileStringAsync()take a string of Sass source and…
Posted 5 August 2021 by Natalie Weizenbaum
The API has four main components, all of which I’ll cover in this post:
As you read on, remember that this API is still just a proposal. We want to hear from you, our users, whether it meets your needs and how we can improve it before we lock it in to a full release. So go ahead and make your voices known on the issue tracker!
Why a New API?Why a New API? permalink