Skip to content

Commit

Permalink
Fix margin for right-aligned images (#398)
Browse files Browse the repository at this point in the history
Update so imageAlign* has a class for all directions
  • Loading branch information
rickhanlonii authored and JoelMarcey committed Jan 18, 2018
1 parent 373a3e6 commit 4c2558e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/core/GridBlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ class GridBlock extends React.Component {
alignCenter: this.props.align === 'center',
alignRight: this.props.align === 'right',
fourByGridBlock: this.props.layout === 'fourColumn',
imageAlignBottom: block.image && block.imageAlign === 'bottom',
imageAlignSide:
block.image &&
(block.imageAlign === 'left' || block.imageAlign === 'right'),
imageAlignTop: block.image && block.imageAlign === 'top',
imageAlignRight: block.image && block.imageAlign === 'right',
imageAlignBottom: block.image && block.imageAlign === 'bottom',
imageAlignLeft: block.image && block.imageAlign === 'left',
threeByGridBlock: this.props.layout === 'threeColumn',
twoByGridBlock: this.props.layout === 'twoColumn',
});
Expand Down
7 changes: 6 additions & 1 deletion lib/static/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,6 @@ pre code {
.imageAlignSide .blockImage {
max-width: 500px;
flex: 0 1 500px;
margin-right: 40px;
}
@media only screen and (min-device-width: 360px) and (max-device-width: 735px) {
.imageAlignSide .blockImage {
Expand All @@ -821,6 +820,12 @@ pre code {
margin-left: auto;
margin-right: auto;
}
.imageAlignRight .blockImage {
margin-left: 40px;
}
.imageAlignLeft .blockImage {
margin-right: 40px;
}
.container .gridBlock .blockContent p {
padding: 0;
}
Expand Down

0 comments on commit 4c2558e

Please sign in to comment.