Skip to content

Commit 8432f30

Browse files
author
Sofiya Tepikin
committed
Adds option to add className
1 parent 88a1b46 commit 8432f30

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/react-inline-css.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ var InlineCss = React.createClass({
1212
displayName: "InlineCss",
1313
propTypes: {
1414
componentName: React.PropTypes.string,
15+
className: React.PropTypes.string,
1516
namespace: React.PropTypes.string,
1617
stylesheet: React.PropTypes.string.isRequired,
1718
wrapper: React.PropTypes.string
@@ -30,13 +31,14 @@ var InlineCss = React.createClass({
3031
},
3132
render: function () {
3233
var componentName = this.props.componentName || "&";
34+
var className = this.props.className;
3335
var namespace = this.props.namespace || "InlineCss-" + refCounter++;
3436
var stylesheet = this._transformSheet(this.props.stylesheet, componentName, namespace);
3537
var Wrapper = this.props.wrapper || "div";
3638

3739
return React.createElement(
3840
Wrapper,
39-
{id: namespace},
41+
{id: namespace, className: className},
4042
this.props.children,
4143
React.createElement("style", {
4244
scoped: true,

0 commit comments

Comments
 (0)