Skip to content

Commit

Permalink
Add additional components first/last child margin reset.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaspar Naaber committed Mar 2, 2017
1 parent 5dbdcdc commit e8cd528
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 8 deletions.
31 changes: 28 additions & 3 deletions sources/stylesheets/_content-formatted.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,37 @@
}

// Resets the bottom margin for all elements and top margin for all first elements in the editable content-area (to prevent unwanted white-space at the beginning of a content-area).
h1, h2, h3, h4, h5, h6, p, ul, ol, pre, code, iframe, table form {
margin-bottom: 0;

h1,
h2,
h3,
h4,
h5,
h6,
p,
ul,
ol,
dl,
table,
pre,
code,
iframe,
table,
form,
.table-container,
.edy-positionable-container-left-block,
.edy-positionable-container-center-block,
.edy-positionable-container-right-block,
.edy-texteditor-container-wrapper-left-block,
.edy-texteditor-container-wrapper-center,
.edy-texteditor-container-wrapper-right-block,
.edy-positionable-container-maxwidth {
&:first-child {
margin-top: 0;
}

&:last-child {
margin-bottom: 0;
}
}

// Styling rules for the editable content area headings.
Expand Down
54 changes: 50 additions & 4 deletions stylesheets/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,58 @@ body.dark-background {
.dark-background .content-formatted {
color: white;
}
.content-formatted h1, .content-formatted h2, .content-formatted h3, .content-formatted h4, .content-formatted h5, .content-formatted h6, .content-formatted p, .content-formatted ul, .content-formatted ol, .content-formatted pre, .content-formatted code, .content-formatted iframe, .content-formatted table form {
margin-bottom: 0;
}
.content-formatted h1:first-child, .content-formatted h2:first-child, .content-formatted h3:first-child, .content-formatted h4:first-child, .content-formatted h5:first-child, .content-formatted h6:first-child, .content-formatted p:first-child, .content-formatted ul:first-child, .content-formatted ol:first-child, .content-formatted pre:first-child, .content-formatted code:first-child, .content-formatted iframe:first-child, .content-formatted table form:first-child {
.content-formatted h1:first-child,
.content-formatted h2:first-child,
.content-formatted h3:first-child,
.content-formatted h4:first-child,
.content-formatted h5:first-child,
.content-formatted h6:first-child,
.content-formatted p:first-child,
.content-formatted ul:first-child,
.content-formatted ol:first-child,
.content-formatted dl:first-child,
.content-formatted table:first-child,
.content-formatted pre:first-child,
.content-formatted code:first-child,
.content-formatted iframe:first-child,
.content-formatted table:first-child,
.content-formatted form:first-child,
.content-formatted .table-container:first-child,
.content-formatted .edy-positionable-container-left-block:first-child,
.content-formatted .edy-positionable-container-center-block:first-child,
.content-formatted .edy-positionable-container-right-block:first-child,
.content-formatted .edy-texteditor-container-wrapper-left-block:first-child,
.content-formatted .edy-texteditor-container-wrapper-center:first-child,
.content-formatted .edy-texteditor-container-wrapper-right-block:first-child,
.content-formatted .edy-positionable-container-maxwidth:first-child {
margin-top: 0;
}
.content-formatted h1:last-child,
.content-formatted h2:last-child,
.content-formatted h3:last-child,
.content-formatted h4:last-child,
.content-formatted h5:last-child,
.content-formatted h6:last-child,
.content-formatted p:last-child,
.content-formatted ul:last-child,
.content-formatted ol:last-child,
.content-formatted dl:last-child,
.content-formatted table:last-child,
.content-formatted pre:last-child,
.content-formatted code:last-child,
.content-formatted iframe:last-child,
.content-formatted table:last-child,
.content-formatted form:last-child,
.content-formatted .table-container:last-child,
.content-formatted .edy-positionable-container-left-block:last-child,
.content-formatted .edy-positionable-container-center-block:last-child,
.content-formatted .edy-positionable-container-right-block:last-child,
.content-formatted .edy-texteditor-container-wrapper-left-block:last-child,
.content-formatted .edy-texteditor-container-wrapper-center:last-child,
.content-formatted .edy-texteditor-container-wrapper-right-block:last-child,
.content-formatted .edy-positionable-container-maxwidth:last-child {
margin-bottom: 0;
}
.content-formatted h1, .content-formatted h2, .content-formatted h3, .content-formatted h4, .content-formatted h5, .content-formatted h6 {
color: #1b2124;
word-break: break-word;
Expand Down
Loading

0 comments on commit e8cd528

Please sign in to comment.