|
127 | 127 | /// Returns the value (only) of a property from the respective maps |
128 | 128 | /// Similar to pfe-var, but does not include css variable in the compiled CSS |
129 | 129 | /// @param {String} $name - Name of the key for the map |
| 130 | +/// @param {String} $region - Identifies the region or slot to which this is assigned |
130 | 131 | /// @see $pfe-vars |
131 | 132 | /// @see $pfe-colors |
132 | 133 | /// @see $pfe-broadcasted |
133 | 134 | /// @example - scss - In your component styles |
134 | 135 | /// .my-element { |
135 | 136 | /// background-color: pfe-fetch( ui-base ); |
136 | 137 | /// } |
137 | | -@function pfe-fetch($name) { |
| 138 | +@function pfe-fetch($name, $region: null) { |
138 | 139 | $var-name: to-string($name, "--"); |
139 | | - @if map-get($LOCAL-VARIABLES, $var-name) != null { |
| 140 | + @if $region != null and map-deep-get($LOCAL-VARIABLES, $region, $var-name) != null { |
| 141 | + @return map-deep-get($LOCAL-VARIABLES, $region, $var-name); |
| 142 | + } |
| 143 | + @else if $region == null and map-get($LOCAL-VARIABLES, $var-name) != null { |
140 | 144 | @return map-get($LOCAL-VARIABLES, $var-name); |
141 | 145 | } |
142 | | - @if map-get($pfe-vars, $var-name) != null { |
| 146 | + @else if map-get($pfe-vars, $var-name) != null { |
143 | 147 | @return map-get($pfe-vars, $var-name); |
144 | 148 | } |
145 | 149 | @else if map-get($pfe-colors, $var-name) != null { |
|
0 commit comments