From 1a7bbcaafca57cd22ce38927fe6541cf7d3cb95d Mon Sep 17 00:00:00 2001 From: Coby Chapple Date: Mon, 8 Jul 2013 15:52:44 +0100 Subject: [PATCH] reuse existing article and aside styles, reducing nested markup --- site/_includes/news_item.html | 4 +- site/_layouts/news.html | 4 +- site/_layouts/news_item.html | 33 +++++----- site/css/style.css | 112 ++++++++++------------------------ site/news/index.md | 9 +-- site/news/releases/index.md | 7 +-- 6 files changed, 51 insertions(+), 118 deletions(-) diff --git a/site/_includes/news_item.html b/site/_includes/news_item.html index 61a60741..70069dea 100644 --- a/site/_includes/news_item.html +++ b/site/_includes/news_item.html @@ -1,4 +1,4 @@ -
+
+ diff --git a/site/_layouts/news.html b/site/_layouts/news.html index e4830af5..8f7945f3 100644 --- a/site/_layouts/news.html +++ b/site/_layouts/news.html @@ -8,9 +8,7 @@ layout: default {% include news_contents_mobile.html %}
-
- {{ content }} -
+ {{ content }}
{% include news_contents.html %} diff --git a/site/_layouts/news_item.html b/site/_layouts/news_item.html index d5ae1099..9fc19f17 100644 --- a/site/_layouts/news_item.html +++ b/site/_layouts/news_item.html @@ -2,22 +2,17 @@ layout: news --- -
-
-
-

- {{ page.title }} - -

-

- {{ content }} -

-

- Posted on {{ page.date | date_to_string }} - by @{{ page.author }}, - filed in {{ page.categories | array_to_sentence_string }} -

-
-
-
-
+
+

+ {{ page.title }} + +

+

+ {{ content }} +

+

+ Posted on {{ page.date | date_to_string }} + by @{{ page.author }}, + filed in {{ page.categories | array_to_sentence_string }} +

+
diff --git a/site/css/style.css b/site/css/style.css index 9d886853..700f7ca4 100644 --- a/site/css/style.css +++ b/site/css/style.css @@ -359,40 +359,38 @@ body > footer a:hover img { } } -/* Documentation */ +/* Article - Used for both docs and news */ -.docs .content { - padding: 0; -} -.docs article { +article { background: #444; border-radius: 10px; padding: 20px; margin: 0 10px; box-shadow: 0 3px 10px rgba(0,0,0,.1); - min-height: 800px; font-size: 16px; } @media (max-width: 568px){ - .docs article { + article { margin: 0; } } @media (min-width: 768px){ - .docs article { + article { padding: 40px 40px 30px; font-size: 21px; } } -.docs aside { +/* Right-side nav - used by both docs and news */ + +aside { padding-top: 30px; } -.docs aside h4 { +aside h4 { text-transform: uppercase; font-size: 14px; font-weight: 700; @@ -402,20 +400,24 @@ body > footer a:hover img { border-bottom: 1px solid #c00; } -.docs aside ul { +aside ul { padding-left: 0; } -.docs aside li { +aside ul:first-child { + margin-top: 0; +} + +aside li { list-style-type: none; } -.docs aside li a { +aside li a { font-size: 16px; position: relative } -.docs aside li.current a:before { +aside li.current a:before { content: ""; border-color: transparent transparent transparent #444; border-style: solid; @@ -427,6 +429,16 @@ body > footer a:hover img { left: -30px; } +/* Documentation */ + +.docs article { + min-height: 800px; +} + +.docs .content { + padding: 0; +} + .section-nav { text-align: center; padding-top: 40px; @@ -501,82 +513,20 @@ body > footer a:hover img { /* News */ -.news .entry { - background: #444; - border-radius: 10px; - padding: 20px; - margin: 0 10px; - box-shadow: 0 3px 10px rgba(0,0,0,.1); - font-size: 16px; -} - -@media (max-width: 568px){ - .news .entry { - margin: 0 0 20px 0; - } -} - -@media (min-width: 768px){ - .news .entry { - font-size: 21px; - margin-bottom: 20px; - } -} - -.news .post { - padding: 40px; -} - - -.news .listing h2 { +article h2:first-child { margin-top: 0; } +.news article { + margin-bottom: 20px; +} + .news .post-details { padding: 0; font-size: 0.8em; color: gray; } -.news aside { - padding-left: 20px; -} - -.news aside h4 { - text-transform: uppercase; - font-size: 14px; - font-weight: 700; - padding: 0 0 10px 29px; - margin-left: -29px; - display: inline-block; - border-bottom: 1px solid #c00; -} - -.news aside ul { - padding-left: 0; -} - -.news aside li { - list-style-type: none; -} - -.news aside li a { - font-size: 16px; - position: relative -} - -.news aside li.current a:before { - content: ""; - border-color: transparent transparent transparent #444; - border-style: solid; - border-width: 10px; - width: 0; - height: 0; - position: absolute; - top: 0; - left: -30px; -} - /* Code Highlighting */ diff --git a/site/news/index.md b/site/news/index.md index d9f91f46..94139fc0 100644 --- a/site/news/index.md +++ b/site/news/index.md @@ -5,11 +5,6 @@ permalink: /news/ author: all --- -
- {% for post in site.posts %} -
+{% for post in site.posts %} {% include news_item.html %} -
- {% endfor %} -
-
+{% endfor %} diff --git a/site/news/releases/index.md b/site/news/releases/index.md index d3f6d98b..08349916 100644 --- a/site/news/releases/index.md +++ b/site/news/releases/index.md @@ -5,11 +5,6 @@ permalink: /news/releases/ author: all --- -
{% for post in site.categories.releases %} -
-{% include news_item.html %} -
+ {% include news_item.html %} {% endfor %} -
-