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) { diff --git a/src/.vuepress/theme/styles/code.styl b/src/.vuepress/theme/styles/code.styl index 4e8a574ab0..5309e2183f 100644 --- a/src/.vuepress/theme/styles/code.styl +++ b/src/.vuepress/theme/styles/code.styl @@ -17,20 +17,22 @@ 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 + 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 @@ -50,7 +52,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 +68,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 @@ -138,4 +140,33 @@ 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 + +.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 + +.token.boolean, .token.number, .token.function + color #c25205 + +.token.property, .token.class-name, .token.constant, .token.symbol + color #717c11 + +.token.operator, .token.entity, .token.url + color #0b7e7d + +.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:after + background-color #f6f6f6 + color #c4c4c6 + border-right 1px solid #e7e6e6 \ No newline at end of file diff --git a/src/.vuepress/theme/styles/index.styl b/src/.vuepress/theme/styles/index.styl index 14e77c7dd7..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 @@ -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