Sass中文网

  • 安装
  • 入门
  • 博客
  • 文档
  • 社区

Contents

  • Syntax
    • Overview
    • Parsing a Stylesheet
    • Structure of a Stylesheet
    • Comments
    • Special Functions
  • Style Rules
    • Overview
    • Property Declarations
    • Parent Selector
    • Placeholder Selectors
  • Variables
  • Interpolation
  • At-Rules
    • Overview
    • @use
    • @forward
    • @import
    • @mixin and @include
    • @function
    • @extend
    • @error
    • @warn
    • @debug
    • @at-root
    • Flow Control
      • Overview
      • @if and @else
      • @each
      • @for
      • @while
    • From CSS
  • Values
    • Overview
    • Numbers
    • Strings
    • Colors
    • Lists
    • Maps
    • true and false
    • null
    • Calculations
    • Functions
  • Operators
    • Overview
    • Equality
    • Relational
    • Numeric
    • String
    • Boolean
  • Built-In Modules
    • Overview
    • sass:color
    • sass:list
    • sass:map
    • sass:math
    • sass:meta
    • sass:selector
    • sass:string
  • Breaking Changes
    • Overview
    • Strict Unary Operators
    • Random With Units
    • Invalid Combinators
    • Media Queries Level 4
    • / as Division
    • Function Units
    • -moz-document
    • Extending Compound Selectors
    • CSS Variable Syntax
  • Command Line
    • Overview
    • Dart Sass
    • Ruby Sass
    • Migrator
  • JavaScript API
  • sass
  • renderSync

renderSync

  • renderSync(options: LegacyOptions<"sync">): LegacyResult
  • This function synchronously compiles a Sass file to CSS. If it succeeds, it returns the result, and if it fails it throws an error.

    Example

    const sass = require('sass'); // or require('node-sass');

    const result = sass.renderSync({file: "style.scss"});
    // ...

    Deprecated

    Use compile or compileString instead.

    Parameters

    • options: LegacyOptions<“sync”>

    Returns LegacyResult

    • Defined in js-api-doc/legacy/render.d.ts:111
sass
  • Compile
    • CompileResult
    • compile
    • compileAsync
    • compileString
    • compileStringAsync
  • Options
    • Options
    • StringOptionsWithImporter
    • StringOptionsWithoutImporter
    • OutputStyle
    • StringOptions
    • Syntax
  • Logger
    • Logger
      • silent
    • Logger
    • SourceLocation
    • SourceSpan
  • Importer
    • FileImporter
    • Importer
    • ImporterResult
  • Custom Function
    • SassArgumentList
    • SassBoolean
    • SassColor
    • SassFunction
    • SassList
    • SassMap
    • SassNumber
    • SassString
    • Value
    • CustomFunction
    • ListSeparator
    • sassFalse
    • sassNull
    • sassTrue
  • Other
    • Exception
    • LegacyFileOptions
    • PromiseOr
    • info
  • Legacy
    • types
      • Boolean
      • Color
      • Error
      • List
      • Map
      • Null
      • Number
      • String
    • LegacyException
    • LegacyImporterThis
    • LegacyPluginThis
    • LegacyResult
    • LegacySharedOptions
    • LegacyStringOptions
    • LegacyAsyncFunction
    • LegacyAsyncFunctionDone
    • LegacyAsyncImporter
    • LegacyFunction
    • LegacyImporter
    • LegacyImporterResult
    • LegacyOptions
    • LegacySyncFunction
    • LegacySyncImporter
    • LegacyValue
    • FALSE
    • NULL
    • TRUE
    • render
    • renderSync
  • Current Releases:
  • Dart Sass 1.63.6
  • LibSass 3.6.5
  • Ruby Sass ⚰
  • Implementation Guide

Sass © 2006–2023 the Sass team, and numerous contributors. It is available for use and modification under the MIT License.

  • Sass on GitHub
  • Website Source Code
  • Style Guide
  • Community Guidelines
Powered by MacStadium