Skip to content

Commit

Permalink
pass tests
Browse files Browse the repository at this point in the history
  • Loading branch information
thysultan committed Mar 26, 2022
1 parent 326a370 commit c8ad684
Showing 1 changed file with 11 additions and 15 deletions.
26 changes: 11 additions & 15 deletions src/Prefixer.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,23 +64,19 @@ export function prefix (value, length, children) {
case 4200:
if (!match(value, /flex-|baseline/)) return MS + 'grid-column-align' + substr(value, length) + value
break
// grid-(row|column)-(start|end), grid-template-(columns|rows)
// grid-template-(columns|rows)
case 2592: case 3360:
switch (charat(value, length - 1)) {
// grid-(row|column)-star(t)
case 116:
if (children = children.find(function (element) { return match(element.props, /grid-(row|column)-end/) })) {
return ~indexof(value + (children = children.value), 'span') ? value : (MS + replace(value, '-start', '') + value + MS + 'grid-row-span:' + (~indexof(children, 'span') ? match(children, /\d+/) : +match(children, /\d+/) - +match(value, /\d+/)) + ';')
} else {
return MS + replace(value, '-start', '') + value
}
// grid-(row|column)-en(d)
case 100:
return children.some(function (element) { return match(element.props, /grid-(row|column)-start/) }) ? value : MS + replace(replace(value, '-end', '-span'), 'span ', '') + value
// grid-template-(column|rows)
default:
return MS + replace(value, 'template-', '') + value
return MS + replace(value, 'template-', '') + value
// grid-row-start, grid-column-start
case 4384: case 3616:
if (children = children && children.find(function (element) { return match(element.props, /grid-(row|column)-end/) })) {
return ~indexof(value + (children = children.value), 'span') ? value : (MS + replace(value, '-start', '') + value + MS + 'grid-row-span:' + (~indexof(children, 'span') ? match(children, /\d+/) : +match(children, /\d+/) - +match(value, /\d+/)) + ';')
} else {
return MS + replace(value, '-start', '') + value
}
// grid-row-end, grid-column-end
case 4896: case 4128:
return (children && children.some(function (element) { return match(element.props, /grid-(row|column)-start/) })) ? value : MS + replace(replace(value, '-end', '-span'), 'span ', '') + value
// (margin|padding)-inline-(start|end)
case 4095: case 3583: case 4068: case 2532:
return replace(value, /(.+)-inline(.+)/, WEBKIT + '$1$2') + value
Expand Down

0 comments on commit c8ad684

Please sign in to comment.