/
_functions.scss
46 lines (43 loc) · 1.68 KB
/
_functions.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
////
/// @group expansion-panel
////
@import '~@react-md/theme/dist/helpers';
@import './variables';
/// This function is used to quickly get one of the expansion-panel's theme
/// values. This is really just for the `rmd-expansion-panel-theme` mixin to
/// provide some validation that a correct style key is used, but might be
/// useful in other cases.
///
/// @param {String} theme-style - One of the `$rmd-expansion-panel-theme-values`
/// map keys to get a value for.
/// @return {Color|String|Number} one of the expansion-panel's theme values.
@function rmd-expansion-panel-theme($theme-style) {
@return rmd-theme-get-var-value(
$theme-style,
$rmd-expansion-panel-theme-values,
expansion-panel
);
}
/// This function is used to get one of the expansion-panel's theme variables as
/// a CSS Variable to be applied as a style attribute. By default, the CSS
/// Variable will have a fallback of the current
/// `$rmd-expansion-panel-theme-values`
///
/// This function is used to create a CSS Variable declaration with an optional
/// fallback value if the CSS Variable has not been declared somehow.
///
/// @param {String} theme-style - One of the `$rmd-expansion-panel-theme-values`
/// map keys to set a value for.
/// @param {Color|String|Number} fallback [null] - An optional fallback color to
/// apply. This is set to `null` by default and not used since the link's theme
/// variables should always exist.
/// @return {String} one of the expansion-panel's theme values as a css
/// variable.
@function rmd-expansion-panel-theme-var($theme-style, $fallback: null) {
@return rmd-theme-get-var(
$theme-style,
$rmd-expansion-panel-theme-values,
expansion-panel,
$fallback
);
}