don't hide navigation while playground is loaded if screen is 1200px+ in width

old
lukasliesis 2015-11-15 18:47:39 +02:00
parent e476893aa3
commit 51f83388ca
3 changed files with 34 additions and 0 deletions

1
.gitignore vendored
View File

@ -2,3 +2,4 @@ build
lib
node_modules
npm-debug.log
.idea

View File

@ -49,6 +49,7 @@ class Main extends React.Component {
const examples = document.getElementsByClassName(this.LOAD_EXAMPLE_CLASS);
Array.prototype.forEach.call(examples, (exampleNode, idx) => {
const exampleCode = components[this.props.params.component].examples[idx];
this.refs.playground.loadCode(exampleCode);
ReactDOM.render(
<LoadExampleButton onClick={this.handlePlaygroundLoad.bind(this, exampleCode)} />,
exampleNode

View File

@ -70,6 +70,38 @@
}
}
/*
don't hide navigation when playground is open if screen width > 1200px
*/
@media screen and (min-width: 1200px) {
.root {
&:not(.with-playground) {
> .playground {
right: - ($playground-width * 1.1);
}
> .documentation {
padding-right: 0;
padding-left: $navigation-width;
}
> .navigation {
transform: translateX(0);
}
}
&.with-playground {
> .playground {
right: 0;
}
> .documentation {
padding-right: $playground-width;
padding-left: $navigation-width;
}
> .navigation {
transform: translateX(0);
}
}
}
}
.load-button {
display: inline-block;
}