CINXE.COM
Sass: Sass Blog
<!doctype html> <html lang="en" class="no-js"> <head> <meta charset="utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="description" content="Syntactically Awesome Style Sheets" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Sass: Sass Blog</title> <link rel="alternate" type="application/atom+xml" href="/feed.xml" /> <link rel="apple-touch-icon" sizes="152x152" type="image/png" href="/icon.png"> <link rel="icon" type="image/png" sizes="152x152" href="/icon.png"> <link rel="icon" type="image/x-icon" href="/favicon.ico" /> <link href="https://fonts.googleapis.com/css?family=Source+Code+Pro::ital,wght@0,400;0,600;1,400|Source+Sans+Pro:300,400,600|Source+Serif+Pro" media="screen" rel="stylesheet" /> <link href="https://cdn.jsdelivr.net/npm/@docsearch/css@alpha" media="screen" rel="stylesheet" /> <link href="/assets/dist/css/sass.css" media="screen" rel="stylesheet" /> <noscript> <link href="/assets/dist/css/noscript.css" media="screen" rel="stylesheet" /> </noscript> <!-- Google Analytics (https://developers.google.com/analytics/devguides/collection/gtagjs). --> <script async src="https://www.googletagmanager.com/gtag/js?id=UA-535380-14"></script> <script> window.dataLayer = window.dataLayer || []; function gtag() { dataLayer.push(arguments); } gtag('js', new Date()); gtag('config', 'UA-535380-14'); </script> </head><body data-layout="body" class="blog"> <!--[if lt IE 9]> <p class="browserupgrade"> You are using an <strong>outdated</strong> browser. Please <a href="https://browsehappy.com/">upgrade your browser</a> to improve your experience and security. </p> <![endif]--> <header class="sl-r-banner" itemtype="https://schema.org/WPHeader" itemscope="itemscope" role="banner"> <div class="sl-c-alert" style="--sl-background--alert: black"> <div class="sl-l-container"> <p><strong>Free Palestine</strong></p> </div> </div> <div class="sl-c-pop-stripe"></div> <div class="sl-l-container"> <div class="sl-l-grid sl-l-grid--full sl-l-large-grid--fit sl-l-large-grid--center sl-l-large-grid--gutters"> <p class="sl-l-grid__column sl-r-banner__brand"> <a href="/"><img height="48" alt="Sass" src="/assets/img/logos/logo.svg"></a> </p> <nav class="sl-r-banner__navigation sl-l-grid__column sl-l-large-grid sl-l-large-grid__column--auto-size sl-c-list-horizontal-wrapper" itemtype="https://schema.org/SiteNavigationElement" itemscope="itemscope" role="navigation" aria-label="Site navigation"> <ul> <li><a href="/playground">Playground</a></li> <li><a href="/install">Install</a></li> <li><a href="/guide">Learn Sass</a></li> <li><a href="/blog">Blog</a></li> <li><a href="/documentation">Documentation</a></li> <li><a href="/community">Get Involved</a></li> <li> <div id="docsearch"></div> </li> </ul> </nav> </div> </div> </header> <main class="content" id="main-content" itemprop="mainContentOfPage" role="main"> <h1 class="sl-l-container">Sass Blog</h1> <div class="sl-l-container sl-color--white-background sl-l-section"> <div class="docSearch-content sl-l-container sl-l-container--small"> <p>Page 1 of<span class="widont"> </span>9</p> <ul class="sl-c-list"> <li> <h2> <a href="/blog/import-is-deprecated/">`@import` is<span class="widont"> </span>Deprecated</a> </h2> <p class="sl-c-attribution">Posted 17 October 2024 by Jennifer<span class="widont"> </span>Thakar</p> <p>Back in 2019, we <a href="/blog/the-module-system-is-launched">released the Sass module system</a>, adding new <code>@use</code> and <code>@forward</code> rules to the language that were designed to replace <code>@import</code> and make stylesheets more maintainable and less error-prone. We can now announce that <code>@import</code> is officially deprecated as of Dart Sass<span class="widont"> </span>1.80.0.</p> <p>The module system ensures that it’s easy for both developers and tooling to determine where a given Sass member is defined, adds namespacing to prevent the need to manually add long, awkward namespaces to names, and allows library authors to ensure their private helpers can’t be accessed by downstream users. Additionally, since each module is only ever loaded once, depending on the same stylesheet multiple times no longer results in duplicated<span class="widont"> </span><span class="caps">CSS</span>.</p> <p>With 4.5 years since we released the module system and more than a year since we passed the 80% Dart Sass usage share threshold we set for starting this deprecation, we feel comfortable making this move. However, we understand that this is a big change to the language and not<span class="widont"> </span>all…</p> </li> <li> <h2> <a href="/blog/wide-gamut-colors-in-sass/">Sass color spaces <span class="amp">&</span> wide gamut<span class="widont"> </span>colors</a> </h2> <p class="sl-c-attribution">Posted 11 September 2024 by Miriam<span class="widont"> </span>Suzanne</p> <p>Wide gamut colors are coming to<span class="widont"> </span>Sass!</p> <p>I should clarify. Wide gamut <span class="caps">CSS</span> color formats like <code>oklch(…)</code> and <code>color(display-p3 …)</code> have been available in all major browsers since May, 2023. But even before that, these new color formats were <em>allowed</em> in Sass. This is one of my favorite features of Sass: most new <span class="caps">CSS</span> <em>just works</em>, without any need for “official” support or updates. When Sass encounters unknown <span class="caps">CSS</span>, it passes that code along to the browser. Not everything needs to be<span class="widont"> </span>pre-processed.</p> <p>Often, that’s all we need. When Cascade Layers and Container Queries rolled out in browsers, there was nothing more for Sass to do. But the new <span class="caps">CSS</span> color formats are a bit different. Since colors are a first-class data type in Sass, we don’t always want to pass them along <em>as-is</em>. We often want to manipulate and manage colors before they go to the<span class="widont"> </span>browser.</p> <p>Already know all about color spaces? <a href="/blog/wide-gamut-colors-in-sass/#css-color-functions-in-sass">Skip ahead to the new Sass features</a>!</p> <h2 id="the-color-format-trade-off" tabindex="-1">The color format trade-off<a class="anchor" href="/blog/wide-gamut-colors-in-sass/#the-color-format-trade-off"><span class="visuallyhidden">The color…</span></a></h2> </li> <li> <h2> <a href="/blog/node-sass-is-end-of-life/">Node Sass is<span class="widont"> </span>end-of-life</a> </h2> <p class="sl-c-attribution">Posted 24 July 2024 by Natalie<span class="widont"> </span>Weizenbaum</p> <p>The time has finally come to retire Node Sass. This Node.js wrapper for LibSass was the first official Sass compiler available in the JavaScript ecosystem and was a huge part of Sass growing beyond the scope of the Ruby community where it originated, but it hasn’t received a new release in a year and a half and the most recent set of maintainers no longer have the bandwidth to continue updating<span class="widont"> </span>it.</p> <p><a href="https://www.npmjs.com/package/node-sass">The npm package</a> has been marked as deprecated, and <a href="https://github.com/sass/node-sass">the GitHub repository</a> has been archived to mitigate confusion about which Sass repositories are still being developed. If you’re still using Node Sass, we strongly recommend you take this opportunity to migrate to the primary implementation, <a href="/dart-sass">Dart Sass</a>, instead.</p> <p>The <a href="https://sass-lang.com/libsass/">LibSass</a> implementation that Node Sass used remains deprecated but not yet end-of-life, as its maintainer Marcel Greter continues to make occasional fixes. However, there is no longer an officially-supported way to use this implementation from<span class="widont"> </span>Node.js.</p> <p>I want to take this opportunity to thank everyone who used<span class="widont"> </span>Node…</p> </li> <li> <h2> <a href="/blog/announcing-pkg-importers/">Announcing `pkg:`<span class="widont"> </span>Importers</a> </h2> <p class="sl-c-attribution">Posted 16 February 2024 by Natalie<span class="widont"> </span>Weizenbaum</p> <p>Several months ago, we <a href="/blog/rfc-package-importer">asked for feedback</a> on a proposal for a new standard for importers that could load packages from various different package managers using the shared <code>pkg:</code> scheme, as well as a built-in <code>pkg:</code> importer that supports Node.js’s module resolution algorithm. Today, I’m excited to announce that this feature has shipped in Dart Sass<span class="widont"> </span>1.71.0!</p> <p>No longer will you have to manually add <code>node_modules</code> to your <code>loadPaths</code> option and worry about whether nested packages will work at all. No longer will you need to add <code>~</code>s to your URLs and give up all portability. Now you can just pass <code>importers: [new NodePackageImporter()]</code> and write <code>@use 'pkg:library'</code> and it’ll work just how you want out of the<span class="widont"> </span>box.</p> <h2 id="what-is-a-pkg-importer" tabindex="-1">What is a <code>pkg:</code> importer?<a class="anchor" href="/blog/announcing-pkg-importers/#what-is-a-pkg-importer"><span class="visuallyhidden">What is a pkg: importer?<span class="widont"> </span>permalink</span></a></h2> <p>Think of a <code>pkg:</code> importer like a specification that anyone can implement by writing a <a href="/documentation/js-api/interfaces/Options/#importers">custom importer</a> that follows <a href="/documentation/at-rules/use#rules-for-a-pkg-importer">a few rules</a>. We’ve implemented one for the Node.js module algorithm, but you could implement one that loads<span class="widont"> </span>Sass…</p> </li> <li> <h2> <a href="/blog/rfc-package-importer/">Request for Comments: Package<span class="widont"> </span>Importer</a> </h2> <p class="sl-c-attribution">Posted 26 September 2023 by James Stuckey<span class="widont"> </span>Weber</p> <p>Sass users often need to use styles from a dependency to customize an existing theme or access styling utilities. Historically, Sass has not specified a standard method for using packages from dependencies. This has led to a variety of domain-specific solutions, including the <code>~</code> prefix in Webpack, and adding <code>node_modules</code> to <code>loadPaths</code>.</p> <p>This has been a common pain point, and can make it difficult to rely on dependencies. It can also make it more difficult to move your project to a new build<span class="widont"> </span>process.</p> <h2 id="package-importers" tabindex="-1">Package Importers<a class="anchor" href="/blog/rfc-package-importer/#package-importers"><span class="visuallyhidden">Package Importers permalink</span></a></h2> <p>We are proposing a new type of importer that allows users to use the <code>pkg:</code> <span class="caps">URL</span> scheme to direct Sass to resolve the dependency <span class="caps">URL</span> using the resolution standards and conventions for a specific<span class="widont"> </span>environment.</p> <p>To address the largest use case, we are proposing a built-in Package Importer for the Node ecosystem. Our recommendation is for package authors to define a <code>sass</code> <a href="https://nodejs.org/api/packages.html#conditional-exports">conditional export</a> for entry points to their package in their distributed <code>package.json</code>. For example, a <code>package.json</code> containing:…</p> </li> </ul> <p> <a href="/blog/page/2/">Next page</a> </p> </div> </div> <div class="sl-c-alert"> <div class="sl-l-container sl-c-list-horizontal-wrapper" aria-labelledby="release-nav"> <ul class="sl-l-grid--justify-center"> <li id="release-nav">Current Releases:</li> <li><span class="release-name"><a href="/dart-sass">Dart Sass</a> <a href="https://github.com/sass/dart-sass/releases/tag/1.81.0">1.81.0</a></span></li> <li><span class="release-name"><a href="/libsass">LibSass</a> <a href="https://github.com/sass/libsass/releases/tag/3.6.6">3.6.6</a></span></li> <li><span class="release-name"><a href="/ruby-sass">Ruby Sass</a> <span aria-label="coffin" role="presentation">⚰</span></span></li> <li class="sl-l-grid__column sl-l-large-grid__column--auto-size"><a href="/implementation">Implementation Guide</a></li> </ul> </div> </div> </main> <footer class="site-footer contentinfo" itemtype="https://schema.org/WPFooter" itemscope="itemscope" role="contentinfo"> <div class="sl-l-container"> <div class="sl-l-grid sl-l-grid--full sl-l-large-grid--fit sl-l-large-grid--center sl-l-large-grid--gutters"> <div class="sl-l-grid__column"> <p>Sass © 2006–2024 the Sass team, and numerous contributors. It is available for use and modification under the <a href="https://github.com/sass/dart-sass/blob/main/LICENSE"><span class="caps">MIT</span><span class="widont"> </span>License</a>.</p> <nav class="sl-c-list-horizontal-wrapper sl-c-list-wrap"> <ul> <li><a href="https://github.com/sass">Sass on GitHub</a></li> <li><a href="https://github.com/sass/sass-site">Website Source Code</a></li> <li><a href="/styleguide">Style Guide</a></li> <li><a href="/community-guidelines">Community Guidelines</a></li> </ul> </nav> </div> <div class="sl-l-grid__column sl-l-large-grid__column--auto-size sl-l-large-grid--justify-right sl-c-footer-link-grid"> <a class="twitter-follow-button" href="https://twitter.com/SassCSS" data-show-count="false" data-size="large">Follow @SassCSS</a> <a class="sl-image-link" href="https://www.netlify.com"><img alt="Deploys by Netlify" src="https://www.netlify.com/v3/img/components/netlify-color-bg.svg"/></a> <a class="sl-image-link mac-stadium-icon" href="https://www.macstadium.com/"><img alt="Powered by MacStadium" class="mac-stadium-icon" src="https://uploads-ssl.webflow.com/5ac3c046c82724970fc60918/5c019d917bba312af7553b49_MacStadium-developerlogo.png"></a> </div> </div> </div> </footer> <script src="https://cdn.jsdelivr.net/npm/@docsearch/js@alpha"></script> <script> docsearch({ container: '#docsearch', appId: 'Q9MULQONSV', indexName: 'sass-lang', apiKey: '2ebc7881b79986f58dc2f424769bf3fc', transformItems: function(hits) { var domain = window.location.origin + "/"; hits.forEach(function(hit) { if (! hit.url.startsWith(domain)) { hit.url = hit.url.replace(/^https?:\/\/[^\/]+\//, domain); } }); return hits; } }); </script> <script> !function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0], p = /^http:/.test(d.location) ? 'http' : 'https'; if (! d.getElementById(id)) { js = d.createElement(s); js.id = id; js.src = p + '://platform.twitter.com/widgets.js'; fjs.parentNode.insertBefore(js, fjs); } }(document, 'script', 'twitter-wjs'); </script> <script src="/assets/dist/js/sass.js"></script> <!-- Current page: /blog/ --> </body> </html>