@use
@forward
@import
@mixin
@include
@function
@extend
@error
@warn
@debug
@at-root
@if
@else
@each
@for
@while
true
false
null
sass:color
sass:list
sass:map
sass:math
sass:meta
sass:selector
sass:string
/
-moz-document
Asynchronously compiles the Sass file at path to CSS. Returns a promise that resolves with a CompileResult if it succeeds and rejects with an Exception if it fails.
path
This only allows synchronous or asynchronous Importers and CustomFunctions.
When using Dart Sass, compile is almost twice as fast as compileAsync, due to the overhead of making the entire evaluation process asynchronous.
const sass = require('sass');const result = await sass.compileAsync("style.scss");console.log(result.css); Copy
const sass = require('sass');const result = await sass.compileAsync("style.scss");console.log(result.css);
Optional
Asynchronously compiles the Sass file at
path
to CSS. Returns a promise that resolves with a CompileResult if it succeeds and rejects with an Exception if it fails.This only allows synchronous or asynchronous Importers and CustomFunctions.
⚠️ Heads up!
When using Dart Sass, compile is almost twice as fast as compileAsync, due to the overhead of making the entire evaluation process asynchronous.
Example