anubis-ui 1.2.21 → 1.2.23
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/package.json
CHANGED
|
@@ -35,25 +35,18 @@ const generateCssRules = (ruleInfos: IRuleInfo[]): string => {
|
|
|
35
35
|
|
|
36
36
|
const mapClassIntoRule = (stringClass: string): IRuleInfo | null => {
|
|
37
37
|
const params = getClassInfos(stringClass);
|
|
38
|
+
if (!params.utility) { return null }
|
|
38
39
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
* */
|
|
43
|
-
if (!params.utility) {
|
|
44
|
-
const { colorExists } = getColorInfos(params.color);
|
|
45
|
-
|
|
46
|
-
if (!colorExists) {
|
|
47
|
-
return null;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
40
|
+
const needsColor = params.utility?.declaration?.includes('${color}')
|
|
41
|
+
const usesVariation = params.variationName
|
|
42
|
+
const hasDefaultVariation = !params.utility?.variations || Object.keys(params.utility?.variations || []).includes('default')
|
|
50
43
|
|
|
51
44
|
/**
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
|
|
55
|
-
if (
|
|
56
|
-
return null
|
|
45
|
+
* If need color but doesn't have one or if need a variation but doesn't have one either
|
|
46
|
+
* this is a no go
|
|
47
|
+
*/
|
|
48
|
+
if ((needsColor && !params.color) || (!hasDefaultVariation && !usesVariation)) {
|
|
49
|
+
return null
|
|
57
50
|
}
|
|
58
51
|
|
|
59
52
|
const ruleInfo = buildRuleInfo(params);
|