Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lay out content and widget areas with inline-block instead of floats. #682

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions layouts/content-sidebar.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ Layout: Content-Sidebar
*/

.content-area {
float: left;
margin: 0 -25% 0 0;
display: inline-block;
margin: 0 -25% 0 -6px; /* left margin offsets the inline-block spacing, see http://css-tricks.com/fighting-the-space-between-inline-block-elements/ */
padding-left: 6px;
width: 100%;
}
.site-main {
margin: 0 25% 0 0;
}
.site-content .widget-area {
float: right;
display: inline-block;
overflow: hidden;
width: 25%;
}
Expand Down
12 changes: 10 additions & 2 deletions layouts/sidebar-content.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,26 @@ Theme Name: _s
Layout: Sidebar-Content
*/

.site-content {
direction: rtl; /* Swap the positioning of .content-area and .widget-area without affecting the source order */
}

.content-area {
float: right;
display: inline-block;
margin: 0 0 0 -25%;
width: 100%;
direction: ltr;
}
.site-main {
margin: 0 0 0 25%;
}
.site-content .widget-area {
float: left;
display: inline-block;
margin-left: -6px; /* offset the inline-block spacing, see http://css-tricks.com/fighting-the-space-between-inline-block-elements/ */
padding-left: 6px;
overflow: hidden;
width: 25%;
direction: ltr;
}
.site-footer {
clear: both;
Expand Down
5 changes: 3 additions & 2 deletions sass/elements/_elements.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ html {

*,
*:before,
*:after { /* Inherit box-sizing to make it easier to change the property for components that leverage other behavior; see http://css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-practice/ */
box-sizing: inherit;
*:after {
box-sizing: inherit; /* Inherit box-sizing to make it easier to change the property for components that leverage other behavior; see http://css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-practice/ */
vertical-align: top;
}

body {
Expand Down
7 changes: 4 additions & 3 deletions sass/layout/_content-sidebar.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.content-area {
float: left;
margin: 0 (-$size__site-sidebar) 0 0;
display: inline-block;
margin: 0 (-$size__site-sidebar) 0 $margin__offset-inline-block-spacing;
padding-left: $margin__offset-inline-block-spacing * -1;
width: $size__site-main;
}

Expand All @@ -9,7 +10,7 @@
}

.site-content .widget-area {
float: right;
display: inline-block;
overflow: hidden;
width: $size__site-sidebar;
}
Expand Down
12 changes: 10 additions & 2 deletions sass/layout/_sidebar-content.scss
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
.site-content {
direction: rtl; /* Swap the positioning of .content-area and .widget-area without affecting the source order */
}

.content-area {
float: right;
display: inline-block;
margin: 0 0 0 (-$size__site-sidebar);
width: $size__site-main;
direction: ltr;
}

.site-main {
margin: 0 0 0 $size__site-sidebar;
}

.site-content .widget-area {
float: left;
display: inline-block;
margin-left: $margin__offset-inline-block-spacing;
padding-left: $margin__offset-inline-block-spacing * -1;
overflow: hidden;
width: $size__site-sidebar;
direction: ltr;
}

.site-footer {
Expand Down
3 changes: 0 additions & 3 deletions sass/modules/_clearings.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
.comment-content:after,
.site-header:before,
.site-header:after,
.site-content:before,
.site-content:after,
.site-footer:before,
.site-footer:after {
@include clearfix;
Expand All @@ -17,7 +15,6 @@
.entry-content:after,
.comment-content:after,
.site-header:after,
.site-content:after,
.site-footer:after {
@include clearfix-after;
}
3 changes: 2 additions & 1 deletion sass/variables-site/_structure.scss
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
$size__site-main: 100%;
$size__site-sidebar: 25%;
$size__site-sidebar: 25%;
$margin__offset-inline-block-spacing: -6px; /* http://css-tricks.com/fighting-the-space-between-inline-block-elements/ */
8 changes: 3 additions & 5 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,9 @@ html {

*,
*:before,
*:after { /* Inherit box-sizing to make it easier to change the property for components that leverage other behavior; see http://css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-practice/ */
box-sizing: inherit;
*:after {
box-sizing: inherit; /* Inherit box-sizing to make it easier to change the property for components that leverage other behavior; see http://css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-practice/ */
vertical-align: top;
}

body {
Expand Down Expand Up @@ -700,8 +701,6 @@ a:active {
.comment-content:after,
.site-header:before,
.site-header:after,
.site-content:before,
.site-content:after,
.site-footer:before,
.site-footer:after {
content: "";
Expand All @@ -712,7 +711,6 @@ a:active {
.entry-content:after,
.comment-content:after,
.site-header:after,
.site-content:after,
.site-footer:after {
clear: both;
}
Expand Down