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/rfc-indented-syntax/">Request for Comments: Indented Syntax<span class="widont"> </span>Improvements</a> </h2> <p class="sl-c-attribution">Posted 3 December 2024 by James Stuckey<span class="widont"> </span>Weber</p> <p>For users of the indented syntax (<code>.sass</code>), there has been a long standing request for the ability to have line breaks that don’t end a statement. Certain <span class="caps">CSS</span> syntaxes like <code>grid-template</code> and <code>@font-face</code> <code>src</code> declarations are long, and line breaks can greatly increase the readability of the<span class="widont"> </span>styles.</p> <p>There have been many suggestions, several attempts, and numerous workarounds to address this pain point. We are proposing several new syntax options in the indented syntax that add considerable flexibility and look to address this as part of the<span class="widont"> </span>language.</p> <h2 id="multiline-statements" tabindex="-1">Multiline statements<a class="anchor" href="/blog/rfc-indented-syntax/#multiline-statements"><span class="visuallyhidden">Multiline statements permalink</span></a></h2> <p>We propose allowing statements in the indented syntax to span multiple lines, as long as line breaks occur in places where the statement can’t<span class="widont"> </span>end.</p> <p>A common way of using this syntax will be wrapping lists with line breaks in parentheses. This allows for a grid-template declaration on multiple<span class="widont"> </span>lines.</p> <pre class="language-sass"><code class="language-sass"><span class="token selector">.grid</span> <span class="token property-line"> <span class="token property">display</span><span class="token punctuation">:</span> grid</span> <span class="token property-line"> <span class="token property">grid-template</span><span class="token punctuation">:</span> (</span> <span class="token string">"header"</span> min-content <span class="token string">"main"</span> 1fr <span class="token selector">)</span></code></pre> <p>As usual, these parentheses will not be included in the<span class="widont"> </span>output.</p> <pre class="language-css"><code class="language-css"><span class="token selector">.grid</span> <span class="token punctuation">{...</span></code></pre> </li> <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> </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.85.0">1.85.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–2025 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="sl-c-button sl-c-button--icon sl-c-button--icon-text" href="https://front-end.social/@sass"><svg width="20" height="20" viewBox="0 0 61 65" fill="none" xmlns="http://www.w3.org/2000/svg" > <path d="M60.7539 14.3904C59.8143 7.40642 53.7273 1.90257 46.5117 0.836066C45.2943 0.655854 40.6819 0 29.9973 0H29.9175C19.2299 0 16.937 0.655854 15.7196 0.836066C8.70488 1.87302 2.29885 6.81852 0.744617 13.8852C-0.00294988 17.3654 -0.0827298 21.2237 0.0561464 24.7629C0.254119 29.8384 0.292531 34.905 0.753482 39.9598C1.07215 43.3175 1.62806 46.6484 2.41704 49.9276C3.89445 55.9839 9.87499 61.0239 15.7344 63.0801C22.0077 65.2244 28.7542 65.5804 35.2184 64.1082C35.9295 63.9428 36.6318 63.7508 37.3252 63.5321C38.8971 63.0329 40.738 62.4745 42.0913 61.4937C42.1099 61.4799 42.1251 61.4621 42.1358 61.4417C42.1466 61.4212 42.1526 61.3986 42.1534 61.3755V56.4773C42.153 56.4557 42.1479 56.4345 42.1383 56.4151C42.1287 56.3958 42.1149 56.3788 42.0979 56.3655C42.0809 56.3522 42.0611 56.3429 42.04 56.3382C42.019 56.3335 41.9971 56.3336 41.9761 56.3384C37.8345 57.3276 33.5905 57.8234 29.3324 57.8156C22.0045 57.8156 20.0336 54.3384 19.4693 52.8908C19.0156 51.6397 18.7275 50.3346 18.6124 49.0088C18.6112 48.9866 18.6153 48.9643 18.6243 48.9439C18.6333 48.9236 18.647 48.9056 18.6643 48.8915C18.6816 48.8774 18.7019 48.8675 18.7237 48.8628C18.7455 48.858 18.7681 48.8585 18.7897 48.8641C22.8622 49.8465 27.037 50.3423 31.2265 50.3412C32.234 50.3412 33.2387 50.3412 34.2463 50.3146C38.4598 50.1964 42.9009 49.9808 47.0465 49.1713C47.1499 49.1506 47.2534 49.1329 47.342 49.1063C53.881 47.8507 60.1038 43.9097 60.7362 33.9301C60.7598 33.5372 60.8189 29.8148 60.8189 29.4071C60.8218 28.0215 61.2651 19.5781 60.7539 14.3904Z" fill="url(#paint0_linear_89_8)" /> <path d="M50.3943 22.237V39.5876H43.5185V22.7481C43.5185 19.2029 42.0411 17.3949 39.036 17.3949C35.7325 17.3949 34.0778 19.5338 34.0778 23.7585V32.9759H27.2434V23.7585C27.2434 19.5338 25.5857 17.3949 22.2822 17.3949C19.2949 17.3949 17.8027 19.2029 17.8027 22.7481V39.5876H10.9298V22.237C10.9298 18.6918 11.835 15.8754 13.6453 13.7877C15.5128 11.7049 17.9623 10.6355 21.0028 10.6355C24.522 10.6355 27.1813 11.9885 28.9542 14.6917L30.665 17.5633L32.3788 14.6917C34.1517 11.9885 36.811 10.6355 40.3243 10.6355C43.3619 10.6355 45.8114 11.7049 47.6847 13.7877C49.4931 15.8734 50.3963 18.6899 50.3943 22.237Z" fill="white" /> <defs> <linearGradient id="paint0_linear_89_8" x1="30.5" y1="0" x2="30.5" y2="65" gradientUnits="userSpaceOnUse" > <stop stop-color="#6364FF" /> <stop offset="1" stop-color="#563ACC" /> </linearGradient> </defs> </svg> @sass@front-end.social </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> </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 src="/assets/dist/js/sass.js"></script> <!-- Current page: /blog/ --> </body> </html>