-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(umi-plugin): add styles for content area (#12)
- Loading branch information
1 parent
737db7a
commit 7a934c0
Showing
5 changed files
with
163 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
147 changes: 147 additions & 0 deletions
147
packages/umi-plugin-father-doc/src/themes/default/markdown.less
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,147 @@ | ||
@import (reference) './variables.less'; | ||
@import '~prismjs/themes/prism.css'; | ||
|
||
:global { | ||
.markdown { | ||
color: @c-text; | ||
font-size: 14px; | ||
line-height: 1.40625; | ||
|
||
// titles | ||
h1, h2, h3, h4, h5, h6 { | ||
margin: 32px 0 16px; | ||
color: @c-heading; | ||
font-weight: 500; | ||
line-height: 1.40625; | ||
|
||
// anchor link | ||
&:hover > a[aria-hidden] { | ||
float: left; | ||
margin-top: 0.06em; | ||
margin-left: -20px; | ||
width: 20px; | ||
padding-right: 4px; | ||
line-height: 1; | ||
|
||
&::after { | ||
content: '#'; | ||
display: inline-block; | ||
vertical-align: middle; | ||
font-size: 20px; | ||
} | ||
|
||
span { | ||
display: none; | ||
} | ||
} | ||
|
||
+ h1, + h2, + h3, + h4, + h5, + h6 { | ||
margin-top: 16px; | ||
} | ||
} | ||
|
||
h1 { | ||
font-size: 32px; | ||
} | ||
|
||
h2 { | ||
font-size: 24px; | ||
} | ||
|
||
h3 { | ||
font-size: 20px; | ||
} | ||
|
||
h4 { | ||
font-size: 18px; | ||
} | ||
|
||
h5 { | ||
font-size: 16px; | ||
} | ||
|
||
h6 { | ||
font-size: 14px; | ||
} | ||
|
||
// paragraph | ||
p { | ||
margin: 16px 0; | ||
} | ||
|
||
// inline code | ||
*:not(pre) code { | ||
padding: 2px 5px; | ||
color: #D56161; | ||
background: darken(@c-light-bg, 1%); | ||
} | ||
|
||
// code block | ||
pre { | ||
background: darken(@c-light-bg, 1%); | ||
|
||
&:not([class^='language-']) { | ||
padding: 1em; | ||
} | ||
} | ||
|
||
// horizontal line | ||
hr { | ||
margin: 16px 0; | ||
border: 0; | ||
border-top: 1px solid @c-border; | ||
} | ||
|
||
// blockquote | ||
blockquote { | ||
margin: 16px 0; | ||
padding: 0 24px; | ||
border-left: 4px solid @c-border; | ||
overflow: hidden; | ||
} | ||
|
||
// list | ||
ul, | ||
ol { | ||
margin: 8px 0 8px 32px; | ||
padding: 0; | ||
} | ||
|
||
// table | ||
table { | ||
width: 100%; | ||
border-collapse: collapse; | ||
border: 1px solid @c-border; | ||
|
||
th, td { | ||
padding: 10px 24px; | ||
border: 1px solid @c-border; | ||
} | ||
|
||
th { | ||
font-weight: 600; | ||
background: @c-light-bg; | ||
} | ||
|
||
td:first-child { | ||
font-weight: 500; | ||
} | ||
} | ||
|
||
// links | ||
a { | ||
color: @c-link; | ||
text-decoration: none; | ||
transition: opacity 0.2s; | ||
|
||
&:hover { | ||
opacity: 0.7; | ||
text-decoration: underline; | ||
} | ||
|
||
&:active { | ||
opacity: 0.9; | ||
} | ||
} | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
packages/umi-plugin-father-doc/src/themes/default/variables.less
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/* 颜色表 */ | ||
@c-primary: #4668AE; | ||
@c-heading: #454D64; | ||
@c-text: #454D64; | ||
@c-secondary: #7B7F8D; | ||
@c-link: #3F78EE; | ||
@c-border: #E3E6EF; | ||
@c-light-bg: #F9FAFB; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters