Skip to content

Commit fb0b511

Browse files
committed
Moved overlay styles into component.
1 parent 7d89039 commit fb0b511

File tree

3 files changed

+37
-33
lines changed

3 files changed

+37
-33
lines changed

src/js/overlay.jsx

Lines changed: 37 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,52 @@
1-
var React = require('react'),
2-
Classable = require('./mixins/classable');
1+
var React = require('react');
2+
var StylePropable = require('./mixins/style-propable.js');
3+
var AutoPrefix = require('./styles/auto-prefix.js');
4+
var Transitions = require('./styles/mixins/transitions.js');
5+
var Colors = require('./styles/colors.js');
36

47
var Overlay = React.createClass({
58

6-
mixins: [Classable],
9+
mixins: [StylePropable],
710

811
propTypes: {
912
show: React.PropTypes.bool
1013
},
1114

1215
render: function() {
13-
var
14-
{
15-
className,
16-
...other
17-
} = this.props,
18-
classes = this.getClasses('mui-overlay', {
19-
'mui-is-shown': this.props.show
16+
17+
var {
18+
show,
19+
style,
20+
...other
21+
} = this.props;
22+
23+
var styles = {
24+
position: 'fixed',
25+
height: '100%',
26+
width: '100%',
27+
zIndex: 9,
28+
top: 0,
29+
left: '-100%',
30+
backgroundColor: Colors.transparent,
31+
transition:
32+
Transitions.easeOut('0ms', 'left', '400ms') + ',' +
33+
Transitions.easeOut('400ms', 'backgroundColor')
34+
};
35+
36+
if (this.props.show) {
37+
styles = this.mergePropStyles(styles, {
38+
left: 0,
39+
backgroundColor: Colors.lightBlack,
40+
transition:
41+
Transitions.easeOut('0ms', 'left') + ',' +
42+
Transitions.easeOut('400ms', 'backgroundColor')
2043
});
44+
}
45+
46+
styles = this.mergePropStyles(styles);
2147

2248
return (
23-
<div {...other} className={classes} />
49+
<div {...other} style={AutoPrefix.all(styles)} />
2450
);
2551
}
2652

src/less/components/components.less

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
@import "left-nav.less";
1919
@import "menu.less";
2020
@import "menu-item.less";
21-
@import "overlay.less";
2221
@import "paper.less";
2322
@import "radio-button.less";
2423
@import "raised-button.less";

src/less/components/overlay.less

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)