naive-ui/styles/Typography.scss

249 lines
7.1 KiB
SCSS
Raw Normal View History

2019-12-20 16:53:59 +08:00
@import './mixins/mixins.scss';
2020-02-21 12:39:11 +08:00
@mixin header-mixin($level) {
2019-12-21 21:31:48 +08:00
@include b('h' + $level) {
2020-02-21 12:39:11 +08:00
@include once {
2020-02-21 14:59:17 +08:00
font-size: map-get($--n-typography-header-font-size, $level);
2020-02-27 23:02:58 +08:00
font-weight: $--n-strong-weight;
2020-02-21 14:59:17 +08:00
margin: map-get($--n-typography-header-margin, $level);
2020-02-21 12:39:11 +08:00
transition: color .3s $--n-ease-in-out-cubic-bezier;
&:first-child {
margin-top: 0
}
2019-12-20 16:53:59 +08:00
}
2020-02-21 12:39:11 +08:00
color: map-get($--typography-header-text-color, 'default');
2019-12-21 21:31:48 +08:00
@include m(prefix-bar) {
2020-02-21 12:39:11 +08:00
@include once {
position: relative;
2020-02-21 14:59:17 +08:00
padding-left: map-get($--n-typography-header-prefix-width, $level);
2020-02-21 12:39:11 +08:00
@include m(align-text) {
padding-left: 0;
&::before {
2020-02-21 14:59:17 +08:00
left: -(map-get($--n-typography-header-prefix-width, $level));
2020-02-21 12:39:11 +08:00
}
}
2019-12-21 21:31:48 +08:00
}
2020-02-21 12:39:11 +08:00
&::before {
@include once {
content: '';
2020-02-21 14:59:17 +08:00
width: map-get($--n-typography-header-bar-width, $level);
border-radius: map-get($--n-typography-header-bar-width, $level) / 2;
2020-02-21 12:39:11 +08:00
transition: background-color .3s $--n-ease-in-out-cubic-bezier;
left: 0;
top: 0;
bottom: 0;
position: absolute;
2019-12-21 21:31:48 +08:00
}
2020-02-21 12:39:11 +08:00
background-color: map-get($--typography-header-prefix-color, 'default');
2019-12-21 21:31:48 +08:00
}
2019-12-21 22:06:06 +08:00
@include m(default-type) {
&::before {
2020-02-21 12:39:11 +08:00
background-color: map-get($--typography-header-prefix-color, 'default');
2019-12-21 22:06:06 +08:00
}
}
@include m(primary-type) {
&::before {
2020-02-21 12:39:11 +08:00
background-color: map-get($--typography-header-prefix-color, 'primary');
2019-12-21 22:06:06 +08:00
}
}
@include m(info-type) {
&::before {
2020-02-21 12:39:11 +08:00
background-color: map-get($--typography-header-prefix-color, 'info');
2019-12-21 22:06:06 +08:00
}
}
@include m(success-type) {
&::before {
2020-02-21 12:39:11 +08:00
background-color: map-get($--typography-header-prefix-color, 'success');
2019-12-21 22:06:06 +08:00
}
}
@include m(warning-type) {
&::before {
2020-02-21 12:39:11 +08:00
background-color: map-get($--typography-header-prefix-color, 'warning');
2019-12-21 22:06:06 +08:00
}
}
@include m(error-type) {
&::before {
2020-02-21 12:39:11 +08:00
background-color: map-get($--typography-header-prefix-color, 'error');
2019-12-21 22:06:06 +08:00
}
}
2019-12-20 16:53:59 +08:00
}
}
2019-12-21 21:31:48 +08:00
}
@include themes-mixin {
@include header-mixin('1');
@include header-mixin('2');
@include header-mixin('3');
@include header-mixin('4');
@include header-mixin('5');
@include header-mixin('6');
2019-12-20 16:53:59 +08:00
@include b(p) {
2020-02-21 12:39:11 +08:00
@include once {
transition: color .3s $--n-ease-in-out-cubic-bezier;
margin: 12px 0 16px 0;
font-size: 14px;
line-height: 1.75;
&:first-child {
margin-top: 0;
}
}
2020-02-21 12:39:11 +08:00
color: map-get($--typography-p-text-color, 'default');
2020-02-19 12:35:47 +08:00
@include m(primary-depth) {
2020-02-21 12:39:11 +08:00
color: map-get($--typography-p-text-color, 'primary-depth');
}
2020-02-19 12:35:47 +08:00
@include m(secondary-depth) {
2020-02-21 12:39:11 +08:00
color: map-get($--typography-p-text-color, 'secondary-depth');
}
2020-02-19 12:35:47 +08:00
@include m(tertiary-depth) {
2020-02-21 12:39:11 +08:00
color: map-get($--typography-p-text-color, 'tertiary-depth');
}
2019-12-20 16:53:59 +08:00
}
2020-02-21 12:39:11 +08:00
@include once {
@include b(ul) {
margin: 12px 0;
&:first-child {
margin-top: 0;
}
&:last-child {
margin-bottom: 0;
}
padding-left: 1.75em;
@include m(align-text) {
padding-left: 0;
}
2019-12-20 16:53:59 +08:00
}
2020-02-21 12:39:11 +08:00
@include b(ol) {
margin: 12px 0;
&:first-child {
margin-top: 0;
}
&:last-child {
margin-bottom: 0;
}
padding-left: 1.75em;
@include m(align-text) {
padding-left: 0;
}
2019-12-21 21:31:48 +08:00
}
2019-12-20 16:53:59 +08:00
}
@include b(li) {
2020-02-21 12:39:11 +08:00
@include once {
transition: color .3s $--n-ease-in-out-cubic-bezier;
line-height: 1.75em;
margin-bottom: 0px;
font-size: 14px;
}
color: map-get($--typography-li-text-color, 'default');
2019-12-20 16:53:59 +08:00
}
@include b(a) {
2020-02-21 12:39:11 +08:00
@include once {
transition: color .3s $--n-ease-in-out-cubic-bezier;
cursor: pointer;
}
text-decoration-color: map-get($--typography-a-text-color, 'default');
color: map-get($--typography-a-text-color, 'default');
2019-12-20 16:53:59 +08:00
}
@include b(text) {
2020-02-21 12:39:11 +08:00
@include once {
display: inline-block;
transition: color .3s $--n-ease-in-out-cubic-bezier;
@include m(strong) {
2020-02-27 23:02:58 +08:00
font-weight: $--n-strong-weight;
2020-02-21 12:39:11 +08:00
}
@include m(italic) {
font-style: italic;
}
@include m(underline) {
text-decoration: underline;
}
}
color: map-get($--typography-text-text-color, 'default');
2019-12-20 16:53:59 +08:00
@include m(code) {
2020-02-21 12:39:11 +08:00
@include once {
line-height: 1.4;
font-family: $--n-mono-font-family;
transition:
color .3s $--n-ease-in-out-cubic-bezier,
background-color .3s $--n-ease-in-out-cubic-bezier,
border-color .3s $--n-ease-in-out-cubic-bezier;
box-sizing: border-box;
padding: .15em .45em 0 .45em;
border-radius: 3px;
font-size: .9em;
}
color: map-get($--typography-code-text-color, 'default');
background-color: $--typography-code-background-color;
border: 1px solid $--typography-code-border-color;
2019-12-20 16:53:59 +08:00
}
@include m(default-type) {
@include m(primary-depth) {
2020-02-21 12:39:11 +08:00
color: map-get($--typography-text-text-color, 'primary-depth');
}
@include m(secondary-depth) {
2020-02-21 12:39:11 +08:00
color: map-get($--typography-text-text-color, 'secondary-depth');
}
@include m(tertiary-depth) {
2020-02-21 12:39:11 +08:00
color: map-get($--typography-text-text-color, 'tertiary-depth');
}
}
@include not-m(default-type) {
@include m(primary-depth) {
2020-02-21 12:39:11 +08:00
opacity: map-get($--typography-text-opacity, 'primary-depth');
}
@include m(secondary-depth) {
2020-02-21 12:39:11 +08:00
opacity: map-get($--typography-text-opacity, 'secondary-depth');
}
@include m(tertiary-depth) {
2020-02-21 12:39:11 +08:00
opacity: map-get($--typography-text-opacity, 'tertiary-depth');
}
}
2019-12-21 22:06:06 +08:00
@include m(primary-type) {
2020-02-21 12:39:11 +08:00
color: map-get($--typography-text-text-color, 'primary');
2019-12-21 22:06:06 +08:00
}
2019-12-20 18:49:54 +08:00
@include m(info-type) {
2020-02-21 12:39:11 +08:00
color: map-get($--typography-text-text-color, 'info');
2019-12-20 18:49:54 +08:00
}
@include m(success-type) {
2020-02-21 12:39:11 +08:00
color: map-get($--typography-text-text-color, 'success');
2019-12-20 18:49:54 +08:00
}
@include m(warning-type) {
2020-02-21 12:39:11 +08:00
color: map-get($--typography-text-text-color, 'warning');
2019-12-20 18:49:54 +08:00
}
@include m(error-type) {
2020-02-21 12:39:11 +08:00
color: map-get($--typography-text-text-color, 'error');
2019-12-20 18:49:54 +08:00
}
2019-12-20 16:53:59 +08:00
}
@include b(hr) {
2020-02-21 12:39:11 +08:00
@include once {
margin: 12px 0;
transition: border-color .3s $--n-ease-in-out-cubic-bezier;
border-left: none;
border-right: none;
border-bottom: none;
}
border-top: 1px solid map-get($--typography-hr-border-color, 'default');
2019-12-20 16:53:59 +08:00
}
@include b(blockquote) {
2020-02-21 12:39:11 +08:00
@include once {
line-height: 1.75;
margin: 0;
margin-top: 12px;
margin-bottom: 12px;
transition:
color .3s $--n-ease-in-out-cubic-bezier,
border-color .3s $--n-ease-in-out-cubic-bezier;
&:first-child {
margin-top: 0;
}
&:last-child {
margin-bottom: 0;
}
padding-left: 12px;
@include m(align-text) {
margin-left: -16px;
}
2019-12-21 21:31:48 +08:00
}
2020-02-21 12:39:11 +08:00
border-left: 4px solid map-get($--typography-blockquote-prefix-color, 'default');
color: map-get($--typography-blockquote-text-color, 'default');
2019-12-20 16:53:59 +08:00
}
}