@flodesk/grain 11.0.0 → 11.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/es/styles/utilities.js
CHANGED
|
@@ -32,9 +32,9 @@ import { breakpoints, deviceShort } from '../variables';
|
|
|
32
32
|
var generateUtilityClassDeclarations = function generateUtilityClassDeclarations(propertySets) {
|
|
33
33
|
var css = '';
|
|
34
34
|
propertySets.forEach(function (set) {
|
|
35
|
-
set.
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
set.props.forEach(function (prop) {
|
|
36
|
+
var property = prop.property;
|
|
37
|
+
set.variables.forEach(function (variable) {
|
|
38
38
|
var cssValue = set.valueTransformer ? set.valueTransformer(variable) : variable;
|
|
39
39
|
var hasHover = prop.propName.includes('Hover');
|
|
40
40
|
var selector = ".".concat(propNameToShort(prop.propName), "-").concat(variable);
|
|
@@ -27,7 +27,7 @@ import { getCssVar, isNumber, isString, u, isObject } from '.';
|
|
|
27
27
|
import { vars, varInfo } from '../variables';
|
|
28
28
|
export var getMediaCss = function getMediaCss(mediaQuery, property, value) {
|
|
29
29
|
var getValue = function getValue(val) {
|
|
30
|
-
if (val === 0) return
|
|
30
|
+
if (val === 0) return '0';
|
|
31
31
|
if (isNumber(val)) return u(val);
|
|
32
32
|
if (isString(val)) return val;
|
|
33
33
|
};
|
|
@@ -57,7 +57,7 @@ export var mapObjToMedia = function mapObjToMedia(property, obj, type) {
|
|
|
57
57
|
return declarations.join('');
|
|
58
58
|
};
|
|
59
59
|
export var getDimension = function getDimension(dimension) {
|
|
60
|
-
if (dimension === 0) return
|
|
60
|
+
if (dimension === 0) return '0';
|
|
61
61
|
if (isString(dimension)) return dimension;
|
|
62
62
|
if (isNumber(dimension)) return u(dimension);
|
|
63
63
|
};
|
|
@@ -73,7 +73,7 @@ export var getSpace = function getSpace(space) {
|
|
|
73
73
|
return getCssVar(varInfo.spaces.name, space);
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
if (space === 0) return
|
|
76
|
+
if (space === 0) return '0';
|
|
77
77
|
if (isString(space)) return space;
|
|
78
78
|
if (isNumber(space)) return u(space);
|
|
79
79
|
};
|