dictionary.get()

The dictionary.get() function returns a global dictionary, optionally from $key.

// Variables.
@forward 'dictionary.variables';
@use 'dictionary.variables' as variables;

// Modules.
@use '../../../map';

// The `translator.dictionary-get()` or `dictionary.get()` function.
@function get($key: null, $default: null) {
  @return if(
    $key,
    if(
      type-of(map.get(variables.$dictionary, $key)) == map,
      map.get(variables.$dictionary, $key),
      $default
    ),
    variables.$dictionary
  );
}
https://github.com/angular-package/sass/blob/main/translator/dictionary/_dictionary.get.function.scss

Parameters

$key: null

An optional key to retrieve dictionary from a global dictionary.

$default: null

The default returned value if dictionary is null.

Return

The return value is a global dictionary, optionally from $key. If null returned value is $default.

Examples

Last updated

Was this helpful?