From f64ee4845638afcba4e58dae6e0126e70460324e Mon Sep 17 00:00:00 2001 From: Yashu Mittal Date: Sun, 7 Jul 2019 11:00:46 +0530 Subject: [PATCH 1/4] Create sidebar component --- src/components/Sidebar.vue | 130 +++++++++++++++++++++++++++++++++++++ src/layouts/Docs.vue | 117 --------------------------------- 2 files changed, 130 insertions(+), 117 deletions(-) create mode 100644 src/components/Sidebar.vue diff --git a/src/components/Sidebar.vue b/src/components/Sidebar.vue new file mode 100644 index 00000000..bee35192 --- /dev/null +++ b/src/components/Sidebar.vue @@ -0,0 +1,130 @@ + + + + + diff --git a/src/layouts/Docs.vue b/src/layouts/Docs.vue index 5c3c0e5f..45bea210 100644 --- a/src/layouts/Docs.vue +++ b/src/layouts/Docs.vue @@ -2,25 +2,6 @@
-
- -
-
- - -
@@ -45,22 +22,13 @@ import Header from "../components/Header"; import PostLayout from "./Post"; import Navbar from "./partials/Navbar"; -import LeftArrow from "../assets/images/chevrons-left.svg"; -import RightArrow from "../assets/images/chevrons-right.svg"; export default { name: "DocsLayout", - data() { - return { - sidebarToggleable: false - }; - }, components: { Header, PostLayout, Navbar, - LeftArrow, - RightArrow }, props: { title: String, @@ -68,19 +36,11 @@ export default { titleBorder: Boolean, menu: Array }, - computed: { - sidebar() { - return this.sidebarToggleable && window.innerWidth <= 768; - } - }, methods: { - toggleSidebar() { - this.sidebarToggleable = !this.sidebarToggleable; }, linkToDocs(link) { this.sidebarToggleable = false; this.$router.push(link); - } } }; @@ -91,36 +51,6 @@ export default { display: flex flex-direction: row - &__sidebar - position: sticky - border-right: 1px solid rgba(#474C55, .3) - max-width: 300px - overflow-y: scroll - top: 69px - padding: - top: 1rem - left: 2rem - right: 2rem - bottom: 2rem - height: calc(100vh - 69px) - z-index: 5 - background-color: white - - &-toggle - position: fixed - background-color: #00ADB5 - bottom: 4.225rem - cursor: pointer - right: 1.5rem - display: flex - border-radius: 50px - padding: .6rem - - svg - stroke: white - width: 25px - height: 25px - &__content padding-top: 2rem padding-bottom: 2rem @@ -132,51 +62,4 @@ export default { margin-right: auto padding-left: 20px padding-right: 20px - -.sidebar - &__menu - &-heading - color: rgba(#474C55, .5) - font-weight: 600 - margin-top: 2rem - margin-bottom: .5rem - border-top: 1px solid rgba(#474C55, .2) - padding-top: 2rem - text-transform: uppercase - - &:first-child - border: none - margin-top: 0 - - &-item - display: flex - flex-direction: column - padding: 3px 10px - margin-bottom: 5px - color: rgba(#474C55, .8) - font-weight: 500 - cursor: pointer - - &:hover - color: #00ADB5 - - &-item.active--exact - background-color: rgba(#00ADB5, .1) - color: #00ADB5 - border-radius: 1rem - -@media (max-width: 768px) - .docs - &__sidebar - position: fixed - padding: - left: 1rem - right: 1rem - - &-none - display: none - -@media (min-width: 768px) - .docs__sidebar-toggle - display: none From 18e360ae0fe26fe34af2fa122246bbb0768526c2 Mon Sep 17 00:00:00 2001 From: Yashu Mittal Date: Sun, 7 Jul 2019 11:02:15 +0530 Subject: [PATCH 2/4] Move docs layout to template --- src/layouts/Docs.vue | 65 --------------------------------------- src/templates/DocPage.vue | 36 ++++++++++++++-------- 2 files changed, 24 insertions(+), 77 deletions(-) delete mode 100644 src/layouts/Docs.vue diff --git a/src/layouts/Docs.vue b/src/layouts/Docs.vue deleted file mode 100644 index 45bea210..00000000 --- a/src/layouts/Docs.vue +++ /dev/null @@ -1,65 +0,0 @@ - - - - - diff --git a/src/templates/DocPage.vue b/src/templates/DocPage.vue index a55f8769..5cfcd0a9 100644 --- a/src/templates/DocPage.vue +++ b/src/templates/DocPage.vue @@ -1,20 +1,21 @@