From 2e076a93470cf8ffce2ebf3bbdd44ee12a5816f6 Mon Sep 17 00:00:00 2001 From: GBKS Date: Mon, 26 Apr 2021 16:05:03 +0200 Subject: [PATCH 1/5] Split out components to make CSS more manageable The article CSS file has grown hugely with recent component additions. This first update splits them into separate files before making any changes. --- _sass/minima/_article.scss | 562 ++---------------- _sass/minima/_base.scss | 1 - _sass/minima/article/_dl.scss | 93 +++ _sass/minima/article/_do.scss | 91 +++ _sass/minima/article/_fact.scss | 72 +++ _sass/minima/article/_footnotes.scss | 27 + _sass/minima/article/_image-gallery.scss | 47 ++ .../minima/article/_image-slide-gallery.scss | 94 +++ _sass/minima/article/_tip.scss | 105 ++++ _sass/minima/initialize.scss | 7 + 10 files changed, 570 insertions(+), 529 deletions(-) create mode 100644 _sass/minima/article/_dl.scss create mode 100644 _sass/minima/article/_do.scss create mode 100644 _sass/minima/article/_fact.scss create mode 100644 _sass/minima/article/_footnotes.scss create mode 100644 _sass/minima/article/_image-gallery.scss create mode 100644 _sass/minima/article/_image-slide-gallery.scss create mode 100644 _sass/minima/article/_tip.scss diff --git a/_sass/minima/_article.scss b/_sass/minima/_article.scss index 945594adc..e6e07dcd4 100644 --- a/_sass/minima/_article.scss +++ b/_sass/minima/_article.scss @@ -45,271 +45,6 @@ article.guide { } } - .do { - margin-top: $spacing-unit; - display: flex; - flex-wrap: wrap; - background-color: #f8f8f8; - @include responsive('padding', 20, 30); - - .icon { - flex-grow: 0; - display: flex; - align-items: center; - padding-top: 2px; - - &.-green { - svg { - background-color: $green; - } - } - - &.-red { - svg { - background-color: $red; - } - } - - svg { - display: block; - background-color: $blue; - border-radius: 3px; - width: 24px; - height: 24px; - color: white; - vertical-align: middle; - transform: translateY(-2px); - } - } - - h6 { - margin: 0 0 0 10px; - padding: 0px 0 0 0; - font-size: 18px; - font-weight: 500; - flex-grow: 1; - flex-basis: 50%; - - &:before { - display: none; - } - } - - .copy { - p { - & + figure { - margin-top: 10px; - } - } - - figure { - &:last-child { - margin-bottom: 0; - } - } - } - } - - .dos { - display: flex; - - @include media-query(small) { - flex-direction: column; - - .do { - & + .do { - margin-top: 20px; - } - } - } - - @include media-query(medium-up) { - .do { - flex-basis: 30%; - flex-grow: 1; - - & + .do { - margin-left: 40px; - } - } - } - } - - .tip, - .recommendation { - margin-top: $spacing-unit; - padding: 25px 25px 20px 25px; - box-sizing: border-box; - - h6 { - margin: 0; - padding: 0; - font-size: 22px; - font-weight: 500; - - &:before { - display: none; - } - - svg { - display: inline-block; - margin-right: 10px; - background-color: $blue; - border-radius: 3px; - width: 24px; - height: 24px; - color: white; - vertical-align: middle; - transform: translateY(-2px); - } - } - - p { - margin: 10px 0 0 0; - } - - &.-red { - background-color: rgba($red, 0.1); - - h6 { - svg { - background-color: $red; - } - } - } - - &.-green { - background-color: rgba($green, 0.1); - - h6 { - svg { - background-color: $green; - } - } - } - - &.-blue { - background-color: rgba($blue, 0.1); - - h6 { - svg { - background-color: $blue; - } - } - } - - &.-orange { - background-color: rgba($bitcoin-yellow, 0.1); - - h6 { - svg { - background-color: $bitcoin-yellow; - } - } - } - - &.-yellow { - background-color: rgba($yellow, 0.1); - - h6 { - svg { - background-color: $yellow; - } - } - } - } - - .tip { - background-color: rgba($blue, 0.1); - - h6 { - svg { - background-color: $blue; - } - } - } - - .recommendation { - background-color: rgba($bitcoin-yellow, 0.1); - - h6 { - svg { - background-color: $bitcoin-yellow; - } - } - } - - .fact { - margin-top: $spacing-unit; - display: flex; - border: 1px solid #DEDEDE; - align-items: stretch; - - .icon { - padding: 10px 20px; - border-right: 1px solid #DEDEDE; - flex-grow: 0; - display: flex; - align-items: center; - - &.-green { - svg { - background-color: $green; - } - } - - &.-red { - svg { - background-color: $red; - } - } - - svg { - display: inline-block; - background-color: $blue; - border-radius: 3px; - width: 24px; - height: 24px; - color: white; - vertical-align: middle; - transform: translateY(-2px); - } - } - - .copy { - padding: 20px; - flex-grow: 1; - - h6 { - margin: 0; - padding: 0; - font-size: 18px; - font-weight: 500; - - &:before { - display: none; - } - } - - ul, ol { - margin-left: 0; - - &:first-child { - margin-top: 5px; - } - } - - p { - margin: 5px 0 0 0; - } - } - - & + .fact { - margin-top: 0; - border-top: 0; - } - } - a.video-link, a.prototype-link { position: relative; @@ -405,14 +140,14 @@ article.guide { & > .-float-left, & > .center .-float-left { float: left; - margin-right: 15px; + margin-right: $spacing-unit / 2; max-width: 50%; } & > .-float-right, & > .center .-float-right { float: right; - margin-left: 15px; + margin-left: $spacing-unit / 2; max-width: 50%; } @@ -420,18 +155,30 @@ article.guide { & > .-float-left-desktop, & > .center .-float-left-desktop { float: left; - margin-right: 15px; + margin-right: $spacing-unit / 2; max-width: 50%; } & > .-float-right-desktop, & > .center .-float-right-desktop { float: right; - margin-left: 15px; + margin-left: $spacing-unit / 2; max-width: 50%; } } + & > .-float-right, + & > .center .-float-right { + @include media-query(large) { + margin-top: 0; + margin-bottom: 0; + float: right; + margin-left: $spacing-unit; + } + } + + // Full width images stretch all the way, up to 1600px width. + & > .-full-width { display: flex; flex-direction: column; @@ -448,6 +195,21 @@ article.guide { } } + figure.-full-width { + figcaption { + margin-left: $spacing-unit / 2; + margin-right: $spacing-unit / 2; + } + } + + // Width images can stretch beyond the regular content, but maintain padding left and right. + + & > .-wide { + display: flex; + flex-direction: column; + align-items: center; + } + & > iframe.-full-width { @include media-query(medium-down) { margin-left: 0; @@ -460,7 +222,7 @@ article.guide { } } - & > *:not(.-full-width) { + & > *:not(.-full-width, .-wide) { @include media-query(medium-down) { } @@ -472,6 +234,8 @@ article.guide { } } + // Other + li { margin-left: 18px; } @@ -505,263 +269,5 @@ article.guide { margin-top: $spacing-unit * 1; margin-bottom: $spacing-unit * 1; } - - } - - // & > .-float-left, - // & > .center .-float-left { - // @include media-query(large) { - // margin-top: $spacing-unit * 1; - // margin-bottom: $spacing-unit * 1; - // } - // } - - .image-gallery { - display: flex; - background-color: #f8f8f8; - justify-content: center; - max-width: none !important; - - figure { - margin-top: 0; - margin-bottom: 0; - float: left; - margin-right: 30px; - - img { - box-shadow: 0 20px 10px -8px rgba(black, 0.05); - border: 1px solid rgba(black, 0.1); - } - } - - @include media-query(small) { - flex-direction: column; - margin-left: -15px; - margin-right: -15px; - padding: 10px 15px; - } - - @include media-query(medium-up) { - margin-left: -30px; - margin-right: -30px; - padding: 30px 30px 15px 30px; - - figure { - & + figure { - margin-left: 40px; - } - } - } - } - - .image-slide-gallery { - margin-top: 30px; - margin-bottom: 30px; - background-color: #f8f8f8; - justify-content: left; - max-width: none !important; - display: flex; - overflow: hidden; - overflow-x: scroll; - -webkit-overflow-scrolling: touch; - scroll-snap-type: x mandatory; - - figure { - flex-shrink: 0; - margin-top: 0; - margin-bottom: 0; - width: min-content; - - img { - max-width: none; - height: auto; - } - - figcaption { - p { - margin-top: 0; - } - } - } - - &:before, - &:after { - display: block; - content: ''; - position: relative; - height: 20px; - flex-shrink: 0; - flex-grow: 1; - } - - @include media-query(small) { - padding: 30px 0; - - figure { - flex-basis: calc(100vw - 180px); - - & + figure { - margin-left: 30px; - } - } - - &:before, - &:after { - flex-basis: 30px; - } - } - - @include media-query(medium-down) { - margin-left: -15px; - margin-right: -15px; - } - - @include media-query(medium-up) { - padding: 30px 0 30px 0; - - figure { - & + figure { - margin-left: 30px; - } - } - - &:before, - &:after { - flex-basis: 30px; - } - } - - @include media-query(large) { - margin-left: -30px; - margin-right: -30px; - } - } - - & > .-float-right, - & > .center .-float-right { - @include media-query(large) { - margin-top: 0; - margin-bottom: 0; - float: right; - margin-left: 30px; - } - } -} - -dl { - display: flex; - flex-wrap: wrap; - align-items: stretch; - - dt, - dd { - display: flex; - padding: 20px 30px; - background-color: rgba($blue, 0.1); - - p { - margin: 0; - } - - &.-green { - background-color: rgba($green, 0.1); - } - - &.-red { - background-color: rgba($red, 0.1); - } - - &.-blue { - background-color: rgba($blue, 0.1); - } - - &.-orange { - background-color: rgba($bitcoin-yellow, 0.1); - } - - &.-yellow { - background-color: rgba($yellow, 0.1); - } - } - - .icon { - display: flex; - align-items: center; - justify-content: center; - - svg { - width: 30px; - height: 30px; - } - } - - @include media-query(small) { - dt, - dd, - .icon { - flex-basis: 100%; - } - - dd { - & + dt { - margin-top: 20px; - } - } - - .icon { - height: 60px; - - svg { - transform: rotate(90deg); - } - } - } - - @include media-query(medium-up) { - dt, - dd { - flex-basis: 30%; - flex-grow: 1; - margin-top: 20px; - - &:first-of-type { - margin-top: 0; - } - } - - .icon { - width: 60px; - margin-top: 20px; - - &:first-of-type { - margin-top: 0; - } - } - } -} - -.footnotes { - padding: 30px; - font-size: 0.8rem; - margin: 60px 0 0; - border: 1px solid rgba(var(--front), 0.05); - box-sizing: border-box; - background: #FDFDFD; - &::before { - content: "REFERENCES"; - display: block; - margin-bottom: 10px; - color: var(--frontHex); - letter-spacing: 1px; - } - ol { - margin: 0; - list-style-position: inside; - li { - margin-left: 0; - p { - display: inline; - } - } } } diff --git a/_sass/minima/_base.scss b/_sass/minima/_base.scss index b2796ae61..1194939a7 100644 --- a/_sass/minima/_base.scss +++ b/_sass/minima/_base.scss @@ -55,7 +55,6 @@ ul, ol, dl, figure, hr { margin-top: $spacing-unit; - margin-bottom: $spacing-unit; border: 1px solid rgba(var(--front), 0.05); border-width: 1px 0 0; } diff --git a/_sass/minima/article/_dl.scss b/_sass/minima/article/_dl.scss new file mode 100644 index 000000000..0e4eb26d8 --- /dev/null +++ b/_sass/minima/article/_dl.scss @@ -0,0 +1,93 @@ +.article { + dl { + display: flex; + flex-wrap: wrap; + align-items: stretch; + + dt, + dd { + display: flex; + padding: 20px 30px; + background-color: rgba($blue, 0.1); + + p { + margin: 0; + } + + &.-green { + background-color: rgba($green, 0.1); + } + + &.-red { + background-color: rgba($red, 0.1); + } + + &.-blue { + background-color: rgba($blue, 0.1); + } + + &.-orange { + background-color: rgba($bitcoin-yellow, 0.1); + } + + &.-yellow { + background-color: rgba($yellow, 0.1); + } + } + + .icon { + display: flex; + align-items: center; + justify-content: center; + + svg { + width: 30px; + height: 30px; + } + } + + @include media-query(small) { + dt, + dd, + .icon { + flex-basis: 100%; + } + + dd { + & + dt { + margin-top: 20px; + } + } + + .icon { + height: 60px; + + svg { + transform: rotate(90deg); + } + } + } + + @include media-query(medium-up) { + dt, + dd { + flex-basis: 30%; + flex-grow: 1; + margin-top: 20px; + + &:first-of-type { + margin-top: 0; + } + } + + .icon { + width: 60px; + margin-top: 20px; + + &:first-of-type { + margin-top: 0; + } + } + } + } +} diff --git a/_sass/minima/article/_do.scss b/_sass/minima/article/_do.scss new file mode 100644 index 000000000..b7ab58a2a --- /dev/null +++ b/_sass/minima/article/_do.scss @@ -0,0 +1,91 @@ +article.guide { + .do { + margin-top: $spacing-unit; + display: flex; + flex-wrap: wrap; + background-color: #f8f8f8; + @include responsive('padding', 20, 30); + + .icon { + flex-grow: 0; + display: flex; + align-items: center; + padding-top: 2px; + + &.-green { + svg { + background-color: $green; + } + } + + &.-red { + svg { + background-color: $red; + } + } + + svg { + display: block; + background-color: $blue; + border-radius: 3px; + width: 24px; + height: 24px; + color: white; + vertical-align: middle; + transform: translateY(-2px); + } + } + + h6 { + margin: 0 0 0 10px; + padding: 0px 0 0 0; + font-size: 18px; + font-weight: 500; + flex-grow: 1; + flex-basis: 50%; + + &:before { + display: none; + } + } + + .copy { + p { + & + figure { + margin-top: 10px; + } + } + + figure { + &:last-child { + margin-bottom: 0; + } + } + } + } + + .dos { + display: flex; + + @include media-query(small) { + flex-direction: column; + + .do { + & + .do { + margin-top: 20px; + } + } + } + + @include media-query(medium-up) { + .do { + flex-basis: 30%; + flex-grow: 1; + + & + .do { + margin-left: 40px; + } + } + } + } +} diff --git a/_sass/minima/article/_fact.scss b/_sass/minima/article/_fact.scss new file mode 100644 index 000000000..a15f58999 --- /dev/null +++ b/_sass/minima/article/_fact.scss @@ -0,0 +1,72 @@ +article.guide { + .fact { + margin-top: $spacing-unit; + display: flex; + border: 1px solid #DEDEDE; + align-items: stretch; + + .icon { + padding: 10px 20px; + border-right: 1px solid #DEDEDE; + flex-grow: 0; + display: flex; + align-items: center; + + &.-green { + svg { + background-color: $green; + } + } + + &.-red { + svg { + background-color: $red; + } + } + + svg { + display: inline-block; + background-color: $blue; + border-radius: 3px; + width: 24px; + height: 24px; + color: white; + vertical-align: middle; + transform: translateY(-2px); + } + } + + .copy { + padding: 20px; + flex-grow: 1; + + h6 { + margin: 0; + padding: 0; + font-size: 18px; + font-weight: 500; + + &:before { + display: none; + } + } + + ul, ol { + margin-left: 0; + + &:first-child { + margin-top: 5px; + } + } + + p { + margin: 5px 0 0 0; + } + } + + & + .fact { + margin-top: 0; + border-top: 0; + } + } +} diff --git a/_sass/minima/article/_footnotes.scss b/_sass/minima/article/_footnotes.scss new file mode 100644 index 000000000..6eb61932a --- /dev/null +++ b/_sass/minima/article/_footnotes.scss @@ -0,0 +1,27 @@ +.article { + .footnotes { + padding: 30px; + font-size: 0.8rem; + margin: 60px 0 0; + border: 1px solid rgba(var(--front), 0.05); + box-sizing: border-box; + background: #FDFDFD; + &::before { + content: "REFERENCES"; + display: block; + margin-bottom: 10px; + color: var(--frontHex); + letter-spacing: 1px; + } + ol { + margin: 0; + list-style-position: inside; + li { + margin-left: 0; + p { + display: inline; + } + } + } + } +} diff --git a/_sass/minima/article/_image-gallery.scss b/_sass/minima/article/_image-gallery.scss new file mode 100644 index 000000000..7b1d19bc1 --- /dev/null +++ b/_sass/minima/article/_image-gallery.scss @@ -0,0 +1,47 @@ +article.guide { + .image-gallery { + display: flex; + background-color: #f8f8f8; + justify-content: center; + max-width: none !important; + + figure { + margin-top: 0; + margin-bottom: 0; + float: left; + margin-right: 30px; + + img { + box-shadow: 0 20px 10px -8px rgba(black, 0.05); + border: 1px solid rgba(black, 0.1); + } + } + + @include media-query(small) { + flex-direction: column; + margin-left: -15px; + margin-right: -15px; + padding: 10px 15px; + + figure { + margin: 0; + + & + figure { + margin-top: $spacing-unit; + } + } + } + + @include media-query(medium-up) { + margin-left: -30px; + margin-right: -30px; + padding: 30px 30px 15px 30px; + + figure { + & + figure { + margin-left: 40px; + } + } + } + } +} diff --git a/_sass/minima/article/_image-slide-gallery.scss b/_sass/minima/article/_image-slide-gallery.scss new file mode 100644 index 000000000..99942f0d6 --- /dev/null +++ b/_sass/minima/article/_image-slide-gallery.scss @@ -0,0 +1,94 @@ +article.guide { + .image-slide-gallery { + margin-top: 30px; + margin-bottom: 30px; + background-color: #f8f8f8; + justify-content: left; + max-width: none !important; + display: flex; + overflow: hidden; + overflow-x: scroll; + -webkit-overflow-scrolling: touch; + scroll-snap-type: x mandatory; + + figure { + flex-shrink: 0; + margin-top: 0; + margin-bottom: 0; + width: min-content; + + img { + max-width: none; + height: auto; + } + + figcaption { + p { + margin-top: 0; + } + } + } + + &:before, + &:after { + display: block; + content: ''; + position: relative; + height: 20px; + flex-shrink: 0; + flex-grow: 1; + } + + @include media-query(small) { + padding: 30px 0; + + figure { + flex-basis: calc(100vw - 180px); + + & + figure { + margin-left: 30px; + } + } + + &:before, + &:after { + flex-basis: 30px; + } + } + + @include media-query(medium-down) { + margin-left: -15px; + margin-right: -15px; + } + + @include media-query(medium-up) { + padding: 30px 0 30px 0; + + figure { + & + figure { + margin-left: 30px; + } + } + + &:before, + &:after { + flex-basis: 30px; + } + } + + @include media-query(large) { + margin-left: -30px; + margin-right: -30px; + } + } + + & > .-float-right, + & > .center .-float-right { + @include media-query(large) { + margin-top: 0; + margin-bottom: 0; + float: right; + margin-left: 30px; + } + } +} diff --git a/_sass/minima/article/_tip.scss b/_sass/minima/article/_tip.scss new file mode 100644 index 000000000..5ccd5eb50 --- /dev/null +++ b/_sass/minima/article/_tip.scss @@ -0,0 +1,105 @@ +article.guide { + .tip, + .recommendation { + margin-top: $spacing-unit; + padding: 25px 25px 20px 25px; + box-sizing: border-box; + + h6 { + margin: 0; + padding: 0; + font-size: 22px; + font-weight: 500; + + &:before { + display: none; + } + + svg { + display: inline-block; + margin-right: 10px; + background-color: $blue; + border-radius: 3px; + width: 24px; + height: 24px; + color: white; + vertical-align: middle; + transform: translateY(-2px); + } + } + + p { + margin: 10px 0 0 0; + } + + &.-red { + background-color: rgba($red, 0.1); + + h6 { + svg { + background-color: $red; + } + } + } + + &.-green { + background-color: rgba($green, 0.1); + + h6 { + svg { + background-color: $green; + } + } + } + + &.-blue { + background-color: rgba($blue, 0.1); + + h6 { + svg { + background-color: $blue; + } + } + } + + &.-orange { + background-color: rgba($bitcoin-yellow, 0.1); + + h6 { + svg { + background-color: $bitcoin-yellow; + } + } + } + + &.-yellow { + background-color: rgba($yellow, 0.1); + + h6 { + svg { + background-color: $yellow; + } + } + } + } + + .tip { + background-color: rgba($blue, 0.1); + + h6 { + svg { + background-color: $blue; + } + } + } + + .recommendation { + background-color: rgba($bitcoin-yellow, 0.1); + + h6 { + svg { + background-color: $bitcoin-yellow; + } + } + } +} diff --git a/_sass/minima/initialize.scss b/_sass/minima/initialize.scss index a10f3fb4c..c8116eafa 100644 --- a/_sass/minima/initialize.scss +++ b/_sass/minima/initialize.scss @@ -11,6 +11,13 @@ "minima/side-bar", // Side bar for guide pages "minima/nav-list", // Navigation list for guide page side bar and mobile menu guide sub nav "minima/article", // Formatting for all article pages (guide, post, page) + "minima/article/_dl", + "minima/article/_do", + "minima/article/_fact", + "minima/article/_footnotes", + "minima/article/_image-gallery", + "minima/article/_image-slide-gallery", + "minima/article/_tip", "minima/search-page", // Formatting for the search page "minima/projects-page", // Formatting for the projects page "minima/glossary-page", // Formatting for the glossary page From d386e7ef58901b987290e5be443e6da2fcfbb2cf Mon Sep 17 00:00:00 2001 From: GBKS Date: Mon, 26 Apr 2021 16:21:29 +0200 Subject: [PATCH 2/5] Standardize use of spacing unit instead of px --- _sass/minima/_article.scss | 36 +++++++++---------- _sass/minima/article/_dl.scss | 16 ++++----- _sass/minima/article/_do.scss | 8 ++--- _sass/minima/article/_fact.scss | 4 +-- _sass/minima/article/_footnotes.scss | 9 +++-- _sass/minima/article/_image-gallery.scss | 18 +++++----- .../minima/article/_image-slide-gallery.scss | 30 ++++++++-------- _sass/minima/article/_tip.scss | 2 +- 8 files changed, 64 insertions(+), 59 deletions(-) diff --git a/_sass/minima/_article.scss b/_sass/minima/_article.scss index e6e07dcd4..3a98e4d4e 100644 --- a/_sass/minima/_article.scss +++ b/_sass/minima/_article.scss @@ -7,7 +7,7 @@ article.guide { figure { &.-background { - padding: 20px; + padding: $spacing-unit/3*2; background-color: #f8f8f8; } @@ -21,7 +21,7 @@ article.guide { a.button { display: inline-block; - padding: 0 20px; + padding: 0 $spacing-unit/3*2; border-radius: 3px; color: white; line-height: 43px; @@ -75,8 +75,8 @@ article.guide { box-shadow: 0 5px 15px -3px rgba(black, 0.25); > svg { - width: 30px; - height: 30px; + width: $spacing-unit; + height: $spacing-unit; margin-right: 3px; } } @@ -120,8 +120,8 @@ article.guide { } @include media-query(medium-down) { - padding-left: $spacing-unit / 2; - padding-right: $spacing-unit / 2; + padding-left: $spacing-unit/2; + padding-right: $spacing-unit/2; } @include media-query(large) { @@ -140,14 +140,14 @@ article.guide { & > .-float-left, & > .center .-float-left { float: left; - margin-right: $spacing-unit / 2; + margin-right: $spacing-unit/2; max-width: 50%; } & > .-float-right, & > .center .-float-right { float: right; - margin-left: $spacing-unit / 2; + margin-left: $spacing-unit/2; max-width: 50%; } @@ -155,14 +155,14 @@ article.guide { & > .-float-left-desktop, & > .center .-float-left-desktop { float: left; - margin-right: $spacing-unit / 2; + margin-right: $spacing-unit/2; max-width: 50%; } & > .-float-right-desktop, & > .center .-float-right-desktop { float: right; - margin-left: $spacing-unit / 2; + margin-left: $spacing-unit/2; max-width: 50%; } } @@ -185,8 +185,8 @@ article.guide { align-items: center; @include media-query(medium-down) { - margin-left: -$spacing-unit / 2; - margin-right: -$spacing-unit / 2; + margin-left: -$spacing-unit/2; + margin-right: -$spacing-unit/2; } @include media-query(large) { @@ -197,8 +197,8 @@ article.guide { figure.-full-width { figcaption { - margin-left: $spacing-unit / 2; - margin-right: $spacing-unit / 2; + margin-left: $spacing-unit/2; + margin-right: $spacing-unit/2; } } @@ -261,13 +261,13 @@ article.guide { margin-bottom: $spacing-unit; @include media-query(medium-down) { - margin-top: $spacing-unit * 0.5; - margin-bottom: $spacing-unit * 0.5; + margin-top: $spacing-unit/2; + margin-bottom: $spacing-unit/2; } @include media-query(large) { - margin-top: $spacing-unit * 1; - margin-bottom: $spacing-unit * 1; + margin-top: $spacing-unit; + margin-bottom: $spacing-unit; } } } diff --git a/_sass/minima/article/_dl.scss b/_sass/minima/article/_dl.scss index 0e4eb26d8..763cc2730 100644 --- a/_sass/minima/article/_dl.scss +++ b/_sass/minima/article/_dl.scss @@ -7,7 +7,7 @@ dt, dd { display: flex; - padding: 20px 30px; + padding: $spacing-unit/3*2 $spacing-unit; background-color: rgba($blue, 0.1); p { @@ -41,8 +41,8 @@ justify-content: center; svg { - width: 30px; - height: 30px; + width: $spacing-unit; + height: $spacing-unit; } } @@ -55,12 +55,12 @@ dd { & + dt { - margin-top: 20px; + margin-top: $spacing-unit/3*2; } } .icon { - height: 60px; + height: $spacing-unit * 2; svg { transform: rotate(90deg); @@ -73,7 +73,7 @@ dd { flex-basis: 30%; flex-grow: 1; - margin-top: 20px; + margin-top: $spacing-unit/3*2; &:first-of-type { margin-top: 0; @@ -81,8 +81,8 @@ } .icon { - width: 60px; - margin-top: 20px; + width: $spacing-unit*2; + margin-top: $spacing-unit/3*2; &:first-of-type { margin-top: 0; diff --git a/_sass/minima/article/_do.scss b/_sass/minima/article/_do.scss index b7ab58a2a..517d83b37 100644 --- a/_sass/minima/article/_do.scss +++ b/_sass/minima/article/_do.scss @@ -37,7 +37,7 @@ article.guide { } h6 { - margin: 0 0 0 10px; + margin: 0 0 0 $spacing-unit/3; padding: 0px 0 0 0; font-size: 18px; font-weight: 500; @@ -52,7 +52,7 @@ article.guide { .copy { p { & + figure { - margin-top: 10px; + margin-top: $spacing-unit/3; } } @@ -72,7 +72,7 @@ article.guide { .do { & + .do { - margin-top: 20px; + margin-top: $spacing-unit/3*2; } } } @@ -83,7 +83,7 @@ article.guide { flex-grow: 1; & + .do { - margin-left: 40px; + margin-left: $spacing-unit/3*4; } } } diff --git a/_sass/minima/article/_fact.scss b/_sass/minima/article/_fact.scss index a15f58999..56b2e141b 100644 --- a/_sass/minima/article/_fact.scss +++ b/_sass/minima/article/_fact.scss @@ -6,7 +6,7 @@ article.guide { align-items: stretch; .icon { - padding: 10px 20px; + padding: $spacing-unit/3 $spacing-unit/3*2; border-right: 1px solid #DEDEDE; flex-grow: 0; display: flex; @@ -37,7 +37,7 @@ article.guide { } .copy { - padding: 20px; + padding: $spacing-unit/3*2; flex-grow: 1; h6 { diff --git a/_sass/minima/article/_footnotes.scss b/_sass/minima/article/_footnotes.scss index 6eb61932a..3cf5e78ac 100644 --- a/_sass/minima/article/_footnotes.scss +++ b/_sass/minima/article/_footnotes.scss @@ -1,21 +1,24 @@ .article { .footnotes { - padding: 30px; + padding: $spacing-unit; font-size: 0.8rem; - margin: 60px 0 0; + margin: $spacing-unit*2 0 0 0; border: 1px solid rgba(var(--front), 0.05); box-sizing: border-box; background: #FDFDFD; + &::before { content: "REFERENCES"; display: block; - margin-bottom: 10px; + margin-bottom: $spacing-unit/3; color: var(--frontHex); letter-spacing: 1px; } + ol { margin: 0; list-style-position: inside; + li { margin-left: 0; p { diff --git a/_sass/minima/article/_image-gallery.scss b/_sass/minima/article/_image-gallery.scss index 7b1d19bc1..d63e21b96 100644 --- a/_sass/minima/article/_image-gallery.scss +++ b/_sass/minima/article/_image-gallery.scss @@ -1,6 +1,7 @@ article.guide { .image-gallery { display: flex; + margin-top: $spacing-unit; background-color: #f8f8f8; justify-content: center; max-width: none !important; @@ -9,7 +10,7 @@ article.guide { margin-top: 0; margin-bottom: 0; float: left; - margin-right: 30px; + // margin-right: $spacing-unit; img { box-shadow: 0 20px 10px -8px rgba(black, 0.05); @@ -19,9 +20,10 @@ article.guide { @include media-query(small) { flex-direction: column; - margin-left: -15px; - margin-right: -15px; - padding: 10px 15px; + align-items: center; + margin-left: -$spacing-unit / 2; + margin-right: -$spacing-unit / 2; + padding: $spacing-unit $spacing-unit/2; figure { margin: 0; @@ -33,13 +35,13 @@ article.guide { } @include media-query(medium-up) { - margin-left: -30px; - margin-right: -30px; - padding: 30px 30px 15px 30px; + margin-left: -$spacing-unit; + margin-right: -$spacing-unit; + padding: $spacing-unit; figure { & + figure { - margin-left: 40px; + margin-left: $spacing-unit/3*4; } } } diff --git a/_sass/minima/article/_image-slide-gallery.scss b/_sass/minima/article/_image-slide-gallery.scss index 99942f0d6..f1527d887 100644 --- a/_sass/minima/article/_image-slide-gallery.scss +++ b/_sass/minima/article/_image-slide-gallery.scss @@ -1,7 +1,7 @@ article.guide { .image-slide-gallery { - margin-top: 30px; - margin-bottom: 30px; + margin-top: $spacing-unit; + margin-bottom: $spacing-unit; background-color: #f8f8f8; justify-content: left; max-width: none !important; @@ -34,51 +34,51 @@ article.guide { display: block; content: ''; position: relative; - height: 20px; + height: $spacing-unit/3*2; flex-shrink: 0; flex-grow: 1; } @include media-query(small) { - padding: 30px 0; + padding: $spacing-unit 0; figure { - flex-basis: calc(100vw - 180px); + flex-basis: calc(100vw - $spacing-unit*6); & + figure { - margin-left: 30px; + margin-left: $spacing-unit; } } &:before, &:after { - flex-basis: 30px; + flex-basis: $spacing-unit; } } @include media-query(medium-down) { - margin-left: -15px; - margin-right: -15px; + margin-left: -$spacing-unit/2; + margin-right: -$spacing-unit/2; } @include media-query(medium-up) { - padding: 30px 0 30px 0; + padding: $spacing-unit 0 $spacing-unit 0; figure { & + figure { - margin-left: 30px; + margin-left: $spacing-unit; } } &:before, &:after { - flex-basis: 30px; + flex-basis: $spacing-unit; } } @include media-query(large) { - margin-left: -30px; - margin-right: -30px; + margin-left: -$spacing-unit; + margin-right: -$spacing-unit; } } @@ -88,7 +88,7 @@ article.guide { margin-top: 0; margin-bottom: 0; float: right; - margin-left: 30px; + margin-left: $spacing-unit; } } } diff --git a/_sass/minima/article/_tip.scss b/_sass/minima/article/_tip.scss index 5ccd5eb50..68ddec596 100644 --- a/_sass/minima/article/_tip.scss +++ b/_sass/minima/article/_tip.scss @@ -2,7 +2,7 @@ article.guide { .tip, .recommendation { margin-top: $spacing-unit; - padding: 25px 25px 20px 25px; + padding: $spacing-unit/6*5 $spacing-unit/6*5 $spacing-unit/3*2 $spacing-unit/6*5; box-sizing: border-box; h6 { From 28081d64a21ce336379abe0a1cb17aabd8200859 Mon Sep 17 00:00:00 2001 From: GBKS Date: Wed, 28 Apr 2021 16:28:07 +0200 Subject: [PATCH 3/5] Various minor spacing fixes Reviewed all pages on both desktop and mobile to verify it's all looking good. --- _layouts/home.html | 12 +++--- _sass/minima/_article.scss | 27 ++++++++---- _sass/minima/_base.scss | 7 ++-- _sass/minima/_home-banner.scss | 3 +- _sass/minima/_home-page.scss | 13 ++++++ _sass/minima/_layout.scss | 62 +++++++++++++++++++--------- _sass/minima/_site-footer.scss | 6 +-- _sass/minima/article/_dl.scss | 2 +- _sass/minima/article/_footnotes.scss | 4 +- _sass/minima/initialize.scss | 1 + guide/foundations/principles.md | 2 +- guide/onboarding/introduction.md | 4 +- 12 files changed, 97 insertions(+), 46 deletions(-) create mode 100644 _sass/minima/_home-page.scss diff --git a/_layouts/home.html b/_layouts/home.html index eb6d21b4a..b302ef2e2 100644 --- a/_layouts/home.html +++ b/_layouts/home.html @@ -1,11 +1,11 @@ @@ -15,8 +15,8 @@ {%- include svgs.html -%} {%- include header.html -%} - -
+ +
{%- include home-banner.html -%}
diff --git a/_sass/minima/_article.scss b/_sass/minima/_article.scss index d16b414cc..d77b09d62 100644 --- a/_sass/minima/_article.scss +++ b/_sass/minima/_article.scss @@ -47,6 +47,8 @@ article.guide { a.video-link, a.prototype-link { + margin-top: $spacing-unit; + display: block; position: relative; > svg { @@ -132,8 +134,22 @@ article.guide { & > .center { @include clearfix; - > figure { - margin-top: 0; + @include media-query(medium-down) { + > figure { + &:not(:first-child), + &.-float-left, + &.-float-right, + &.-float-left-mobile, + &.-float-right-mobile { + margin-top: $spacing-unit/5; + } + } + } + + @include media-query(large) { + > figure { + margin-top: 0; + } } } @@ -257,12 +273,9 @@ article.guide { figure:not(.-float-left, .-float-right, :first-child), iframe { - margin-top: $spacing-unit; - margin-bottom: $spacing-unit; - @include media-query(medium-down) { - margin-top: $spacing-unit/2; - margin-bottom: $spacing-unit/2; + margin-top: $spacing-unit; + margin-bottom: $spacing-unit; } @include media-query(large) { diff --git a/_sass/minima/_base.scss b/_sass/minima/_base.scss index 1194939a7..360b1cebf 100644 --- a/_sass/minima/_base.scss +++ b/_sass/minima/_base.scss @@ -55,7 +55,7 @@ ul, ol, dl, figure, hr { margin-top: $spacing-unit; - border: 1px solid rgba(var(--front), 0.05); + border: 1px solid rgba(var(--front), 0.1); border-width: 1px 0 0; } @@ -259,8 +259,8 @@ pre { max-width: calc(#{$content-width} - (#{$spacing-unit})); margin-right: auto; margin-left: auto; - padding-right: $spacing-unit / 3 * 2; - padding-left: $spacing-unit / 3 * 2; + // padding-right: $spacing-unit / 3 * 2; + // padding-left: $spacing-unit / 3 * 2; @include clearfix; @include media-query(large) { @@ -313,6 +313,7 @@ pre { * Tables */ table { + margin-top: $spacing-unit; margin-bottom: $spacing-unit; width: 100%; text-align: $table-text-align; diff --git a/_sass/minima/_home-banner.scss b/_sass/minima/_home-banner.scss index 98dd85b33..90decaa5a 100644 --- a/_sass/minima/_home-banner.scss +++ b/_sass/minima/_home-banner.scss @@ -82,7 +82,7 @@ background-image: var(--background-image-path-mobile); background-size: cover; background-repeat: no-repeat; - background-position: center center; + background-position: center center; transition: background-color 150ms $ease; @include retina() { @@ -156,6 +156,7 @@ padding: 5px 15px; position: relative; z-index: 1; + box-sizing: border-box; .home-banner-info-wrapper { width: 100%; diff --git a/_sass/minima/_home-page.scss b/_sass/minima/_home-page.scss new file mode 100644 index 000000000..aeb1533cf --- /dev/null +++ b/_sass/minima/_home-page.scss @@ -0,0 +1,13 @@ +.home-page { + article { + padding-top: $spacing-unit; + } + + @include media-query(small) { + padding-bottom: $spacing-unit; + } + + @include media-query(medium-up) { + padding-bottom: $spacing-unit*2; + } +} diff --git a/_sass/minima/_layout.scss b/_sass/minima/_layout.scss index 017ff7ba3..669466192 100644 --- a/_sass/minima/_layout.scss +++ b/_sass/minima/_layout.scss @@ -5,6 +5,7 @@ .page-content { flex: 1 0 auto; + @include media-query(large) { > .page-content-wrapper { display: flex; @@ -129,9 +130,9 @@ @include relative-font-size(0.8); @include media-query(medium-down) { - margin-top: $spacing-unit / 2; - margin-left: $spacing-unit / 2; - margin-right: $spacing-unit / 2; + margin-top: $spacing-unit/2; + margin-left: $spacing-unit/2; + margin-right: $spacing-unit/2; } @include media-query(large) { @@ -139,18 +140,29 @@ } } - /** * Posts */ .main { - @include media-query(small) { - padding-bottom: $spacing-unit * 2; + &.sidebar { + @include media-query(small) { + padding-bottom: $spacing-unit*2; + } + + @include media-query(medium-up) { + padding-bottom: $spacing-unit * 6; + } } - @include media-query(medium-up) { - padding-bottom: $spacing-unit * 6; + &:not(.sidebar) { + @include media-query(small) { + padding-bottom: $spacing-unit; + } + + @include media-query(medium-up) { + padding-bottom: $spacing-unit*3; + } } &:not(.-no-top-padding) { @@ -159,14 +171,16 @@ } @include media-query(medium-up) { - padding-top: $spacing-unit * 4; + padding-top: $spacing-unit*4; } } } .post-title, .post-content h1, -article.guide h1 { +article.guide h1, +.post-content .h1, +article.guide .h1 { @include relative-font-size(2.625); letter-spacing: -1px; line-height: 1.15; @@ -178,7 +192,8 @@ article.guide h1 { .post-content, article.guide { - h1 { + h1, + .h1 { margin-top: $spacing-unit * 1; @include media-query(medium-up) { @@ -186,7 +201,8 @@ article.guide { } } - h2, h3, h4, h5, h6 { + h2, h3, h4, h5, h6, + .h2, .h3, .h4, .h5, .h6 { margin-top: 0; &::before { @@ -200,7 +216,8 @@ article.guide { } } - h2, h3 { + h2, h3, + .h2, .h3 { &::before { height: $spacing-unit * 1; } @@ -213,7 +230,8 @@ article.guide { } } - h4, h5, h6 { + h4, h5, h6, + .h4, .h5, .h6 { &::before { height: $spacing-unit * 1.5; margin-top: -$spacing-unit 1.5; @@ -226,7 +244,7 @@ article.guide { } } - h2 { + h2, .h2 { @include relative-font-size(1.75); @include media-query(large) { @@ -234,7 +252,7 @@ article.guide { } } - h3 { + h3, .h3 { @include relative-font-size(1.375); @include media-query(large) { @@ -242,15 +260,15 @@ article.guide { } } - h4 { + h4, .h4 { @include relative-font-size(1.25); } - h5 { + h5, .h5 { @include relative-font-size(1.125); } - h6 { + h6, .h6 { @include relative-font-size(1.0625); } } @@ -267,7 +285,9 @@ article.guide { float: left; margin: 5px 10px 5px 0; - &:last-of-type { margin-right: 0 } + &:last-of-type { + margin-right: 0 + } a { display: block; @@ -276,12 +296,14 @@ article.guide { &:hover { border-color: $border-color-02 } } } + li { a, div { min-width: 41px; text-align: center; box-sizing: border-box; } + div { display: block; padding: $spacing-unit / 4; diff --git a/_sass/minima/_site-footer.scss b/_sass/minima/_site-footer.scss index fccd61f67..da190a464 100644 --- a/_sass/minima/_site-footer.scss +++ b/_sass/minima/_site-footer.scss @@ -3,7 +3,7 @@ * Site footer */ .site-footer { - padding: 20px 20px $spacing-unit * 2 20px; + padding: $spacing-unit/2 $spacing-unit/2 $spacing-unit*2 $spacing-unit/2; .wrapper { display: flex; @@ -144,7 +144,7 @@ margin-right: auto; order: 1; } - + .edit-license { display: flex; border-right: 1px solid black; @@ -184,4 +184,4 @@ body.sidebar { padding-top: 30px; border-top: 1px solid rgba(var(--front), 0.1); } -} \ No newline at end of file +} diff --git a/_sass/minima/article/_dl.scss b/_sass/minima/article/_dl.scss index 763cc2730..75382ebbc 100644 --- a/_sass/minima/article/_dl.scss +++ b/_sass/minima/article/_dl.scss @@ -1,4 +1,4 @@ -.article { +article.guide { dl { display: flex; flex-wrap: wrap; diff --git a/_sass/minima/article/_footnotes.scss b/_sass/minima/article/_footnotes.scss index 3cf5e78ac..9fcf11d09 100644 --- a/_sass/minima/article/_footnotes.scss +++ b/_sass/minima/article/_footnotes.scss @@ -1,8 +1,8 @@ -.article { +article.guide { .footnotes { padding: $spacing-unit; font-size: 0.8rem; - margin: $spacing-unit*2 0 0 0; + margin-top: $spacing-unit*2; border: 1px solid rgba(var(--front), 0.05); box-sizing: border-box; background: #FDFDFD; diff --git a/_sass/minima/initialize.scss b/_sass/minima/initialize.scss index c8116eafa..8f8c9fcf1 100644 --- a/_sass/minima/initialize.scss +++ b/_sass/minima/initialize.scss @@ -18,6 +18,7 @@ "minima/article/_image-gallery", "minima/article/_image-slide-gallery", "minima/article/_tip", + "minima/home-page", // Formatting for the home page "minima/search-page", // Formatting for the search page "minima/projects-page", // Formatting for the projects page "minima/glossary-page", // Formatting for the glossary page diff --git a/guide/foundations/principles.md b/guide/foundations/principles.md index def48d13f..696752f7c 100644 --- a/guide/foundations/principles.md +++ b/guide/foundations/principles.md @@ -21,7 +21,7 @@ The key principles of designing for Bitcoin image = "/assets/images/guide/foundations/principles/principles.jpg" retina = "/assets/images/guide/foundations/principles/principles@2x.jpg" mobile = "/assets/images/guide/foundations/principles/principles-mobile.jpg" - mobileRetina = "/assets/images/foundations/principles/principles-mobile@2x.jpg" + mobileRetina = "/assets/images/guide/foundations/principles/principles-mobile@2x.jpg" alt-text = "Principles header illustration, five white circles in a horizontal line on black background" width = 1600 height = 600 diff --git a/guide/onboarding/introduction.md b/guide/onboarding/introduction.md index e2e28136f..e9c9a0bf3 100644 --- a/guide/onboarding/introduction.md +++ b/guide/onboarding/introduction.md @@ -22,7 +22,7 @@ scan this page to get an overview of the section and then decide which topics to image = "/assets/images/guide/onboarding/onboarding.png" retina = "/assets/images/guide/onboarding/onboarding@2x.png" mobile = "/assets/images/guide/onboarding/onboarding-mobile.png" - mobileRetina = "/assets/images/guide/onboarding/onboarding/onboarding-mobile@2x.png" + mobileRetina = "/assets/images/guide/onboarding/onboarding-mobile@2x.png" alt-text = "Person climbing ladder" width = 1600 height = 600 @@ -59,4 +59,4 @@ An overview of how to design a successful onboarding experience for first-time u ### Restoring a wallet (coming soon) -### Protecting a wallet (coming soon) \ No newline at end of file +### Protecting a wallet (coming soon) From 82d472ba2bae6ff331ca55a403414e0b688d451f Mon Sep 17 00:00:00 2001 From: GBKS Date: Thu, 29 Apr 2021 09:37:12 +0200 Subject: [PATCH 4/5] Minor fix for spacing between rulers and paragraphs --- _sass/minima/_base.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/_sass/minima/_base.scss b/_sass/minima/_base.scss index 360b1cebf..bece0143d 100644 --- a/_sass/minima/_base.scss +++ b/_sass/minima/_base.scss @@ -57,6 +57,10 @@ hr { margin-top: $spacing-unit; border: 1px solid rgba(var(--front), 0.1); border-width: 1px 0 0; + + & + p { + margin-top: $spacing-unit; + } } /** From af78121340c9ea951b701bdeed26fa7342f5862f Mon Sep 17 00:00:00 2001 From: GBKS Date: Thu, 29 Apr 2021 14:27:09 +0200 Subject: [PATCH 5/5] Minor fix that has come up in #225 and #240 --- _sass/minima/_article.scss | 3 +++ 1 file changed, 3 insertions(+) diff --git a/_sass/minima/_article.scss b/_sass/minima/_article.scss index d77b09d62..14755a882 100644 --- a/_sass/minima/_article.scss +++ b/_sass/minima/_article.scss @@ -9,6 +9,9 @@ article.guide { &.-background { padding: $spacing-unit/3*2; background-color: #f8f8f8; + display: flex; + flex-direction: column; + align-items: center; } &.-shadow {