Skip to content
This repository has been archived by the owner on Apr 24, 2023. It is now read-only.

Commit

Permalink
feat: update style
Browse files Browse the repository at this point in the history
  • Loading branch information
Mister-Hope committed Jun 4, 2022
1 parent bbc6af3 commit d7b44a5
Show file tree
Hide file tree
Showing 37 changed files with 379 additions and 415 deletions.
2 changes: 1 addition & 1 deletion demo/src/layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ This is just a demo, you should add styles according to your own needs.
text-align center

.content__page-top, .content__page-bottom, .content__content-top, .content__content-bottom
@extend $wrapper
wrapper()
padding-top 0
padding-bottom 0
text-align center
Expand Down
2 changes: 1 addition & 1 deletion demo/src/zh/layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ icon: layout
text-align center

.content__page-top, .content__page-bottom, .content__content-top, .content__content-bottom
@extend $wrapper
wrapper()
padding-top 0
padding-bottom 0
text-align center
Expand Down
4 changes: 2 additions & 2 deletions docs/theme/src/config/stylus.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ $navbarMobileHorizontalPadding ?= 1rem
$navbarVerticalPadding ?= 0.7rem
$navbarMobileVerticalPadding ?= 0.4rem
$sidebarWidth ?= 18rem
$mobileSidebarWidth ?= $sidebarWidth
$sidebarMobileWidth ?= $sidebarWidth
$contentWidth ?= 740px
$homePageWidth ?= 960px
```
Expand Down Expand Up @@ -77,7 +77,7 @@ $badgeErrorColor ?= #DA5961
$contentClass ?= '.theme-default-content'
/* code block */
$lineNumbersWrapperWidth ?= 2.5rem
$lineNumbersWidth ?= 2.5rem
$codeLang ?= js ts html md vue css sass scss less stylus go java c sh yaml py docker dockerfile makefile
```

Expand Down
4 changes: 2 additions & 2 deletions docs/theme/src/zh/config/stylus.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ $navbarMobileHorizontalPadding ?= 1rem
$navbarVerticalPadding ?= 0.7rem
$navbarMobileVerticalPadding ?= 0.4rem
$sidebarWidth ?= 18rem
$mobileSidebarWidth ?= $sidebarWidth
$sidebarMobileWidth ?= $sidebarWidth
$contentWidth ?= 740px
$homePageWidth ?= 960px
```
Expand Down Expand Up @@ -77,7 +77,7 @@ $badgeErrorColor ?= #DA5961
$contentClass ?= '.theme-default-content'
/* code block */
$lineNumbersWrapperWidth ?= 2.5rem
$lineNumbersWidth ?= 2.5rem
$codeLang ?= js ts html md vue css sass scss less stylus go java c sh yaml py docker dockerfile makefile
```

Expand Down
2 changes: 1 addition & 1 deletion packages/comment/src/client/components/Valine.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
.page {
.valine-wrapper {
@extend $wrapper;
wrapper();
.v[data-class=v] {
* {
Expand Down
6 changes: 3 additions & 3 deletions packages/comment/src/client/styles/waline.styl
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@

.page {
.waline-wrapper {
@extend $wrapper;
wrapper();
--waline-accent-color: var(--accent-color);
--waline-text-color: var(--text-color);
--waline-active-color: var(--accent-color-l10);
--waline-active-color: var(--accent-color-light);
--waline-border: none;
--waline-box-shadow: 0 12px 40px rgba(134, 151, 168, 0.25);

html.dark & {
--waline-active-color: var(--accent-color-d10);
--waline-active-color: var(--accent-color-dark);
--waline-box-shadow: 0 12px 40px #0f0e0d;
}
}
Expand Down
6 changes: 3 additions & 3 deletions packages/components/src/client/BreadCrumb.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ h1, h2, h3, h4, h5, h6 {
}
.breadcrumb {
@extend $wrapper;
wrapper();
position: relative;
margin-top: $navbarHeight + 0.5rem;
margin-bottom: 0.5rem - $navbarHeight;
Expand Down Expand Up @@ -113,10 +113,10 @@ h1, h2, h3, h4, h5, h6 {
}
&:hover {
color: var(--accent-color-l10, lighten($accentColor, 10%));
color: var(--accent-color-light, lighten($accentColor, 10%));
html.dark & {
color: var(--accent-color-d10, darken($accentColor, 10%));
color: var(--accent-color-dark, darken($accentColor, 10%));
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/client/PageInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ $pageInfoTextSize ?= 14px;
.page {
.page-title {
@extend $wrapper;
wrapper();
padding-bottom: 0.2rem;
position: relative;
z-index: 1;
Expand Down
2 changes: 1 addition & 1 deletion packages/copy-code/src/client/style/code.styl
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
outline: none;

&:hover {
background-color: var(--code-hl-bg-color, rgb(0 0 0 / 66%));
background-color: var(--code-hl-bg-color, rgba(0, 0, 0, 66%));
cursor: pointer !important;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/create/template/layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ This is just a demo, you should add styles according to your own needs.
text-align center

.content__page-top, .content__page-bottom, .content__content-top, .content__content-bottom
@extend $wrapper
wrapper()
padding-top 0
padding-bottom 0
text-align center
Expand Down
2 changes: 1 addition & 1 deletion packages/create/template/zh/layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ icon: layout
text-align center

.content__page-top, .content__page-bottom, .content__content-top, .content__content-bottom
@extend $wrapper
wrapper()
padding-top 0
padding-bottom 0
text-align center
Expand Down
4 changes: 2 additions & 2 deletions packages/pwa/src/client/components/PWAInstallModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@
color: var(--white, #fff);
&:hover, &:focus {
background: var(--accent-color-l10, $accentColor);
background: var(--accent-color-light, $accentColor);
}
@media (max-width: $MQMobileNarrow) {
Expand All @@ -421,7 +421,7 @@
color: var(--accent-color, $accentColor);
&:hover, &:focus {
background: var(--accent-color-l10, $accentColor);
background: var(--accent-color-light, $accentColor);
color: var(--white, #fff);
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/shared/styles/wrapper.styl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$wrapper {
wrapper() {
max-width: $contentWidth;
margin: 0 auto;
padding: 2rem 2.5rem;
Expand All @@ -12,7 +12,7 @@ $wrapper {
}
}

$horizontal-wrapper {
horizontal-wrapper() {
max-width: var(--content-width);
margin-right: auto;
margin-left: auto;
Expand Down
2 changes: 1 addition & 1 deletion packages/theme/components/Blog/ArticleItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
// line number fix
.line-numbers-mode {
pre {
padding-left: ($lineNumbersWrapperWidth + 1) rem;
padding-left: ($lineNumbersWidth + 1) rem;
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/theme/components/Blog/BlogInfoList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,11 @@
&.active {
html.light & {
background: var(--accent-color-l10);
background: var(--accent-color-light);
}
html.dark & {
background: var(--accent-color-d10);
background: var(--accent-color-dark);
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/theme/components/Blog/CategoryList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ for $color, $index in $colors {
}
&.active {
background: var(--accent-color-d10);
background: var(--accent-color-dark);
color: var(--white);
}
}
Expand Down
15 changes: 5 additions & 10 deletions packages/theme/components/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,15 @@
<style lang="stylus">
.home {
display: block;
max-width: $homePageWidth;
min-height: 100vh - $navbarHeight;
padding: $navbarHeight 2rem 0;
margin: 0px auto;
overflow-x: hidden;
@media (max-width: $MQNarrow) {
min-height: 100vh - $navbarMobileHeight;
padding-top: $navbarMobileHeight;
}
max-width: var(--home-page-width);
min-height: calc(100vh - var(--navbar-height));
margin: 0 auto;
padding: var(--navbar-height) 2rem 0;
@media (max-width: $MQMobileNarrow) {
padding-left: 1.5rem;
padding-right: 1.5rem;
padding-left: 1.5rem;
}
{$contentClass} {
Expand Down
4 changes: 2 additions & 2 deletions packages/theme/components/HomeFeatures.vue
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
margin: 0.25rem 0;
border-bottom: none;
color: var(--text-color-l10);
color: var(--text-color-light);
font-weight: bold;
font-size: 1.25rem;
Expand All @@ -127,7 +127,7 @@
p {
margin: 0;
color: var(--text-color-l25);
color: var(--text-color-lighter);
line-height: 1.4;
}
}
Expand Down
6 changes: 3 additions & 3 deletions packages/theme/components/HomeHero.vue
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
.description {
max-width: 35rem;
color: var(--text-color-l40);
color: var(--text-color-bright);
font-size: 1.6rem;
font-family: var(--font-family-fancy);
Expand Down Expand Up @@ -187,8 +187,8 @@
color: var(--white);
&:hover {
border-color: var(--accent-color-l10);
background-color: var(--accent-color-l10);
border-color: var(--accent-color-light);
background-color: var(--accent-color-light);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/theme/components/Navbar/NavLinks.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
right: 50%;
bottom: 0px;
height: 2px;
background: var(--accent-color-l10);
background: var(--accent-color-light);
border-radius: 1px;
visibility: hidden;
transition: left 0.2s ease-in-out, right 0.2s ease-in-out;
Expand Down
2 changes: 1 addition & 1 deletion packages/theme/components/Page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
// narrow desktop / iPad
@media (max-width: $MQNarrow) {
padding-left: $mobileSidebarWidth;
padding-left: $sidebarMobileWidth;
}
// wide mobile
Expand Down
6 changes: 3 additions & 3 deletions packages/theme/components/PageMeta.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
@require '~vuepress-shared/styles/wrapper';
.page-meta {
@extend $wrapper;
wrapper();
padding-top: 12px;
padding-bottom: 12px;
font-family: Arial, Helvetica, sans-serif;
Expand All @@ -49,7 +49,7 @@
.meta-item {
.label {
font-weight: 500;
color: var(--text-color-l25);
color: var(--text-color-lighter);
}
.info {
Expand All @@ -75,7 +75,7 @@
}
a {
color: var(--accent-color-l10);
color: var(--accent-color-light);
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/theme/components/PageNav.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
@require '~vuepress-shared/styles/wrapper';
.page-nav {
@extend $wrapper;
wrapper();
padding-top: 12px;
padding-bottom: 0;
font-family: Arial, Helvetica, sans-serif;
Expand Down
2 changes: 1 addition & 1 deletion packages/theme/components/Password.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
@media (max-width: $MQNarrow) {
height: 90vh - $navbarMobileHeight;
margin-top: $navbarMobileHeight;
padding-left: $mobileSidebarWidth;
padding-left: $sidebarMobileWidth;
}
@media (max-width: $MQMobile) {
Expand Down
2 changes: 1 addition & 1 deletion packages/theme/components/Sidebar/Sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
// narrow desktop / iPad
@media (max-width: $MQNarrow) {
width: $mobileSidebarWidth;
width: $sidebarMobileWidth;
font-size: 15px;
}
Expand Down
16 changes: 6 additions & 10 deletions packages/theme/layouts/404.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<Common :sidebar="false">
<main class="page not-found">
<main id="main-content" class="page not-found">
<Page404Icon />
<blockquote v-text="msg" />
<button class="action-button" @click="back">{{ locales.back }}</button>
Expand All @@ -15,18 +15,13 @@
.page.not-found {
display: block;
max-width: $homePageWidth;
max-width: var(--home-page-width);
min-height: 80vh;
margin: 0 auto;
padding: ($navbarHeight + 1rem) 2rem 0 2rem !important;
padding: calc(var(--navbar-height) + 1rem) 2rem 0 2rem !important;
text-align: center;
@media (max-width: $MQMobile) {
padding-top: $navbarMobileHeight + 1rem;
}
.page-404-icon {
max-width: 600px;
margin: 0 1.5rem;
Expand All @@ -40,8 +35,9 @@
margin: 0 0.25rem;
padding: 0.5rem 1rem;
border-width: 0;
border-bottom: 1px solid var(--accent-color-d10);
border-bottom: 1px solid var(--accent-color-dark);
border-radius: 0.25rem;
background: var(--accent-color);
color: var(--white);
outline: none;
Expand All @@ -51,7 +47,7 @@
transition: background 0.1s ease;
&:hover {
background: var(--accent-color-l10);
background: var(--accent-color-light);
cursor: pointer;
}
}
Expand Down
Loading

0 comments on commit d7b44a5

Please sign in to comment.