From 4a5a8f52505204749094481f4dbf3ecf1589b9eb Mon Sep 17 00:00:00 2001 From: elisejakob Date: Wed, 30 Jan 2019 14:56:02 +0100 Subject: [PATCH] style page, grid progress --- src/components/Pagination.js | 26 +++++-------- src/css/base.scss | 17 +++++++-- src/css/blog.scss | 71 +++++++++++++++++++++++++++++++++++- src/css/main.scss | 3 +- src/css/page.scss | 29 +++++++++++++++ src/css/variables.scss | 7 +++- src/templates/page.js | 2 +- src/templates/post.js | 2 +- 8 files changed, 133 insertions(+), 24 deletions(-) create mode 100644 src/css/page.scss diff --git a/src/components/Pagination.js b/src/components/Pagination.js index 89c3a98..8edcdc1 100644 --- a/src/components/Pagination.js +++ b/src/components/Pagination.js @@ -6,22 +6,16 @@ const Pagination = ({ pageContext, pathPrefix }) => { return ( ) } diff --git a/src/css/base.scss b/src/css/base.scss index 4488ccd..bf846cd 100644 --- a/src/css/base.scss +++ b/src/css/base.scss @@ -46,7 +46,7 @@ a { } p { - max-width: 32rem; + max-width: $width-s; margin: 0 auto 2rem; } @@ -69,8 +69,19 @@ h3 { img { max-width: 100%; + height: auto; } -.section-title { - margin-bottom: 1.6rem; +.table-wrap { + max-width: 100%; + overflow: scroll; + + line-height: 1.3; + + table, td, th { + border: 1px solid black; + } + td, th { + padding: 0.6rem 0.8rem; + } } \ No newline at end of file diff --git a/src/css/blog.scss b/src/css/blog.scss index b3b611e..875f957 100644 --- a/src/css/blog.scss +++ b/src/css/blog.scss @@ -1,5 +1,6 @@ .blog { background: $color-yellow; + padding-bottom: 1rem; } .post-list { @@ -8,7 +9,7 @@ } .post { - width: 26rem; + width: $width-xs; padding: 1.2rem; margin: 0 1rem 1rem 0; @@ -31,6 +32,29 @@ font-size: 0.8rem; margin-bottom: 1rem; } + + &-content { + max-width: $width-m; + margin: 0 auto; + + img, div { + max-width: 100%; + } + + ul { + max-width: $width-s; + margin: 0 auto 1rem; + } + + ul, p { + margin: 0 auto 1.6rem; + } + + h1, h2, h3, h4, h5, h6 { + max-width: $width-s; + margin-top: 3.6rem; + } + } } .read-more { @@ -47,4 +71,49 @@ background: $color-yellow; color: $color-black; } +} + +.pagination { + text-align: center; + background: $color-yellow; + padding-bottom: 3rem; + a { + display: inline-block; + padding: 0.3rem 1rem; + background: $color-black; + color: $color-orange; + text-decoration: none; + border-radius: 10rem; + margin-right: 0.6rem; + + &:hover { + background: $color-orange; + color: $color-black; + } + } +} + +.post-page { + .section-title { + font-size: 4rem; + line-height: 1.14; + } + .post-meta, .section-title { + max-width: $width-l; + margin: 0 auto 1rem; + } + .post-meta { + p { + margin-left: 0; + } + } +} + +.wp-caption { + max-width: 100%; + margin-bottom: 3rem; + + &-text { + font-size: 0.8rem; + } } \ No newline at end of file diff --git a/src/css/main.scss b/src/css/main.scss index d7bd089..4d55d1d 100644 --- a/src/css/main.scss +++ b/src/css/main.scss @@ -4,4 +4,5 @@ @import 'base.scss'; @import 'header.scss'; -@import 'blog.scss'; \ No newline at end of file +@import 'blog.scss'; +@import 'page.scss'; \ No newline at end of file diff --git a/src/css/page.scss b/src/css/page.scss new file mode 100644 index 0000000..9750406 --- /dev/null +++ b/src/css/page.scss @@ -0,0 +1,29 @@ +.section-title { + margin-bottom: 1.6rem; + font-weight: 900; +} + +.page { + &-content { + max-width: $width-m; + margin: 0 auto; + + img, div { + max-width: 100%; + } + + ul { + max-width: $width-s; + margin: 0 auto 1rem; + } + + ul, p { + margin: 0 auto 1.6rem; + } + + h1, h2, h3, h4, h5, h6 { + max-width: $width-s; + margin-top: 3.6rem; + } + } +} \ No newline at end of file diff --git a/src/css/variables.scss b/src/css/variables.scss index c0299c0..9212a5b 100644 --- a/src/css/variables.scss +++ b/src/css/variables.scss @@ -11,4 +11,9 @@ $color-white: #FAFAFA; $color-background: $color-black; $color-text: $color-white; $color-link: $color-orange; -$color-hover: $color-yellow; \ No newline at end of file +$color-hover: $color-yellow; + +$width-xs: 24rem; +$width-s: 32rem; +$width-m: 42rem; +$width-l: 54rem; \ No newline at end of file diff --git a/src/templates/page.js b/src/templates/page.js index f1e7ffe..bfff453 100644 --- a/src/templates/page.js +++ b/src/templates/page.js @@ -8,7 +8,7 @@ export const PageTemplate = ({ title, content }) => {

{title}

diff --git a/src/templates/post.js b/src/templates/post.js index 5ca06e9..f25ad27 100644 --- a/src/templates/post.js +++ b/src/templates/post.js @@ -23,7 +23,7 @@ export const BlogPostTemplate = ({ {author.name}

-
+
{categories && categories.length ? (

Categories