Deprecation

Swift
public enum Deprecation: Hashable, Sendable, CustomStringConvertible

A Deprecation refers to a specific feature of the Sass compiler that is deprecated or planned to become deprecated.

By default, using a deprecated feature causes a warning – that is, a CompilerMessage with type CompilerMessage.Kind.deprecation. In some future release of the compiler, use of the deprecated feature will cause an error instead.

You can customize a Sass Compiler’s treatment of deprecated behaviours using a DeprecationControl to create the compiler instance. Each individual deprecation can be ignored or promoted to an error. You can also opt in to future deprecations – features that do not currently cause a deprecation warning but are planned to do so in an upcoming release of Dart Sass.


Topics

Kinds

case id(ID)

A specific Sass deprecation. See the Sass docs for a description of what each of these means.

Declaration
Swift
case id(ID)

case custom(String)

A specific Sass deprecation whose ID has not been included in the ID enumeration for some reason. This is a workaround for development mistakes / release schedules - ideally you won’t need to use it!

Declaration
Swift
case custom(String)

case version(String)

A version number for the Sass compiler meaning “every deprecation known to this level of the compiler”. This may not be supported for all facets of DeprecationControl – the Dart Sass compiler supports it only for fatal deprecations.

Declaration
Swift
case version(String)

Deprecation IDs

enum ID

The set of known deprecation IDs. See the Sass docs.

Declaration
Swift
public enum ID: String, Sendable

Serialization

init(String)

Create a Deprecation from a string, guessing at the type from its format.

Declaration
Swift
public init(_ string: String)

var description: String

A string representing the deprecation.

Should round-trip with init(_:).

Declaration
Swift
public var description: String { get }