From 473fb3e51dd9e0edd0d41e4264c55fa9d27debca Mon Sep 17 00:00:00 2001 From: Ben Hong Date: Sat, 9 May 2020 06:15:58 -0400 Subject: [PATCH 1/4] feature (#86): update custom container styles --- src/.vuepress/styles/index.styl | 197 ++++++++++++++++++-------------- 1 file changed, 112 insertions(+), 85 deletions(-) diff --git a/src/.vuepress/styles/index.styl b/src/.vuepress/styles/index.styl index 145736fc00..ae1f9fb188 100644 --- a/src/.vuepress/styles/index.styl +++ b/src/.vuepress/styles/index.styl @@ -1,99 +1,126 @@ -.demo - font-family sans-serif - border 1px solid #eee - border-radius 2px - padding 20px 30px - margin-top 1em - margin-bottom 40px - user-select none - overflow-x auto +.demo { + font-family: sans-serif; + border: 1px solid #eee; + border-radius: 2px; + padding: 20px 30px; + margin-top: 1em; + margin-bottom: 40px; + user-select: none; + overflow-x: auto; +} -.custom-block - padding 0.1rem 1.5rem - margin 2em 0 - border-left-width 0.5rem - border-left-style solid - background-color #f8f8f8 - position relative - border-bottom-right-radius 2px - border-top-right-radius 2px - margin 1rem 0 +.custom-block { + padding: 0.1rem 1.5rem; + margin: 2em 0; + border-left-width: 0.5rem; + border-left-style: solid; + background-color: #f8f8f8; + position: relative; + border-bottom-right-radius: 2px; + border-top-right-radius: 2px; + max-width: 80%; + margin: 1rem 0; - &::before - position absolute - top 14px - left -14px - color #fff - width 20px - height 20px - border-radius 100% - text-align center - line-height 20px - font-weight bold - font-family 'Dosis', 'Source Sans Pro', 'Helvetica Neue', Arial, sans-serif - font-size 14px + &::before { + position: absolute; + top: 14px; + left: -14px; + color: #fff; + width: 20px; + height: 20px; + border-radius: 100%; + text-align: center; + line-height: 20px; + font-weight: bold; + font-family: 'Dosis', 'Source Sans Pro', 'Helvetica Neue', Arial, sans-serif; + font-size: 14px; + } - .custom-block-title - font-weight 600 - margin-bottom -0.4rem + .custom-block-title { + font-weight: 600; + margin-bottom: -0.4rem; + } + &.info { + border-color: #007bff; - &.info - border-color #007bff + &::before { + content: 'i'; + background-color: #007bff; + } + } + &.tip { + border-color: #42b983; - &.tip - border-color #42b983 + &::before { + content: '✓'; + background-color: #42b983; + } + } + &.warning { + border-color: #dcbc1e; + background-color: #f8f8f8; - &.warning - border-color #dcbc1e - background-color #f8f8f8 - &.danger - border-color #f66 - background-color #f8f8f8 + &::before { + content: '⚠'; + background-color: #dcbc1e; + } + } + &.danger { + border-color: #f66; + background-color: #f8f8f8; - &::before - content '!' - background-color #f66 - - &.details - display block - position relative - border-radius 2px - margin 1.6em 0 - padding 1.6em - background-color #eee - - h4 - margin-top 0 + &::before { + content: '!'; + background-color: #f66; + } + } + &.details { + display: block; + position: relative; + border-radius: 2px; + margin: 1.6em 0; + padding: 1.6em; + background-color: #eee; + h4 { + margin-top: 0; + } figure, - p - &:last-child - margin-bottom 0 - padding-bottom 0 - - summary - outline none - cursor pointer + p { + &:last-child { + margin-bottom: 0; + padding-bottom: 0; + } + } + summary { + outline: none; + cursor: pointer; + } + } +} .scrimba, -.vueschool - background-color #e7ecf3 - padding 1em 1.25em - border-radius 2px - color #486491 - position relative - margin 24px 0 +.vueschool { + background-color: #e7ecf3; + padding: 1em 1.25em; + border-radius: 2px; + color: #486491; + position: relative; + margin: 24px 0; - a - color: #486491 - position relative - padding-left 16px + a { + color: #486491; + position: relative; + padding-left :16px; + } - &::before - content "\f144" - font-family 'Font Awesome 5 Free' - font-size 2em - display inline-block - color #73abfe - vertical-align middle + &::before { + content: "\f144"; + font-family: 'Font Awesome 5 Free'; + font-size: 2em; + display: inline-block; + color: #73abfe; + vertical-align: middle; + } +} From c0f37185b1b3f06f18d98cbf892d99e63dff07f9 Mon Sep 17 00:00:00 2001 From: Ben Hong Date: Tue, 12 May 2020 13:01:42 -0400 Subject: [PATCH 2/4] refactor (#86): remove icons from containers except for danger --- src/.vuepress/styles/index.styl | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/src/.vuepress/styles/index.styl b/src/.vuepress/styles/index.styl index ae1f9fb188..8c437f74ab 100644 --- a/src/.vuepress/styles/index.styl +++ b/src/.vuepress/styles/index.styl @@ -40,42 +40,30 @@ font-weight: 600; margin-bottom: -0.4rem; } + &.info { border-color: #007bff; - - &::before { - content: 'i'; - background-color: #007bff; - } } + &.tip { border-color: #42b983; - - &::before { - content: '✓'; - background-color: #42b983; - } } + &.warning { border-color: #dcbc1e; - background-color: #f8f8f8; - - - &::before { - content: '⚠'; - background-color: #dcbc1e; - } + background-color: #f8f8f8; } + &.danger { border-color: #f66; background-color: #f8f8f8; - &::before { content: '!'; background-color: #f66; } } + &.details { display: block; position: relative; From c20f3c57258460863a51e9ebf1bd778f25a417c3 Mon Sep 17 00:00:00 2001 From: Ben Hong Date: Sat, 20 Jun 2020 16:21:15 -0400 Subject: [PATCH 3/4] feature: update styles and icons on custom containers --- src/.vuepress/public/images/icons/bulb.svg | 10 ++++++ src/.vuepress/public/images/icons/danger.svg | 13 ++++++++ src/.vuepress/public/images/icons/info.svg | 11 +++++++ src/.vuepress/public/images/icons/stop.svg | 10 ++++++ src/.vuepress/styles/index.styl | 32 ++++++++++++++++++-- 5 files changed, 73 insertions(+), 3 deletions(-) create mode 100644 src/.vuepress/public/images/icons/bulb.svg create mode 100644 src/.vuepress/public/images/icons/danger.svg create mode 100644 src/.vuepress/public/images/icons/info.svg create mode 100644 src/.vuepress/public/images/icons/stop.svg diff --git a/src/.vuepress/public/images/icons/bulb.svg b/src/.vuepress/public/images/icons/bulb.svg new file mode 100644 index 0000000000..984f318125 --- /dev/null +++ b/src/.vuepress/public/images/icons/bulb.svg @@ -0,0 +1,10 @@ + + + bulb + + + + + + + diff --git a/src/.vuepress/public/images/icons/danger.svg b/src/.vuepress/public/images/icons/danger.svg new file mode 100644 index 0000000000..45a7c34025 --- /dev/null +++ b/src/.vuepress/public/images/icons/danger.svg @@ -0,0 +1,13 @@ + + + danger + + + + + + + + + + diff --git a/src/.vuepress/public/images/icons/info.svg b/src/.vuepress/public/images/icons/info.svg new file mode 100644 index 0000000000..26ca6e7316 --- /dev/null +++ b/src/.vuepress/public/images/icons/info.svg @@ -0,0 +1,11 @@ + + + info + + + + + + + + diff --git a/src/.vuepress/public/images/icons/stop.svg b/src/.vuepress/public/images/icons/stop.svg new file mode 100644 index 0000000000..85cd36a014 --- /dev/null +++ b/src/.vuepress/public/images/icons/stop.svg @@ -0,0 +1,10 @@ + + + stop + + + + + + + \ No newline at end of file diff --git a/src/.vuepress/styles/index.styl b/src/.vuepress/styles/index.styl index 8c437f74ab..95e88830c5 100644 --- a/src/.vuepress/styles/index.styl +++ b/src/.vuepress/styles/index.styl @@ -43,15 +43,39 @@ &.info { border-color: #007bff; + + &::before { + content: url('/images/icons/info.svg'); + width: 25px; + height: 25px; + left: -16px; + box-sizing: border-box; + } } &.tip { border-color: #42b983; + + &::before { + content: url('/images/icons/bulb.svg'); + width: 25px; + height: 25px; + left: -16px; + } } &.warning { - border-color: #dcbc1e; + border-color: #f4cd00; background-color: #f8f8f8; + color: #836e03; + + &::before { + content: url('/images/icons/danger.svg'); + width: 25px; + height: 25px; + left: -16px; + box-sizing: border-box; + } } &.danger { @@ -59,8 +83,10 @@ background-color: #f8f8f8; &::before { - content: '!'; - background-color: #f66; + content: url('/images/icons/stop.svg'); + width: 25px; + height: 25px; + left: -16px; } } From c5757d4c5c00cf4d8c195d251b652cdac12b6e5c Mon Sep 17 00:00:00 2001 From: Ben Hong Date: Tue, 7 Jul 2020 10:29:59 -0400 Subject: [PATCH 4/4] fix: standardize text color --- src/.vuepress/styles/index.styl | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/.vuepress/styles/index.styl b/src/.vuepress/styles/index.styl index 95e88830c5..c7fa213db1 100644 --- a/src/.vuepress/styles/index.styl +++ b/src/.vuepress/styles/index.styl @@ -14,7 +14,6 @@ margin: 2em 0; border-left-width: 0.5rem; border-left-style: solid; - background-color: #f8f8f8; position: relative; border-bottom-right-radius: 2px; border-top-right-radius: 2px; @@ -36,6 +35,10 @@ font-size: 14px; } + p { + color: #222; + } + .custom-block-title { font-weight: 600; margin-bottom: -0.4rem; @@ -43,6 +46,7 @@ &.info { border-color: #007bff; + background-color: #f8f8f8; &::before { content: url('/images/icons/info.svg'); @@ -55,6 +59,7 @@ &.tip { border-color: #42b983; + background-color: #f8f8f8; &::before { content: url('/images/icons/bulb.svg'); @@ -67,7 +72,10 @@ &.warning { border-color: #f4cd00; background-color: #f8f8f8; - color: #836e03; + + .custom-block-title { + color: #222; + } &::before { content: url('/images/icons/danger.svg'); @@ -82,6 +90,10 @@ border-color: #f66; background-color: #f8f8f8; + .custom-block-title { + color: #222; + } + &::before { content: url('/images/icons/stop.svg'); width: 25px;