@vettvangur/design-system 2.0.64 → 2.0.66
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/dist/index.js +27 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2303,7 +2303,9 @@ async function generateFile(variables, config) {
|
|
|
2303
2303
|
if (mobile != null) {
|
|
2304
2304
|
css += ` --${key}: ${mobile};\n`;
|
|
2305
2305
|
}
|
|
2306
|
-
|
|
2306
|
+
|
|
2307
|
+
// Keep the -desktop key if a desktop mode exists, even if it matches mobile.
|
|
2308
|
+
if (desktop != null) {
|
|
2307
2309
|
css += ` --${key}-desktop: ${desktop};\n`;
|
|
2308
2310
|
}
|
|
2309
2311
|
}
|
|
@@ -3144,7 +3146,7 @@ function needsDesktopLine$1(values) {
|
|
|
3144
3146
|
if (!values) {
|
|
3145
3147
|
return false;
|
|
3146
3148
|
}
|
|
3147
|
-
return values.desktop !== values.mobile;
|
|
3149
|
+
return values.desktop != null && values.desktop !== values.mobile;
|
|
3148
3150
|
}
|
|
3149
3151
|
|
|
3150
3152
|
/**
|
|
@@ -3169,8 +3171,17 @@ function blockForBody(b) {
|
|
|
3169
3171
|
const lhBase = `leading-${key}`;
|
|
3170
3172
|
let out = `@utility ${key} {\n`;
|
|
3171
3173
|
out += ` @apply font-body ${fsBase} ${lhBase};\n`;
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
+
const fsDesktop = needsDesktopLine$1(fsValues);
|
|
3175
|
+
const lhDesktop = needsDesktopLine$1(lhValues);
|
|
3176
|
+
if (fsDesktop || lhDesktop) {
|
|
3177
|
+
const parts = [];
|
|
3178
|
+
if (fsDesktop) {
|
|
3179
|
+
parts.push(`desktop-xs:${fsBase}-desktop`);
|
|
3180
|
+
}
|
|
3181
|
+
if (lhDesktop) {
|
|
3182
|
+
parts.push(`desktop-xs:${lhBase}-desktop`);
|
|
3183
|
+
}
|
|
3184
|
+
out += ` @apply ${parts.join(' ')};\n`;
|
|
3174
3185
|
}
|
|
3175
3186
|
out += `}\n`;
|
|
3176
3187
|
return out;
|
|
@@ -3320,7 +3331,7 @@ function needsDesktopLine(values) {
|
|
|
3320
3331
|
if (!values) {
|
|
3321
3332
|
return false;
|
|
3322
3333
|
}
|
|
3323
|
-
return values.desktop !== values.mobile;
|
|
3334
|
+
return values.desktop != null && values.desktop !== values.mobile;
|
|
3324
3335
|
}
|
|
3325
3336
|
|
|
3326
3337
|
/**
|
|
@@ -3345,8 +3356,17 @@ function blockForHeadline(h) {
|
|
|
3345
3356
|
const lhBase = `leading-${key}`;
|
|
3346
3357
|
let out = `@utility ${key} {\n`;
|
|
3347
3358
|
out += ` @apply font-headline ${fsBase} ${lhBase};\n`;
|
|
3348
|
-
|
|
3349
|
-
|
|
3359
|
+
const fsDesktop = needsDesktopLine(fsValues);
|
|
3360
|
+
const lhDesktop = needsDesktopLine(lhValues);
|
|
3361
|
+
if (fsDesktop || lhDesktop) {
|
|
3362
|
+
const parts = [];
|
|
3363
|
+
if (fsDesktop) {
|
|
3364
|
+
parts.push(`desktop-xs:${fsBase}-desktop`);
|
|
3365
|
+
}
|
|
3366
|
+
if (lhDesktop) {
|
|
3367
|
+
parts.push(`desktop-xs:${lhBase}-desktop`);
|
|
3368
|
+
}
|
|
3369
|
+
out += ` @apply ${parts.join(' ')};\n`;
|
|
3350
3370
|
}
|
|
3351
3371
|
out += `}\n`;
|
|
3352
3372
|
return out;
|