Skip to content

Commit f82bcd6

Browse files
committed
Preserve fallback lengths when a duplicate value is not supported by all targets
parcel-bundler#292 Data from MDN/caniuse. Only supported in margin/padding properties so far, more coming later.
1 parent c3f64c2 commit f82bcd6

File tree

8 files changed

+964
-53
lines changed

8 files changed

+964
-53
lines changed

scripts/build-prefixes.js

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,8 @@ let cssFeatures = [
188188
'css-nesting',
189189
'css-not-sel-list',
190190
'css-has',
191-
'font-family-system-ui'
191+
'font-family-system-ui',
192+
'calc'
192193
];
193194

194195
let compat = new Map();
@@ -280,8 +281,28 @@ let mdnFeatures = {
280281
imageSet: mdn.css.types.image['image-set'].__compat.support,
281282
xResolutionUnit: mdn.css.types.resolution.x.__compat.support,
282283
nthChildOf: mdn.css.selectors['nth-child'].of_syntax.__compat.support,
284+
minFunction: mdn.css.types.min.__compat.support,
285+
maxFunction: mdn.css.types.max.__compat.support,
286+
roundFunction: mdn.css.types.round.__compat.support,
287+
remFunction: mdn.css.types.rem.__compat.support,
288+
modFunction: mdn.css.types.mod.__compat.support,
289+
absFunction: mdn.css.types.abs.__compat.support,
290+
signFunction: mdn.css.types.sign.__compat.support,
291+
hypotFunction: mdn.css.types.hypot.__compat.support,
283292
};
284293

294+
for (let key in mdn.css.types.length) {
295+
if (key === '__compat') {
296+
continue;
297+
}
298+
299+
let feat = key.includes('_')
300+
? key.replace(/_([a-z])/g, (_, l) => l.toUpperCase())
301+
: key + 'Unit';
302+
303+
mdnFeatures[feat] = mdn.css.types.length[key].__compat.support;
304+
}
305+
285306
for (let feature in mdnFeatures) {
286307
let browserMap = {};
287308
for (let name in mdnFeatures[feature]) {

0 commit comments

Comments
 (0)