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

Commit

Permalink
Use the recommended way to vendor prefix styles
Browse files Browse the repository at this point in the history
See http://facebook.github.io/react/tips/inline-styles.html

This also adds in the non-prefixed styles to make Firefox work but
commented out since there are issues with SVG and transform-origin.
See #48
  • Loading branch information
zpao committed Jan 12, 2014
1 parent 237c0a6 commit b93f1b2
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/elements/VectorWidget/VectorWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,15 @@ var VectorWidget = React.createClass({
* describe the structure of your UI component at *any* point in time.
*/
render: function() {
var transformOrigin = '50% 50%';
var transform = 'rotate(' + this.state.degrees + 'deg)';

var rotationStyle = {
'-webkit-transform-origin': '50% 50%',
'-webkit-transform': 'rotate(' + this.state.degrees + 'deg)'
WebkitTransformOrigin: transformOrigin,
WebkitTransform: transform,
// TODO: Figure out why transform-origin don't work in Firefox
// transformOrigin: transformOrigin,
// transform: transform
};
return (
<svg
Expand Down

0 comments on commit b93f1b2

Please sign in to comment.