heti/lib/_base.scss

117 lines
2.6 KiB
SCSS
Raw Normal View History

2020-02-20 21:37:10 +08:00
// Author: Sivan [sun.sivan@gmail.com]
// Description: base reset and entry styles.
2020-02-11 20:47:29 +08:00
@import "variables";
@mixin hetiBase {
// 清容器浮动
@include clear-float();
// 非中文时不加间距
letter-spacing: $letter-spacing-medium;
@include non-cjk-block {
letter-spacing: $letter-spacing-normal;
}
2020-02-11 20:47:29 +08:00
// 清容器内首尾元素外边距
&,
section,
td {
> *:first-child {
margin-block-start: 0 !important;
}
> *:last-child {
margin-block-end: 0 !important;
}
}
// 定义块级元素样式
blockquote {
margin-block-start: $std-block-unit * 0.5;
2020-02-11 20:47:29 +08:00
margin-block-end: $std-block-unit;
margin-inline-start: $std-inline-unit * 2;
margin-inline-end: $std-inline-unit * 2;
padding-block-start: $std-block-unit * 0.5;
padding-block-end: $std-block-unit * 0.5;
2020-02-11 20:47:29 +08:00
padding-inline-start: $std-inline-unit;
padding-inline-end: $std-inline-unit;
//border-radius: 4px;
2020-05-04 23:29:03 +08:00
background-color: hsla(0, 0%, 0%, 0.054);
2020-05-18 00:49:59 +08:00
@include darkmode-style {
2020-05-04 23:29:03 +08:00
background-color: hsla(0, 0%, 100%, 0.054);
}
2020-02-11 20:47:29 +08:00
}
figure {
display: block;
text-align: center;
> img {
display: block;
margin-inline-start: auto;
margin-inline-end: auto;
}
}
hr {
width: 30%;
height: 1px;
margin-block-start: $std-block-unit * 2;
margin-block-end: $std-block-unit * 2 - 1px;
margin-inline-start: auto;
margin-inline-end: auto;
border: 0;
2020-05-04 23:29:03 +08:00
background-color: hsl(0, 0%, 80%);
2020-05-18 00:49:59 +08:00
@include darkmode-style {
2020-05-04 23:29:03 +08:00
background-color: hsl(0, 0%, 25%);
}
2020-02-11 20:47:29 +08:00
}
p {
margin-block-start: $std-block-unit * 0.5;
2020-02-11 20:47:29 +08:00
margin-block-end: $std-block-unit;
text-align: justify;
@include non-cjk-block {
2020-02-11 21:01:13 +08:00
text-align: start;
2020-02-11 20:47:29 +08:00
}
}
$format_pre_code: true !default;
2020-05-04 23:29:03 +08:00
@if $format_pre_code {
pre {
margin-block-start: $std-block-unit * 0.5;
margin-block-end: $std-block-unit * 0.5;
margin-inline-start: 0;
margin-inline-end: 0;
padding-block-start: $std-block-unit * 0.5;
padding-block-end: $std-block-unit * 0.5;
padding-inline-start: $std-inline-unit;
padding-inline-end: $std-inline-unit;
overflow: auto;
font-family: $font-family-mono;
white-space: pre;
word-wrap: normal;
border-radius: 4px;
background-color: hsla(0, 0%, 0%, 0.054);
@include darkmode-style {
background-color: hsla(0, 0%, 100%, 0.054);
}
2020-02-14 17:49:40 +08:00
code {
margin: 0;
padding: 0;
border: 0;
border-radius: 0;
background-color: transparent;
color: inherit;
}
2020-02-14 17:49:40 +08:00
}
2020-02-11 20:47:29 +08:00
}
}