From afc40e61cda8ef4cc70a061e600bdf27339aff7b Mon Sep 17 00:00:00 2001 From: Kia Ishii Date: Fri, 20 Nov 2020 19:28:16 +0900 Subject: [PATCH] refactor(theme): refactor variaous styles --- .../theme-default/components/EditLink.vue | 9 +- src/client/theme-default/components/Home.vue | 18 +- .../theme-default/components/NavBar.vue | 2 +- .../theme-default/components/NavBarLink.vue | 6 +- .../theme-default/components/NavBarLinks.vue | 2 +- .../components/NavDropdownLink.vue | 8 +- .../components/NextAndPrevLinks.vue | 4 +- .../theme-default/components/SideBar.vue | 8 +- .../components/icons/OutboundLink.vue | 8 +- src/client/theme-default/styles/code.css | 4 +- .../theme-default/styles/custom-blocks.css | 4 +- src/client/theme-default/styles/layout.css | 275 ++++++++++-------- src/client/theme-default/styles/vars.css | 49 +++- 13 files changed, 222 insertions(+), 175 deletions(-) diff --git a/src/client/theme-default/components/EditLink.vue b/src/client/theme-default/components/EditLink.vue index 7a464e16..19d73490 100644 --- a/src/client/theme-default/components/EditLink.vue +++ b/src/client/theme-default/components/EditLink.vue @@ -35,20 +35,17 @@ export default defineComponent({ } .link { + display: inline-block; font-weight: 500; - color: var(--text-color-light); + color: var(--c-text-light); } .link:hover { text-decoration: none; - color: var(--accent-color); + color: var(--c-brand); } .icon { - display: inline-block; margin-left: 4px; - width: 1rem; - height: 1rem; - transform: translateY(-1px); } diff --git a/src/client/theme-default/components/Home.vue b/src/client/theme-default/components/Home.vue index 6bb07d34..0b79bf50 100644 --- a/src/client/theme-default/components/Home.vue +++ b/src/client/theme-default/components/Home.vue @@ -114,7 +114,7 @@ export default defineComponent({ max-width: 35rem; font-size: 1.6rem; line-height: 1.3; - /* TODO: calculating lighten 40% color with using style :vars from `--text-color` */ + /* TODO: calculating lighten 40% color with using style :vars from `--c-text` */ color: #6a8bad; } @@ -122,23 +122,23 @@ export default defineComponent({ display: inline-block; font-size: 1.2rem; color: #fff; - background-color: var(--accent-color); + background-color: var(--c-brand); margin-left: 0; padding: 0.8rem 1.6rem; border-radius: 4px; transition: background-color .1s ease; box-sizing: border-box; - /* TODO: calculating darken 10% color with using style vars from `--accent-color` */ + /* TODO: calculating darken 10% color with using style vars from `--c-brand` */ border-bottom: 1px solid #389d70; } ::v-deep(.nav-link:hover) { - /* TODO: calculating lighten 10% color with using style vars from `--accent-color` */ + /* TODO: calculating lighten 10% color with using style vars from `--c-brand` */ background-color: #4abf8a; } .features { - border-top: 1px solid var(--border-color); + border-top: 1px solid var(--c-divider); padding: 1.2rem 0; margin-top: 2.5rem; display: flex; @@ -159,20 +159,20 @@ export default defineComponent({ font-weight: 500; border-bottom: none; padding-bottom: 0; - /* TODO: calculating lighten 10% color with using style :vars from `--text-color` */ + /* TODO: calculating lighten 10% color with using style :vars from `--c-text` */ color: #3a5169; } .feature p { - /* TODO: calculating lighten 25% color with using style :vars from `--text-color` */ + /* TODO: calculating lighten 25% color with using style :vars from `--c-text` */ color: #4e6e8e; } .footer { padding: 2.5rem; - border-top: 1px solid var(--border-color); + border-top: 1px solid var(--c-divider); text-align: center; - /* TODO: calculating lighten 25% color with using style :vars from `--text-color` */ + /* TODO: calculating lighten 25% color with using style :vars from `--c-text` */ color: #4e6e8e; } diff --git a/src/client/theme-default/components/NavBar.vue b/src/client/theme-default/components/NavBar.vue index 6a8c10f9..f38a6cac 100644 --- a/src/client/theme-default/components/NavBar.vue +++ b/src/client/theme-default/components/NavBar.vue @@ -23,7 +23,7 @@ .title { font-size: 1.3rem; font-weight: 600; - color: var(--text-color); + color: var(--c-text); } .title:hover { diff --git a/src/client/theme-default/components/NavBarLink.vue b/src/client/theme-default/components/NavBarLink.vue index e0cca82f..31027d29 100644 --- a/src/client/theme-default/components/NavBarLink.vue +++ b/src/client/theme-default/components/NavBarLink.vue @@ -39,13 +39,13 @@ font-size: 0.9rem; font-weight: 500; line-height: 1.4rem; - color: var(--text-color); + color: var(--c-text); white-space: nowrap; } .nav-link:hover, .nav-link.active { - border-bottom-color: var(--accent-color); + border-bottom-color: var(--c-brand); text-decoration: none; } @@ -64,7 +64,7 @@ .nav-link:hover, .nav-link.active { - color: var(--accent-color); + color: var(--c-brand); } } diff --git a/src/client/theme-default/components/NavBarLinks.vue b/src/client/theme-default/components/NavBarLinks.vue index 9d1d5df2..55d8f5aa 100644 --- a/src/client/theme-default/components/NavBarLinks.vue +++ b/src/client/theme-default/components/NavBarLinks.vue @@ -27,7 +27,7 @@ display: block; height: auto; padding: 0.5rem 0 1rem; - border-bottom: 1px solid var(--border-color); + border-bottom: 1px solid var(--c-divider); } } diff --git a/src/client/theme-default/components/NavDropdownLink.vue b/src/client/theme-default/components/NavDropdownLink.vue index 2d61a065..864b0ca8 100644 --- a/src/client/theme-default/components/NavDropdownLink.vue +++ b/src/client/theme-default/components/NavDropdownLink.vue @@ -52,7 +52,7 @@ .dropdown-wrapper .dropdown-title { font: inherit; - color: var(--text-color); + color: var(--c-text); font-size: 0.9rem; font-weight: 500; display: inline-block; @@ -114,18 +114,18 @@ } .dropdown-wrapper .nav-dropdown .dropdown-item a:hover { - color: var(--accent-color); + color: var(--c-brand); } .dropdown-wrapper .nav-dropdown .dropdown-item a.active { - color: var(--accent-color); + color: var(--c-brand); } .dropdown-wrapper .nav-dropdown .dropdown-item a.active::after { content: ''; width: 0; height: 0; - border-left: 5px solid var(--accent-color); + border-left: 5px solid var(--c-brand); border-top: 3px solid transparent; border-bottom: 3px solid transparent; position: absolute; diff --git a/src/client/theme-default/components/NextAndPrevLinks.vue b/src/client/theme-default/components/NextAndPrevLinks.vue index 3ebaa70e..cdc5d616 100644 --- a/src/client/theme-default/components/NextAndPrevLinks.vue +++ b/src/client/theme-default/components/NextAndPrevLinks.vue @@ -49,7 +49,7 @@ export default defineComponent({ .container { display: flex; justify-content: space-between; - border-top: 1px solid var(--border-color); + border-top: 1px solid var(--c-divider); padding-top: 1rem; } @@ -90,7 +90,7 @@ export default defineComponent({ flex-shrink: 0; width: 16px; height: 16px; - fill: var(--text-color); + fill: var(--c-text); } .icon-prev { margin-right: 8px; } diff --git a/src/client/theme-default/components/SideBar.vue b/src/client/theme-default/components/SideBar.vue index 8b0479c4..72ab630c 100644 --- a/src/client/theme-default/components/SideBar.vue +++ b/src/client/theme-default/components/SideBar.vue @@ -80,17 +80,17 @@ line-height: 1.7; font-size: 1.05em; font-weight: 700; - color: var(--text-color); + color: var(--c-text); } a.sidebar-link:hover { text-decoration: none; - color: var(--accent-color); + color: var(--c-brand); } a.sidebar-link.active { - border-left-color: var(--accent-color); + border-left-color: var(--c-brand); font-weight: 600; - color: var(--accent-color); + color: var(--c-brand); } diff --git a/src/client/theme-default/components/icons/OutboundLink.vue b/src/client/theme-default/components/icons/OutboundLink.vue index e4b24e6a..deb1c742 100644 --- a/src/client/theme-default/components/icons/OutboundLink.vue +++ b/src/client/theme-default/components/icons/OutboundLink.vue @@ -1,13 +1,13 @@