Skip to content

Commit

Permalink
feat($theme-default): using '.theme-default-content' to replace '.con…
Browse files Browse the repository at this point in the history
…tent' in `<Content />` outlet.
  • Loading branch information
ulivz committed Jun 2, 2019
1 parent d84bfe7 commit 85ff630
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/@vuepress/theme-default/components/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
</div>
</div>

<Content class="content custom"/>
<Content class="theme-default-content custom"/>

<div
class="footer"
Expand Down
2 changes: 1 addition & 1 deletion packages/@vuepress/theme-default/components/Page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<main class="page">
<slot name="top"/>

<Content class="content"/>
<Content class="theme-default-content"/>

<footer class="page-edit">
<div
Expand Down
28 changes: 22 additions & 6 deletions packages/@vuepress/theme-default/styles/index.styl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
@require './wrapper'
@require './toc'

$contentClass = '.theme-default-content'

html, body
padding 0
margin 0
Expand Down Expand Up @@ -53,22 +55,26 @@ body
border-right 1px solid $borderColor
overflow-y auto

.content:not(.custom)
{$contentClass}:not(.custom)
@extend $wrapper
> *:first-child
margin-top $navbarHeight

a:hover
text-decoration underline

p.demo
padding 1rem 1.5rem
border 1px solid #ddd
border-radius 4px

img
max-width 100%

.content.custom
{$contentClass}.custom
padding 0
margin 0

img
max-width 100%

Expand All @@ -94,6 +100,7 @@ blockquote
border-left .5rem solid #dfe2e5
margin 0.5rem 0
padding .25rem 0 .25rem 1rem

& > p
margin 0

Expand All @@ -106,15 +113,19 @@ strong
h1, h2, h3, h4, h5, h6
font-weight 600
line-height 1.25
.content:not(.custom) > &

{$contentClass}:not(.custom) > &
margin-top (0.5rem - $navbarHeight)
padding-top ($navbarHeight + 1rem)
margin-bottom 0

&:first-child
margin-top -1.5rem
margin-bottom 1rem

+ p, + pre, + .custom-block
margin-top 2rem

&:hover .header-anchor
opacity: 1

Expand All @@ -136,6 +147,7 @@ a.header-anchor
padding-right 0.23em
margin-top 0.125em
opacity 0

&:hover
text-decoration none

Expand All @@ -157,6 +169,7 @@ table

tr
border-top 1px solid #dfe2e5

&:nth-child(2n)
background-color #f6f8fa

Expand All @@ -168,10 +181,12 @@ th, td
&.sidebar-open
.sidebar-mask
display: block

&.no-navbar
.content:not(.custom) > h1, h2, h3, h4, h5, h6
margin-top 1.5rem
padding-top 0
{$contentClass}:not(.custom) > h1, h2, h3, h4, h5, h6
margin-top 1.5rem
padding-top 0

.sidebar
top 0

Expand All @@ -180,6 +195,7 @@ th, td
.theme-container.no-sidebar
.sidebar
display none

.page
padding-left 0

Expand Down

0 comments on commit 85ff630

Please sign in to comment.