Skip to content

Commit 7208467

Browse files
authored
Merge pull request #8835 from IgniteUI/simeonoff/css-var-refs
feat(themes): add scoped custom CSS properties for themes, typography, and elevations
2 parents 57d1d1c + d69304c commit 7208467

File tree

134 files changed

+2028
-1268
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+2028
-1268
lines changed

.stylelintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"plugins": ["stylelint-scss"],
33
"ignoreFiles": ["projects/igniteui-angular/src/lib/core/styles/**/*.md"],
44
"rules": {
5-
"at-rule-blacklist": ["debug", {
5+
"at-rule-disallowed-list": ["debug", {
66
"severity": "warning"
77
}],
88
"block-closing-brace-empty-line-before": "never",

angular.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"src/web.config"
3030
],
3131
"styles": [
32-
"src/styles/igniteui-theme.scss"
32+
"src/styles/styles.scss"
3333
],
3434
"scripts": []
3535
},

projects/igniteui-angular/src/lib/core/styles/base/elevations/_index.scss

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -117,23 +117,6 @@
117117
);
118118
}
119119

120-
/// Returns an igx elevation from an igx-elevations produced map.
121-
/// @access public
122-
/// @param {Map} $elevations - The igx-elevations map to extract the elevation from.
123-
/// @param {number} $elevation - The elevation level from 1 to 24.
124-
/// @returns {String} Returns a box-shadow value.
125-
@function igx-elevation($elevations, $elevation) {
126-
@if type-of($elevation) != number or not unitless($elevation) {
127-
@error '$elevation must be a number';
128-
}
129-
130-
@if $elevation < 0 or $elevation > 24 {
131-
@error '$elevation must be between 0 and 24';
132-
}
133-
134-
@return map-get($elevations, #{$elevation});
135-
}
136-
137120
/// Generates a map of 24 shadows.
138121
/// @access public
139122
/// @requires _elevation
@@ -157,9 +140,34 @@
157140
/// @prop {Color} $color-2 [rgba(0, 0, 0, .12)] - The color used for the penumbra shadow.
158141
/// @prop {Color} $color-3 [rgba(0, 0, 0, .08)] - The color used for the ambient shadow.
159142
/// @requires igx-elevations
160-
$elevations: igx-elevations(
143+
$igx-elevations: igx-elevations(
161144
rgba(0, 0, 0, .26),
162145
rgba(0, 0, 0, .12),
163146
rgba(0, 0, 0, .08)
164147
) !default;
165148

149+
/// Returns an igx elevation from an igx-elevations produced map.
150+
/// @access public
151+
/// @param {Map} $elevations [null] - The igx-elevations map to extract the elevation from.
152+
/// @param {number} $elevation [0] - The elevation level from 0 to 24.
153+
/// @returns {String} Returns a box-shadow value.
154+
@function igx-elevation($elevations: null, $elevation: 0) {
155+
@if type-of($elevation) != number or not unitless($elevation) {
156+
@error '$elevation must be a number';
157+
}
158+
159+
@if $elevation < 0 or $elevation > 24 {
160+
@error '$elevation must be between 0 and 24';
161+
}
162+
163+
@if $elevations == null {
164+
@return if(
165+
legacy(),
166+
igx-elevation($igx-elevations, $elevation),
167+
#{var(--igx-elevation-#{$elevation})}
168+
);
169+
}
170+
171+
@return map-get($elevations, #{$elevation});
172+
}
173+

0 commit comments

Comments
 (0)