Skip to content

Commit

Permalink
Preserve fallback lengths when a duplicate value is not supported by …
Browse files Browse the repository at this point in the history
…all targets

#292

Data from MDN/caniuse. Only supported in margin/padding properties so far, more coming later.
  • Loading branch information
devongovett committed Apr 24, 2023
1 parent c3f64c2 commit f82bcd6
Show file tree
Hide file tree
Showing 8 changed files with 964 additions and 53 deletions.
23 changes: 22 additions & 1 deletion scripts/build-prefixes.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@ let cssFeatures = [
'css-nesting',
'css-not-sel-list',
'css-has',
'font-family-system-ui'
'font-family-system-ui',
'calc'
];

let compat = new Map();
Expand Down Expand Up @@ -280,8 +281,28 @@ let mdnFeatures = {
imageSet: mdn.css.types.image['image-set'].__compat.support,
xResolutionUnit: mdn.css.types.resolution.x.__compat.support,
nthChildOf: mdn.css.selectors['nth-child'].of_syntax.__compat.support,
minFunction: mdn.css.types.min.__compat.support,
maxFunction: mdn.css.types.max.__compat.support,
roundFunction: mdn.css.types.round.__compat.support,
remFunction: mdn.css.types.rem.__compat.support,
modFunction: mdn.css.types.mod.__compat.support,
absFunction: mdn.css.types.abs.__compat.support,
signFunction: mdn.css.types.sign.__compat.support,
hypotFunction: mdn.css.types.hypot.__compat.support,
};

for (let key in mdn.css.types.length) {
if (key === '__compat') {
continue;
}

let feat = key.includes('_')
? key.replace(/_([a-z])/g, (_, l) => l.toUpperCase())
: key + 'Unit';

mdnFeatures[feat] = mdn.css.types.length[key].__compat.support;
}

for (let feature in mdnFeatures) {
let browserMap = {};
for (let name in mdnFeatures[feature]) {
Expand Down
Loading

0 comments on commit f82bcd6

Please sign in to comment.