dictionary.merge()
The dictionary.merge() function returns a global dictionary merged with $dictionary and/or multiple $dictionaries, optionally merged in $key.
// Sass.
@use 'sass:list';
// Variables.
@forward 'dictionary.variables';
@use 'dictionary.variables' as variables;
// Functions.
@use 'dictionary.get.function' as *;
// Modules.
@use '../../../map';
// The `translator.dictionary-merge()` or `dictionary.merge()` function.
@function merge($key: null, $dictionary, $dictionaries...) {
$retrieved-dictionary: ();
@each $dictionary in list.join(($dictionary, ), $dictionaries, comma) {
$retrieved-dictionary: map.deep-merge($retrieved-dictionary, $dictionary);
}
variables.$dictionary: if(
$key,
map.merge(get() or (), list.append($key, $retrieved-dictionary)...),
map.deep-merge(get() or (), $retrieved-dictionary)
);
@return variables.$dictionary;
}https://github.com/angular-package/sass/blob/main/translator/dictionary/_dictionary.merge.function.scss
Parameters
$key: null
$key: nullThe optional key under which $dictionary and multiple $dictionaries are being merged.
$dictionary: ()
$dictionary: ()Dictionary of map type to merge with a global dictionary.
$dictionaries...
$dictionaries...Additional dictionaries along with a $dictionary to merge with a global dictionary.
Return
The return value is global dictionary merged with $dictionary and/or multiple $dictionaries, optionally merged in $key.
Examples
Last updated
Was this helpful?