Skip to content
This repository has been archived by the owner on Aug 19, 2022. It is now read-only.

Commit

Permalink
Upgrade to inline-style-prefixer 0.6.2
Browse files Browse the repository at this point in the history
Closes #482
  • Loading branch information
ianobermiller committed Jan 6, 2016
1 parent f490918 commit c4e8e83
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
7 changes: 6 additions & 1 deletion interfaces/inline-style-prefixer.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
declare class InlineStylePrefixer {
constructor(userAgent?: ?string): void;
static prefixAll(style: Object): Object;

constructor(config: {
keepUnprefixed?: bool,
userAgent?: ?string
}): void;

prefix(style: Object): Object;
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"babel-preset-react": "^6.3.13",
"babel-preset-stage-1": "^6.3.13",
"exenv": "^1.2.0",
"inline-style-prefixer": "^0.5.3",
"inline-style-prefixer": "^0.6.2",
"is-plain-object": "^2.0.1",
"rimraf": "^2.4.0"
},
Expand Down
14 changes: 6 additions & 8 deletions src/__tests__/style-component-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,9 @@ describe('<Style> component', () => {
it('adds scopeSelector to each selector', () => {
const output = TestUtils.renderIntoDocument(
<Style
radiumConfig={{userAgent: MSIE9_USER_AGENT}}
rules={{
div: {transform: 'rotate(90)'},
span: {transform: 'rotate(90)'}
div: {color: 'red'},
span: {color: 'blue'}
}}
scopeSelector=".scope"
/>
Expand All @@ -65,27 +64,26 @@ describe('<Style> component', () => {
const style = getElement(output, 'style');
expectCSS(style, `
.scope div {
-ms-transform: rotate(90);
color: red;
}
.scope span {
-ms-transform: rotate(90);
color: blue;
}
`);
});

it('adds scopeSelector to multiple selectors in a single ruleset', () => {
const output = TestUtils.renderIntoDocument(
<Style
radiumConfig={{userAgent: MSIE9_USER_AGENT}}
rules={{'div, span': {transform: 'rotate(90)'}}}
rules={{'div, span': {color: 'red'}}}
scopeSelector=".scope"
/>
);

const style = getElement(output, 'style');
expectCSS(style, `
.scope div, .scope span {
-ms-transform: rotate(90);
color: red;
}
`);
});
Expand Down
2 changes: 1 addition & 1 deletion src/prefixer.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export function getPrefixedStyle(
}

if (!prefixer || actualUserAgent !== lastUserAgent) {
prefixer = new InlineStylePrefixer(actualUserAgent);
prefixer = new InlineStylePrefixer({userAgent: actualUserAgent});
lastUserAgent = actualUserAgent;
}

Expand Down

0 comments on commit c4e8e83

Please sign in to comment.