From 7a820e976295f7e486830515e700f35204c69c3c Mon Sep 17 00:00:00 2001 From: ULIVZ <472590061@qq.com> Date: Sun, 3 Feb 2019 19:51:28 +0800 Subject: [PATCH 01/12] feat($theme-default): clickable heading for sidebar groups --- .../theme-default/components/SidebarGroup.vue | 63 +++++++++++++------ .../@vuepress/theme-default/util/index.js | 2 + 2 files changed, 46 insertions(+), 19 deletions(-) diff --git a/packages/@vuepress/theme-default/components/SidebarGroup.vue b/packages/@vuepress/theme-default/components/SidebarGroup.vue index 4b5b756536..c2f3f06949 100644 --- a/packages/@vuepress/theme-default/components/SidebarGroup.vue +++ b/packages/@vuepress/theme-default/components/SidebarGroup.vue @@ -3,7 +3,26 @@ class="sidebar-group" :class="{ first, collapsable }" > + + {{ item.title }} + + + + - - - + diff --git a/packages/@vuepress/theme-default/components/SidebarGroup.vue b/packages/@vuepress/theme-default/components/SidebarGroup.vue index af2e9e16f4..88fdfe2f9c 100644 --- a/packages/@vuepress/theme-default/components/SidebarGroup.vue +++ b/packages/@vuepress/theme-default/components/SidebarGroup.vue @@ -4,13 +4,13 @@ :class="{ collapsable }" > {{ item.title }} @@ -70,6 +70,20 @@ export default { .sidebar-heading:not(.clickable) cursor auto color inherit + // refine styles of nested sidebar groups + & > .sidebar-links > li > .sidebar-group + padding-left 0 + & > .sidebar-heading + font-size 15px + font-weight normal + padding-left 2rem + &:not(.clickable) + opacity 0.5 + & > .sidebar-group-items + padding-left 1rem + & > li > .sidebar-link + font-size: 0.95em; + border-left none .sidebar-heading color #999 @@ -89,8 +103,6 @@ export default { position relative top -0.12em left 0.5em - &:.open .arrow - top -0.18em &.clickable &.active font-weight 600 diff --git a/packages/@vuepress/theme-default/components/SidebarLinks.vue b/packages/@vuepress/theme-default/components/SidebarLinks.vue index 2d491f0274..8b32ee8fd1 100644 --- a/packages/@vuepress/theme-default/components/SidebarLinks.vue +++ b/packages/@vuepress/theme-default/components/SidebarLinks.vue @@ -1,5 +1,8 @@ diff --git a/packages/@vuepress/theme-default/components/SidebarGroup.vue b/packages/@vuepress/theme-default/components/SidebarGroup.vue index 88fdfe2f9c..3cc11c4b12 100644 --- a/packages/@vuepress/theme-default/components/SidebarGroup.vue +++ b/packages/@vuepress/theme-default/components/SidebarGroup.vue @@ -1,7 +1,13 @@