Spec-Zone.ru › Sass

LegacyResult

The object returned by render and renderSync after a successful compilation.

Deprecated

This is only used by the legacy render and renderSync APIs. Use compile, compileString, compileAsync, and compileStringAsync instead.

Hierarchy

  • LegacyResult
  • Defined in js-api-doc/legacy/render.d.ts:13
Index

Properties

css map? stats

Properties

css

css: Buffer

The compiled CSS. This can be converted to a string by calling Buffer.toString.

Example

constresult = sass.renderSync({file:"style.scss"});

console.log(result.css.toString());
  • Defined in js-api-doc/legacy/render.d.ts:26

Optional map

map?: Buffer

The source map that maps the compiled CSS to the source files from which it was generated. This can be converted to a string by calling Buffer.toString.

This is undefined unless either

  • sourceMap is a string; or
  • sourceMap is true and outFile is set.

The source map uses absolute file: URLs to link to the Sass source files, except if the source file comes from data in which case it lists its URL as "stdin".

Example

constresult = sass.renderSync({
file:"style.scss",
sourceMap:true,
outFile:"style.css"
})

console.log(result.map.toString());
  • Defined in js-api-doc/legacy/render.d.ts:56

stats

stats: {
duration: number;
end: number;
entry: string;
includedFiles: string[];
start: number;
}

Additional information about the compilation.

Type declaration

  • duration: number

    The number of milliseconds it took to compile the Sass file. This is always equal to start minus end.

  • end: number

    The number of milliseconds between 1 January 1970 at 00:00:00 UTC and the time at which Sass compilation ended.

  • entry: string

    The absolute path of file or file, or "data" if file wasn't set.

  • includedFiles: string[]

    An array of the absolute paths of all Sass files loaded during compilation. If a stylesheet was loaded from a LegacyImporter that returned the stylesheet’s contents, the raw string of the @use or @import that loaded that stylesheet included in this array.

  • start: number

    The number of milliseconds between 1 January 1970 at 00:00:00 UTC and the time at which Sass compilation began.

  • Defined in js-api-doc/legacy/render.d.ts:59
sass
  • Compile
    • AsyncCompiler
    • Compiler
    • CompileResult
    • compile
    • compileAsync
    • compileString
    • compileStringAsync
    • initAsyncCompiler
    • initCompiler
  • Options
    • Options
    • StringOptions
    • OutputStyle
    • StringOptionsWithImporter
    • StringOptionsWithoutImporter
    • Syntax
  • Logger
    • Logger
      • silent
    • Logger
    • SourceLocation
    • SourceSpan
    • LoggerWarnOptions
  • Importer
    • NodePackageImporter
    • FileImporter
    • Importer
    • ImporterResult
  • Custom Function
    • CalculationInterpolation
    • CalculationOperation
    • SassArgumentList
    • SassBoolean
    • SassCalculation
    • SassColor
    • SassFunction
    • SassList
    • SassMap
    • SassMixin
    • SassNumber
    • SassString
    • Value
    • CalculationOperator
    • CalculationValue
    • CustomFunction
    • ListSeparator
    • sassFalse
    • sassNull
    • sassTrue
  • Other
    • Exception
    • CanonicalizeContext
    • Deprecations
    • LegacyFileOptions
    • ChannelName
    • ChannelNameHsl
    • ChannelNameHwb
    • ChannelNameLab
    • ChannelNameLch
    • ChannelNameRgb
    • ChannelNameXyz
    • ColorSpaceHsl
    • ColorSpaceHwb
    • ColorSpaceLab
    • ColorSpaceLch
    • ColorSpaceRgb
    • ColorSpaceXyz
    • GamutMapMethod
    • HueInterpolationMethod
    • KnownColorSpace
    • PolarColorSpace
    • PromiseOr
    • RectangularColorSpace
    • 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
  • Messages
    • Version
    • Deprecation
    • DeprecationOrId
    • DeprecationStatus
    • deprecations

© 2006–2025 the Sass team, and numerous contributors
Licensed under the MIT License.
https://sass-lang.com/documentation/js-api/interfaces/LegacyResult

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API