class

Hwaro::Assets::Sass::Environment

Inherits Reference / Object

Constructors

new(parent : Environment | Nil = nil, flow_control : Bool = false)
Source

Instance methods

assign_var(name : String, value : String, default : Bool, global : Bool) : Nil

Assignment semantics (dart-sass-flavored):

  • !global writes the root scope (skipped by !default when set).
  • !default is a no-op when the name resolves anywhere in scope.
  • Otherwise the innermost non-root scope already declaring the name is updated; failing that, the name is declared here — which shadows a root/global variable rather than mutating it.
  • Exception: when every frame between here and the root is a flow-control scope, a root declaration is assigned, not shadowed (dart-sass flow-control scoping).
Source
declare_function(name : String, closure : SassFn) : Nil
Source
declare_mixin(name : String, closure : MixinClosure) : Nil
Source
declare_module(namespace : String, mod : SassModule) : Bool
Source
flow_control?

Flow-control scopes (@if/@each/@for/@while bodies) don't shadow outer variables — they assign through to them, global included (dart-sass flow-control scoping). That is what makes @while $i < 4 { $i: $i + 1; } terminate.

Source
functions
Source
lookup_function(name : String) : SassFn | Nil
Source
lookup_mixin(name : String) : MixinClosure | Nil
Source
lookup_var(name : String) : String | Nil
Source
mixins
Source
module?(namespace : String) : SassModule | Nil
Source
modules

@used modules — only ever populated on a file's root scope.

Source
parent
Source
root
Source
root?
Source
variables
Source