From 029270a9b5ae0c6a5b9f5ee9772d281f6ae437c2 Mon Sep 17 00:00:00 2001 From: Sarah Drasner Date: Sat, 18 Jul 2020 22:07:33 -0600 Subject: [PATCH 01/13] work on some highlighting --- src/.vuepress/theme/styles/code.styl | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/.vuepress/theme/styles/code.styl b/src/.vuepress/theme/styles/code.styl index 4e8a574ab0..851a0a24c1 100644 --- a/src/.vuepress/theme/styles/code.styl +++ b/src/.vuepress/theme/styles/code.styl @@ -17,18 +17,18 @@ line-height 1.4 padding 1.25rem 1.5rem margin 0.85rem 0 - background-color $codeBgColor + background-color #f6f6f6 border-radius 6px overflow auto code - color #fff + color #3a385d padding 0 background-color transparent border-radius 0 div[class*="language-"] position relative - background-color $codeBgColor + background-color #f6f6f6 border-radius 6px .highlight-lines user-select none @@ -138,4 +138,11 @@ div.reactivecontent width 1000px margin-left -100px -@import '~prismjs/themes/prism-tomorrow.css' +// @import '~prismjs/themes/prism-tomorrow.css' + +.token.punctuation + color #a8a9cc + +.token.tag, .token.attr-name, .token.namespace, .token.deleted + color #b2085f + From 65d5402dc38fd2f4e5350e105ce66e4ffb79e8fa Mon Sep 17 00:00:00 2001 From: Sarah Drasner Date: Sat, 18 Jul 2020 22:08:06 -0600 Subject: [PATCH 02/13] more highlights --- src/.vuepress/theme/styles/code.styl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/.vuepress/theme/styles/code.styl b/src/.vuepress/theme/styles/code.styl index 851a0a24c1..cb3a2e620d 100644 --- a/src/.vuepress/theme/styles/code.styl +++ b/src/.vuepress/theme/styles/code.styl @@ -146,3 +146,8 @@ div.reactivecontent .token.tag, .token.attr-name, .token.namespace, .token.deleted color #b2085f +.token.string, .token.char, .token.attr-value, .token.regex, .token.variable + color #0a7a34 + +.token.selector, .token.important, .token.atrule, .token.keyword, .token.builtin + color #b92dbc From 0cc952381e044f327db627583ada17dcf9ca7e62 Mon Sep 17 00:00:00 2001 From: Sarah Drasner Date: Sat, 18 Jul 2020 22:08:18 -0600 Subject: [PATCH 03/13] more highlights --- src/.vuepress/theme/styles/code.styl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/.vuepress/theme/styles/code.styl b/src/.vuepress/theme/styles/code.styl index cb3a2e620d..865ea4af1b 100644 --- a/src/.vuepress/theme/styles/code.styl +++ b/src/.vuepress/theme/styles/code.styl @@ -151,3 +151,6 @@ div.reactivecontent .token.selector, .token.important, .token.atrule, .token.keyword, .token.builtin color #b92dbc + +.token.boolean, .token.number, .token.function + color #c25205 \ No newline at end of file From 822904313e243c982f2fed75243fd943e578d7de Mon Sep 17 00:00:00 2001 From: Sarah Drasner Date: Sat, 18 Jul 2020 22:08:35 -0600 Subject: [PATCH 04/13] further highlights --- src/.vuepress/theme/styles/code.styl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/.vuepress/theme/styles/code.styl b/src/.vuepress/theme/styles/code.styl index 865ea4af1b..b0155067bb 100644 --- a/src/.vuepress/theme/styles/code.styl +++ b/src/.vuepress/theme/styles/code.styl @@ -153,4 +153,7 @@ div.reactivecontent color #b92dbc .token.boolean, .token.number, .token.function - color #c25205 \ No newline at end of file + color #c25205 + +.token.property, .token.class-name, .token.constant, .token.symbol + color #717c11 \ No newline at end of file From 1bf20b944c564758b6f9579e8e51a149e4a9c8da Mon Sep 17 00:00:00 2001 From: Sarah Drasner Date: Sat, 18 Jul 2020 22:08:48 -0600 Subject: [PATCH 05/13] more highlights --- src/.vuepress/theme/styles/code.styl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/.vuepress/theme/styles/code.styl b/src/.vuepress/theme/styles/code.styl index b0155067bb..ace7015afb 100644 --- a/src/.vuepress/theme/styles/code.styl +++ b/src/.vuepress/theme/styles/code.styl @@ -156,4 +156,10 @@ div.reactivecontent color #c25205 .token.property, .token.class-name, .token.constant, .token.symbol - color #717c11 \ No newline at end of file + color #717c11 + +.token.operator, .token.entity, .token.url + color #0b7e7d + +.token.comment, .token.block-comment, .token.prolog, .token.doctype, .token.cdata + color #848486 \ No newline at end of file From 3ae5c4d9486a5171e6940e1d0236f01aa97687fd Mon Sep 17 00:00:00 2001 From: Sarah Drasner Date: Sat, 18 Jul 2020 22:15:54 -0600 Subject: [PATCH 06/13] add in language designations --- src/.vuepress/theme/styles/code.styl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/.vuepress/theme/styles/code.styl b/src/.vuepress/theme/styles/code.styl index ace7015afb..3d9103aaad 100644 --- a/src/.vuepress/theme/styles/code.styl +++ b/src/.vuepress/theme/styles/code.styl @@ -50,7 +50,7 @@ div[class*="language-"] top 0.8em right 1em font-size 0.75rem - color rgba(255, 255, 255, 0.4) + color rgb(0 0 6 / 0.5) &:not(.line-numbers-mode) .line-numbers-wrapper display none @@ -66,7 +66,7 @@ div[class*="language-"] display block width $lineNumbersWrapperWidth height 100% - background-color rgba(0, 0, 0, 66%) + background-color rgba(255, 255, 255, 95%) pre padding-left $lineNumbersWrapperWidth + 1 rem vertical-align middle From 24a446eb2e4fd0661ad74caf11318bb51569d615 Mon Sep 17 00:00:00 2001 From: Sarah Drasner Date: Sat, 18 Jul 2020 22:17:28 -0600 Subject: [PATCH 07/13] we missed a 500 style --- src/.vuepress/theme/styles/index.styl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/.vuepress/theme/styles/index.styl b/src/.vuepress/theme/styles/index.styl index 14e77c7dd7..9c3e98647b 100644 --- a/src/.vuepress/theme/styles/index.styl +++ b/src/.vuepress/theme/styles/index.styl @@ -135,7 +135,7 @@ h1, h2, h3, h4, h5, h6 h1 font-size 2.2rem - font-weight 600 + font-weight 500 h2 font-size 1.65rem From b2e2602a75b7d42c32608b822d89bf07703493af Mon Sep 17 00:00:00 2001 From: Sarah Drasner Date: Sat, 18 Jul 2020 22:19:18 -0600 Subject: [PATCH 08/13] update the font weight on the site name --- src/.vuepress/theme/components/Navbar.vue | 145 +++++++++++++--------- 1 file changed, 83 insertions(+), 62 deletions(-) diff --git a/src/.vuepress/theme/components/Navbar.vue b/src/.vuepress/theme/components/Navbar.vue index a42dc7653a..fbafc009e9 100644 --- a/src/.vuepress/theme/components/Navbar.vue +++ b/src/.vuepress/theme/components/Navbar.vue @@ -2,16 +2,13 @@ @@ -52,31 +48,37 @@ export default { AlgoliaSearchBox }, - data () { + data() { return { linksWrapMaxWidth: null } }, computed: { - algolia () { - return this.$themeLocaleConfig.algolia || this.$site.themeConfig.algolia || {} + algolia() { + return ( + this.$themeLocaleConfig.algolia || this.$site.themeConfig.algolia || {} + ) }, - isAlgoliaSearch () { + isAlgoliaSearch() { return this.algolia && this.algolia.apiKey && this.algolia.indexName } }, - mounted () { + mounted() { const MOBILE_DESKTOP_BREAKPOINT = 719 // refer to config.styl - const NAVBAR_VERTICAL_PADDING = parseInt(css(this.$el, 'paddingLeft')) + parseInt(css(this.$el, 'paddingRight')) + const NAVBAR_VERTICAL_PADDING = + parseInt(css(this.$el, 'paddingLeft')) + + parseInt(css(this.$el, 'paddingRight')) const handleLinksWrapWidth = () => { if (document.documentElement.clientWidth < MOBILE_DESKTOP_BREAKPOINT) { this.linksWrapMaxWidth = null } else { - this.linksWrapMaxWidth = this.$el.offsetWidth - NAVBAR_VERTICAL_PADDING - - (this.$refs.siteName && this.$refs.siteName.offsetWidth || 0) + this.linksWrapMaxWidth = + this.$el.offsetWidth - + NAVBAR_VERTICAL_PADDING - + ((this.$refs.siteName && this.$refs.siteName.offsetWidth) || 0) } } handleLinksWrapWidth() @@ -84,7 +86,7 @@ export default { } } -function css (el, property) { +function css(el, property) { // NOTE: Known bug, will return 'auto' if style value is 'auto' const win = el.ownerDocument.defaultView // null means not to return pseudo styles @@ -93,48 +95,67 @@ function css (el, property) { From 648197b345566baab62e6145c9542f18db3d0485 Mon Sep 17 00:00:00 2001 From: Sarah Drasner Date: Sat, 18 Jul 2020 22:23:58 -0600 Subject: [PATCH 09/13] work on highlighted lines --- src/.vuepress/theme/styles/code.styl | 10 ++++++++-- src/.vuepress/theme/styles/index.styl | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/.vuepress/theme/styles/code.styl b/src/.vuepress/theme/styles/code.styl index 3d9103aaad..9706915e36 100644 --- a/src/.vuepress/theme/styles/code.styl +++ b/src/.vuepress/theme/styles/code.styl @@ -31,6 +31,8 @@ div[class*="language-"] background-color #f6f6f6 border-radius 6px .highlight-lines + background-color #f6f6f6 + color #3a385d user-select none padding-top 1.3rem position absolute @@ -39,7 +41,7 @@ div[class*="language-"] width 100% line-height 1.4 .highlighted - background-color rgba(0, 0, 0, 66%) + background-color rgba(255, 255, 255, 90%) pre, pre[class*="language-"] background transparent position relative @@ -162,4 +164,8 @@ div.reactivecontent color #0b7e7d .token.comment, .token.block-comment, .token.prolog, .token.doctype, .token.cdata - color #848486 \ No newline at end of file + color #848486 + +div[class*=language-].line-numbers-mode .line-numbers-wrapper + background-color #f6f6f6 + color #3a385d \ No newline at end of file diff --git a/src/.vuepress/theme/styles/index.styl b/src/.vuepress/theme/styles/index.styl index 9c3e98647b..6420218941 100644 --- a/src/.vuepress/theme/styles/index.styl +++ b/src/.vuepress/theme/styles/index.styl @@ -107,7 +107,7 @@ ul, ol padding-left 1.2em strong - font-weight 600 + font-weight 500 h1, h2, h3, h4, h5, h6 font-weight 500 From 9acddf30c98852e397dd47e72e70c645e017d20e Mon Sep 17 00:00:00 2001 From: Sarah Drasner Date: Sat, 18 Jul 2020 22:27:24 -0600 Subject: [PATCH 10/13] work on line highlighting again --- src/.vuepress/theme/styles/code.styl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/.vuepress/theme/styles/code.styl b/src/.vuepress/theme/styles/code.styl index 9706915e36..a98992d21b 100644 --- a/src/.vuepress/theme/styles/code.styl +++ b/src/.vuepress/theme/styles/code.styl @@ -166,6 +166,7 @@ div.reactivecontent .token.comment, .token.block-comment, .token.prolog, .token.doctype, .token.cdata color #848486 -div[class*=language-].line-numbers-mode .line-numbers-wrapper +div[class*=language-].line-numbers-mode .line-numbers-wrapper, div[class*=language-].line-numbers-mode:after background-color #f6f6f6 - color #3a385d \ No newline at end of file + color #3a385d + border-right 1px solid rgba(255, 255, 255, 0.9) \ No newline at end of file From d18b2615812cb86e41d00bfedfea576a2f5a9500 Mon Sep 17 00:00:00 2001 From: Sarah Drasner Date: Sat, 18 Jul 2020 22:33:58 -0600 Subject: [PATCH 11/13] fix the border on line highlighting --- src/.vuepress/theme/styles/code.styl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/.vuepress/theme/styles/code.styl b/src/.vuepress/theme/styles/code.styl index a98992d21b..5c79a99c3c 100644 --- a/src/.vuepress/theme/styles/code.styl +++ b/src/.vuepress/theme/styles/code.styl @@ -169,4 +169,4 @@ div.reactivecontent div[class*=language-].line-numbers-mode .line-numbers-wrapper, div[class*=language-].line-numbers-mode:after background-color #f6f6f6 color #3a385d - border-right 1px solid rgba(255, 255, 255, 0.9) \ No newline at end of file + border-right 1px solid #e7e6e6 \ No newline at end of file From 719bb7157051862404cc5d85e04c6532b731a52d Mon Sep 17 00:00:00 2001 From: Sarah Drasner Date: Sat, 18 Jul 2020 22:49:55 -0600 Subject: [PATCH 12/13] make line numbers less severe --- src/.vuepress/theme/styles/code.styl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/.vuepress/theme/styles/code.styl b/src/.vuepress/theme/styles/code.styl index 5c79a99c3c..48c4553198 100644 --- a/src/.vuepress/theme/styles/code.styl +++ b/src/.vuepress/theme/styles/code.styl @@ -168,5 +168,5 @@ div.reactivecontent div[class*=language-].line-numbers-mode .line-numbers-wrapper, div[class*=language-].line-numbers-mode:after background-color #f6f6f6 - color #3a385d + color #848486 border-right 1px solid #e7e6e6 \ No newline at end of file From 089144f689a56f09075b1dc1328007a4bdaf5585 Mon Sep 17 00:00:00 2001 From: Sarah Drasner Date: Sat, 18 Jul 2020 23:06:19 -0600 Subject: [PATCH 13/13] make line numbers less severe --- src/.vuepress/theme/styles/code.styl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/.vuepress/theme/styles/code.styl b/src/.vuepress/theme/styles/code.styl index 48c4553198..5309e2183f 100644 --- a/src/.vuepress/theme/styles/code.styl +++ b/src/.vuepress/theme/styles/code.styl @@ -168,5 +168,5 @@ div.reactivecontent div[class*=language-].line-numbers-mode .line-numbers-wrapper, div[class*=language-].line-numbers-mode:after background-color #f6f6f6 - color #848486 + color #c4c4c6 border-right 1px solid #e7e6e6 \ No newline at end of file