naive-ui/demo/styles/markdown.scss

154 lines
4.2 KiB
SCSS
Raw Normal View History

2019-09-29 17:54:20 +08:00
@import '../../styles/mixins/config.scss';
@import '../../styles/mixins/mixins.scss';
2019-09-29 17:54:20 +08:00
@include themes-mixin {
@if $theme == 'dark' {
.markdown {
2019-10-10 22:38:29 +08:00
font-size: 16px;
strong {
font-weight: 700;
}
2019-09-29 17:54:20 +08:00
h1, h2, h3, h4, h5, h6 {
2019-10-12 14:23:40 +08:00
transition: color .3s $default-cubic-bezier;
2019-09-29 17:54:20 +08:00
margin: 0;
2019-10-10 22:38:29 +08:00
font-weight: 700;
2019-09-29 17:54:20 +08:00
}
h1 {
2019-10-10 22:38:29 +08:00
font-size: 32px;
margin-bottom: 12px;
2019-09-29 17:54:20 +08:00
}
h2 {
2019-10-10 22:38:29 +08:00
font-size: 24px;
2019-09-29 17:54:20 +08:00
margin-top: 24px;
margin-bottom: 12px;
}
2019-10-10 22:38:29 +08:00
h3 {
font-size: 18px;
margin-top: 18px;
margin-bottom: 12px;
}
h4 {
font-size: 16px;
margin-top: 16px;
margin-bottom: 8px;
}
ul, ol {
padding-left: 0;
li {
2019-10-12 14:23:40 +08:00
transition: color .3s $default-cubic-bezier;
line-height: 1.875;
margin-bottom: 0px;
2019-10-10 22:38:29 +08:00
font-size: 14px;
2019-10-12 14:23:40 +08:00
color: $--n-secondary-text-color;
2019-10-10 22:38:29 +08:00
}
}
2019-09-29 17:54:20 +08:00
p {
2019-10-12 14:23:40 +08:00
transition: color .3s $default-cubic-bezier;
2019-10-10 22:38:29 +08:00
margin: 8px 0 0 0;
2019-09-29 17:54:20 +08:00
font-size: 14px;
line-height: 1.875;
2019-10-12 14:23:40 +08:00
color: $--n-secondary-text-color;
2019-09-29 17:54:20 +08:00
}
2019-10-10 22:38:29 +08:00
a {
2019-10-12 14:23:40 +08:00
transition: color .3s $default-cubic-bezier;
color: $--primary-6;
2019-10-10 22:38:29 +08:00
font-size: 14px;
}
code {
2019-10-12 14:23:40 +08:00
transition: background-color .3s $default-cubic-bezier, border-color .3s $default-cubic-bezier, color .3s $default-cubic-bezier;
}
2019-10-10 22:38:29 +08:00
pre {
width: 100%;
box-sizing: border-box;
& > code {
border-radius: 6px;
border: 1px solid $--n-divider-color;
display: block;
padding: 12px 16px 12px 16px;
background-color: $--n-card-color;
}
}
:not(pre) > code {
2019-10-18 16:45:40 +08:00
white-space: nowrap;
2019-09-29 17:54:20 +08:00
box-sizing: border-box;
border-radius: 3px;
2019-10-10 22:38:29 +08:00
background-color: rgba(255, 255, 255, .12);
2019-10-12 14:23:40 +08:00
color: $--n-secondary-text-color;
2019-10-10 22:38:29 +08:00
padding: 0em .4em .1em .4em;
2019-09-29 17:54:20 +08:00
font-size: 14px;
font-family: 'Lato';
border: 1px solid transparent;
2019-09-29 17:54:20 +08:00
}
table {
font-size: 14px;
width: 100%;
2019-10-10 22:38:29 +08:00
border: 1px solid $--n-divider-color;
2019-09-29 17:54:20 +08:00
border-radius: 6px;
text-align: left;
border-collapse: separate;
border-spacing: 0;
overflow: hidden;
transition: background-color .3s $default-cubic-bezier, border-color .3s $default-cubic-bezier, color .3s $default-cubic-bezier;
2019-09-29 17:54:20 +08:00
// background-color: $--n-alpha-table-body-color;
th {
transition: background-color .3s $default-cubic-bezier, border-color .3s $default-cubic-bezier;
2019-10-10 22:38:29 +08:00
background-color: $--n-table-header-color;
// background-clip: padding-box;
2019-09-29 17:54:20 +08:00
text-align: inherit;
padding: 14px 12px;
vertical-align: inherit;
font-style: none;
font-weight: 400;
text-transform: none;
border-left: none;
2019-10-10 22:38:29 +08:00
font-weight: 700;
border-bottom: 1px solid $--n-divider-color;
2019-09-29 17:54:20 +08:00
&:not(:last-child) {
2019-10-10 22:38:29 +08:00
border-right: 1px solid $--n-table-header-color;
2019-09-29 17:54:20 +08:00
}
}
td {
transition: background-color .3s $default-cubic-bezier, border-color .3s $default-cubic-bezier;
2019-10-10 22:38:29 +08:00
background-color: $--n-table-body-color;
// background-clip: padding-box;
2019-09-29 17:54:20 +08:00
padding: 12px;
}
}
&.footer-part {
margin-top: 16px;
}
}
2019-09-29 17:54:20 +08:00
} @else {
.n-config-provider--light-theme .markdown {
2019-10-12 14:23:40 +08:00
p, li, code {
color: $--n-secondary-text-color;
}
2019-10-10 22:38:29 +08:00
a {
2019-10-12 14:23:40 +08:00
color: $--primary-6;
2019-10-10 22:38:29 +08:00
}
pre {
& > code {
background-color: white;
2019-10-11 00:05:18 +08:00
border: 1px solid $--n-divider-color;
2019-10-10 22:38:29 +08:00
}
}
:not(pre) > code {
2019-09-29 17:54:20 +08:00
background-color: rgb(244, 244, 244);
border: 1px solid rgb(230, 230, 230);
}
table {
2019-10-11 00:05:18 +08:00
border: 1px solid $--n-divider-color;
2019-09-29 17:54:20 +08:00
th {
2019-10-10 22:38:29 +08:00
background: rgb(250, 250, 250);
border-bottom: 1px solid $--n-divider-color;
&:not(:last-child) {
border-right: 1px solid rgb(250, 250, 250);
}
2019-09-29 17:54:20 +08:00
}
td {
background-color: white;
}
}
}
}
}