Skip to content

Commit

Permalink
Fix tests and update polyfill (#1098)
Browse files Browse the repository at this point in the history
  • Loading branch information
hadihallak authored Oct 3, 2022
1 parent 6aa4571 commit deefb08
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 7 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/convert/toCssRules.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ export const toCssRules = (
data = (
// preserve object-like data
isRuleLike ? data
// replace specially-marked numeric property values with pixel versions
// replace all non-unitless props that are not custom properties with pixel versions
: typeof data === 'number'
? data && !(camelName in unitlessProps)
? data && !(camelName in unitlessProps) && !(name.charCodeAt(0) === 45)
? String(data) + 'px'
: String(data)
// replace tokens with stringified primitive values
Expand Down
1 change: 0 additions & 1 deletion packages/core/src/convert/toPolyfilledValue.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export const toPolyfilledValue = {
hyphens: (d) => ({ WebkitHyphens: d, hyphens: d }),
maskImage: (d) => ({ WebkitMaskImage: d, maskImage: d }),
maskSize: (d) => ({ WebkitMaskSize: d, maskSize: d }),
tabSize: (d) => ({ MozTabSize: d, tabSize: d }),
textSizeAdjust: (d) => ({ WebkitTextSizeAdjust: d, textSizeAdjust: d }),
userSelect: (d) => ({ WebkitUserSelect: d, userSelect: d }),

Expand Down
2 changes: 1 addition & 1 deletion packages/core/tests/universal-autoprefixer.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ describe('Autoprefixer', () => {
},
})()

expect(toString()).toBe('--sxs{--sxs:1 kPCdtQ}@media{x-element{-moz-tab-size:none;tab-size:none}}')
expect(toString()).toBe('--sxs{--sxs:1 kPCdtQ}@media{x-element{tab-size:none}}')
})

test('textSizeAdjust', () => {
Expand Down
3 changes: 0 additions & 3 deletions packages/core/tests/universal-numeric-values.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ describe('Numeric Values', () => {
gridColumnSpan: i,
gridColumnStart: i,
fontWeight: i,
lineClamp: i,
lineHeight: i,
opacity: i,
order: i,
Expand Down Expand Up @@ -113,12 +112,10 @@ describe('Numeric Values', () => {
'grid-column-span:' + i + ';' +
'grid-column-start:' + i + ';' +
'font-weight:' + i + ';' +
'line-clamp:' + i + ';' +
'line-height:' + i + ';' +
'opacity:' + i + ';' +
'order:' + i + ';' +
'orphans:' + i + ';' +
'-moz-tab-size:' + i + ';' +
'tab-size:' + i + ';' +
'widows:' + i + ';' +
'z-index:' + i + ';' +
Expand Down

0 comments on commit deefb08

Please sign in to comment.