Skip to content

Commit

Permalink
fix background rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
briandennis committed Oct 30, 2017
1 parent 921d6b4 commit 2eee007
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 10 additions & 2 deletions components/Carbon.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ class Carbon extends React.Component {

render() {
const config = { ...DEFAULT_SETTINGS, ...this.props.config }

const options = {
lineNumbers: config.lineNumbers,
mode: this.state.language || 'plaintext',
Expand Down Expand Up @@ -108,7 +107,8 @@ class Carbon extends React.Component {
options={options}
/>
<div id="container-bg">
<div className="alpha" />
<div className="white eliminateOnRender" />
<div className="alpha eliminateOnRender" />
<div className="bg" />
</div>
<style jsx>{`
Expand All @@ -119,6 +119,14 @@ class Carbon extends React.Component {
}
#container #container-bg {
position: absolute;
top: 0px;
right: 0px;
bottom: 0px;
left: 0px;
}
#container .white {
background: #fff;
position: absolute;
top: 0px;
Expand Down
2 changes: 1 addition & 1 deletion pages/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class Editor extends React.Component {
transform: 'scale(2)',
'transform-origin': 'center'
},
filter: n => n.id !== 'container-bg',
filter: n => (n.className ? String(n.className).indexOf('eliminateOnRender') < 0 : true),
width: node.offsetWidth * 2,
height: node.offsetHeight * 2
}
Expand Down

0 comments on commit 2eee007

Please sign in to comment.