Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Made the CSS 'padding' '1em' style apply only to content <div>s.
  • Loading branch information
maratbn committed Aug 5, 2018
1 parent 891b4ea commit 8366171
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions webpack_in/entry.jsx
Expand Up @@ -12,16 +12,19 @@ import ReactDOM from 'react-dom';

const objStyleCommon = {
margin: '1em',
padding: '1em',
border: 'solid 2px green',
textAlign: 'center'
};

const objStyleContent = {
padding: '1em'
};


class HelloWidget extends React.Component {
render() {
return (
<div style={ objStyleCommon }>
<div style={{ ...objStyleCommon, ...objStyleContent }}>
Hello! I'm a React app!!
</div>
);
Expand All @@ -32,7 +35,7 @@ class TextWidget extends React.Component {
render() {
return (
<div style={ objStyleCommon }>
<div>Some text here....</div>
<div style={ objStyleContent }>Some text here....</div>
<button>Change text...</button>
</div>
);
Expand Down

0 comments on commit 8366171

Please sign in to comment.