Skip to content

Commit 267ff8e

Browse files
authored
feat: Update fetch mixin to support region input (#1328) (#1626)
* fix: Update fetch mixin to support region input * fix: Update changelog and documentation
1 parent 9f1aba0 commit 267ff8e

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

CHANGELOG-1.x.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# 1.8.0 (2021)
22

3-
- [](https://github.com/patternfly/patternfly-elements/commit/) feat: pfe-icon now supports setting default icon sets
3+
- [f1c1176](https://github.com/patternfly/patternfly-elements/commit/f1c1176d9278d6e5b8066b42fc040ea01d98ecb2) feat: pfe-icon now supports setting default icon sets
4+
- [](https://github.com/patternfly/patternfly-elements/commit/) feat: Update fetch mixin to support region input (#1328)
45
- [56eb55e](https://github.com/patternfly/patternfly-elements/commit/56eb55ec8b4b62aee7d36950d158229cbf50ddef) fix: pfe-accordion IE11 regression; background context should always be white with black text
56

67
# 1.7.0 (2021-05-10)

elements/pfe-sass/functions/_custom-properties.scss

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,19 +127,23 @@
127127
/// Returns the value (only) of a property from the respective maps
128128
/// Similar to pfe-var, but does not include css variable in the compiled CSS
129129
/// @param {String} $name - Name of the key for the map
130+
/// @param {String} $region - Identifies the region or slot to which this is assigned
130131
/// @see $pfe-vars
131132
/// @see $pfe-colors
132133
/// @see $pfe-broadcasted
133134
/// @example - scss - In your component styles
134135
/// .my-element {
135136
/// background-color: pfe-fetch( ui-base );
136137
/// }
137-
@function pfe-fetch($name) {
138+
@function pfe-fetch($name, $region: null) {
138139
$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 {
140144
@return map-get($LOCAL-VARIABLES, $var-name);
141145
}
142-
@if map-get($pfe-vars, $var-name) != null {
146+
@else if map-get($pfe-vars, $var-name) != null {
143147
@return map-get($pfe-vars, $var-name);
144148
}
145149
@else if map-get($pfe-colors, $var-name) != null {

0 commit comments

Comments
 (0)