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

Improve page and archive layouts #1166

Merged
merged 9 commits into from
Aug 8, 2017
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- Add Greek localized UI text strings. [#1159](https://github.com/mmistakes/minimal-mistakes/pull/1159)
- Remove blank YAML Front Matter from JavaScript banner. [#1158](https://github.com/mmistakes/minimal-mistakes/issues/1158)
- Improve `page` and `archive` layouts to visually center main content and harmonize sidebar widths and placement. [#1166](https://github.com/mmistakes/minimal-mistakes/pull/1166)

### Maintenance

Expand Down
24 changes: 7 additions & 17 deletions _sass/minimal-mistakes/_archive.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
.archive {
margin-bottom: 2em;

@include breakpoint($medium) {
width: span(12 of 12);
}

@include breakpoint($large) {
float: right;
padding-left: gutter(0.5 of 12);
width: span(10 of 12);
width: calc(100% - #{$right-sidebar-width-narrow});
padding-right: $right-sidebar-width-narrow;
}

@include breakpoint($x-large) {
width: calc(100% - #{$right-sidebar-width});
padding-right: $right-sidebar-width;
}

a {
Expand Down Expand Up @@ -84,17 +85,6 @@
========================================================================== */

.list__item {
@include breakpoint($medium) {
padding-right: $right-sidebar-width-narrow;
}

@include breakpoint($large) {
padding-right: $right-sidebar-width;
}

@include breakpoint($x-large) {
padding-right: $right-sidebar-width-wide;
}

.page__meta {
margin: 0 0 4px;
Expand Down
1 change: 1 addition & 0 deletions _sass/minimal-mistakes/_navigation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@

.pagination {
@include clearfix();
float: left;
margin-top: 1em;
padding-top: 1em;
width: 100%;
Expand Down
19 changes: 13 additions & 6 deletions _sass/minimal-mistakes/_page.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@

@include breakpoint($large) {
float: right;
width: span(10 of 12);
padding-left: gutter(0.5 of 12);
padding-right: gutter(2 of 12);
width: calc(100% - #{$right-sidebar-width-narrow});
padding-right: $right-sidebar-width-narrow;
}

@include breakpoint($x-large) {
width: calc(100% - #{$right-sidebar-width});
padding-right: $right-sidebar-width;
}

.page__inner-wrap {
Expand All @@ -39,6 +43,7 @@
.page__content,
.page__meta,
.page__share {
position: relative;
float: left;
margin-left: 0;
margin-right: 0;
Expand Down Expand Up @@ -409,9 +414,11 @@

@include breakpoint($large) {
float: right;
width: span(10 of 12);
padding-left: gutter(0.5 of 12);
padding-right: gutter(2 of 12);
width: calc(100% - #{$right-sidebar-width-narrow});
}

@include breakpoint($x-large) {
width: calc(100% - #{$right-sidebar-width});
}

a {
Expand Down
13 changes: 6 additions & 7 deletions _sass/minimal-mistakes/_sidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@
}
}

@include breakpoint($x-large) {
padding-right: 0;
}

h2, h3, h4, h5, h6 {
margin-bottom: 0;
font-family: $sans-serif-narrow;
Expand All @@ -55,15 +51,18 @@
margin-bottom: 1em;

@include breakpoint($large) {
position: relative;
float: right;
position: absolute;
top: 0;
right: 0;
width: $right-sidebar-width-narrow;
margin-left: span(0.5 of 12);
margin-right: -1 * $right-sidebar-width-narrow;
padding-left: 1em;
z-index: 10;
}

@include breakpoint($x-large) {
width: $right-sidebar-width;
margin-right: -1 * $right-sidebar-width;
}
}

Expand Down
3 changes: 2 additions & 1 deletion docs/_docs/18-history.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ permalink: /docs/history/
excerpt: "Change log of enhancements and bug fixes made to the theme."
sidebar:
nav: docs
last_modified_at: 2017-08-07T20:21:45-04:00
last_modified_at: 2017-08-08T09:14:21-04:00
---

## Unreleased
Expand All @@ -13,6 +13,7 @@ last_modified_at: 2017-08-07T20:21:45-04:00

- Add Greek localized UI text strings. [#1159](https://github.com/mmistakes/minimal-mistakes/pull/1159)
- Remove blank YAML Front Matter from JavaScript banner. [#1158](https://github.com/mmistakes/minimal-mistakes/issues/1158)
- Improve `page` and `archive` layouts to visually center main content and harmonize sidebar widths and placement. [#1166](https://github.com/mmistakes/minimal-mistakes/pull/1166)

### Maintenance

Expand Down
100 changes: 100 additions & 0 deletions docs/_posts/2012-01-03-layout-table-of-contents-bottom-post.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
---
title: "Layout: Post with Table Of Contents Included at Bottom"
header:
image: assets/images/unsplash-image-9.jpg
caption: "Photo credit: [**Unsplash**](https://unsplash.com)"
tags:
- table of contents
---

Testing Kramdown auto-generated table of contents included near the end of post content. If positioned correctly with CSS, it should appear in aligned (and to the right) of the main content.

```liquid
{% raw %}{% include toc title="Unique Title" icon="file-text" %}{% endraw %}
```

## HTML Elements

Below is just about everything you'll need to style in the theme. Check the source code to see the many embedded elements within paragraphs.

<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
<h6>Heading 6</h6>

## Body text

Lorem ipsum dolor sit amet, test link adipiscing elit. **This is strong**. Nullam dignissim convallis est. Quisque aliquam.

![Smithsonian Image]({{ site.url }}{{ site.baseurl }}/assets/images/3953273590_704e3899d5_m.jpg)
{: .image-right}

*This is emphasized*. Donec faucibus. Nunc iaculis suscipit dui. 53 = 125. Water is H2O. Nam sit amet sem. Aliquam libero nisi, imperdiet at, tincidunt nec, gravida vehicula, nisl. The New York Times (That’s a citation). Underline.Maecenas ornare tortor. Donec sed tellus eget sapien fringilla nonummy. Mauris a ante. Suspendisse quam sem, consequat at, commodo vitae, feugiat in, nunc. Morbi imperdiet augue quis tellus.

HTML and CSS are our tools. Mauris a ante. Suspendisse quam sem, consequat at, commodo vitae, feugiat in, nunc. Morbi imperdiet augue quis tellus. Praesent mattis, massa quis luctus fermentum, turpis mi volutpat justo, eu volutpat enim diam eget metus.

### Blockquotes

> Lorem ipsum dolor sit amet, test link adipiscing elit. Nullam dignissim convallis est. Quisque aliquam.

## List Types

### Ordered Lists

1. Item one
1. sub item one
2. sub item two
3. sub item three
2. Item two

### Unordered Lists

* Item one
* Item two
* Item three

## Tables

| Header1 | Header2 | Header3 |
|:--------|:-------:|--------:|
| cell1 | cell2 | cell3 |
| cell4 | cell5 | cell6 |
|----
| cell1 | cell2 | cell3 |
| cell4 | cell5 | cell6 |
|=====
| Foot1 | Foot2 | Foot3
{: rules="groups"}

## Code Snippets

```css
#container {
float: left;
margin: 0 -240px 0 0;
width: 100%;
}
```

## Buttons

Make any link standout more when applying the `.btn` class.

```html
<a href="#" class="btn btn-success">Success Button</a>
```

<div markdown="0"><a href="#" class="btn">Primary Button</a></div>
<div markdown="0"><a href="#" class="btn btn--success">Success Button</a></div>
<div markdown="0"><a href="#" class="btn btn--warning">Warning Button</a></div>
<div markdown="0"><a href="#" class="btn btn--danger">Danger Button</a></div>
<div markdown="0"><a href="#" class="btn btn--info">Info Button</a></div>

## Notices

**Watch out!** You can also add notices by appending `{: .notice}` to a paragraph.
{: .notice}

{% include toc title="Unique Title" icon="file-text" %}
2 changes: 1 addition & 1 deletion docs/_posts/2012-01-03-layout-table-of-contents-post.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,4 @@ Make any link standout more when applying the `.btn` class.
## Notices

**Watch out!** You can also add notices by appending `{: .notice}` to a paragraph.
{: .notice}
{: .notice}
24 changes: 7 additions & 17 deletions docs/_sass/minimal-mistakes/_archive.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
.archive {
margin-bottom: 2em;

@include breakpoint($medium) {
width: span(12 of 12);
}

@include breakpoint($large) {
float: right;
padding-left: gutter(0.5 of 12);
width: span(10 of 12);
width: calc(100% - #{$right-sidebar-width-narrow});
padding-right: $right-sidebar-width-narrow;
}

@include breakpoint($x-large) {
width: calc(100% - #{$right-sidebar-width});
padding-right: $right-sidebar-width;
}

a {
Expand Down Expand Up @@ -84,17 +85,6 @@
========================================================================== */

.list__item {
@include breakpoint($medium) {
padding-right: $right-sidebar-width-narrow;
}

@include breakpoint($large) {
padding-right: $right-sidebar-width;
}

@include breakpoint($x-large) {
padding-right: $right-sidebar-width-wide;
}

.page__meta {
margin: 0 0 4px;
Expand Down
1 change: 1 addition & 0 deletions docs/_sass/minimal-mistakes/_navigation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@

.pagination {
@include clearfix();
float: left;
margin-top: 1em;
padding-top: 1em;
width: 100%;
Expand Down
19 changes: 13 additions & 6 deletions docs/_sass/minimal-mistakes/_page.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@

@include breakpoint($large) {
float: right;
width: span(10 of 12);
padding-left: gutter(0.5 of 12);
padding-right: gutter(2 of 12);
width: calc(100% - #{$right-sidebar-width-narrow});
padding-right: $right-sidebar-width-narrow;
}

@include breakpoint($x-large) {
width: calc(100% - #{$right-sidebar-width});
padding-right: $right-sidebar-width;
}

.page__inner-wrap {
Expand All @@ -39,6 +43,7 @@
.page__content,
.page__meta,
.page__share {
position: relative;
float: left;
margin-left: 0;
margin-right: 0;
Expand Down Expand Up @@ -409,9 +414,11 @@

@include breakpoint($large) {
float: right;
width: span(10 of 12);
padding-left: gutter(0.5 of 12);
padding-right: gutter(2 of 12);
width: calc(100% - #{$right-sidebar-width-narrow});
}

@include breakpoint($x-large) {
width: calc(100% - #{$right-sidebar-width});
}

a {
Expand Down
13 changes: 6 additions & 7 deletions docs/_sass/minimal-mistakes/_sidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@
}
}

@include breakpoint($x-large) {
padding-right: 0;
}

h2, h3, h4, h5, h6 {
margin-bottom: 0;
font-family: $sans-serif-narrow;
Expand All @@ -55,15 +51,18 @@
margin-bottom: 1em;

@include breakpoint($large) {
position: relative;
float: right;
position: absolute;
top: 0;
right: 0;
width: $right-sidebar-width-narrow;
margin-left: span(0.5 of 12);
margin-right: -1 * $right-sidebar-width-narrow;
padding-left: 1em;
z-index: 10;
}

@include breakpoint($x-large) {
width: $right-sidebar-width;
margin-right: -1 * $right-sidebar-width;
}
}

Expand Down
Loading