Skip to content

Commit 77f0e2d

Browse files
author
elonz
committed
update: optimize base.scss
Change-Id: I53b633a4610f4817c8cbb1ad34e5271150333cc5
1 parent cd50aeb commit 77f0e2d

File tree

3 files changed

+26
-56
lines changed

3 files changed

+26
-56
lines changed

src/themes/core/base.scss

Lines changed: 26 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,15 @@ body {
3131
margin-top: 0 !important;
3232
}
3333

34-
/* block */
34+
/* spacing */
3535

36-
// TODO: 这几个还没有拆分 top、bottom
37-
// blockquote, pre, table,
38-
p,
39-
details,
40-
dl,
41-
ol,
42-
ul {
36+
p, details, dl, ol, ul, pre, xmp, plaintext, listing, blockquote, table, figure, hr {
4337
margin-top: $block-mg-t;
4438
margin-bottom: $block-mg-b;
4539
}
4640

41+
/* block */
42+
4743
h1 {
4844
font-size: $h1-font-size;
4945
font-weight: $h1-font-weight;
@@ -99,33 +95,15 @@ h6 {
9995
}
10096

10197
p {
102-
margin-top: $p-mg-t;
103-
margin-bottom: $p-mg-b;
10498
margin-left: 0;
10599
margin-right: 0;
106100
}
107101

108-
li {
109-
word-wrap: break-all;
110-
}
111-
112-
li+li {
113-
margin-top: $li-mg-t;
114-
}
115-
116-
ul ul, ol ul, ul ol, ol ol {
117-
margin-top: 0;
118-
margin-bottom: 0;
119-
}
120-
121102
pre, xmp, plaintext, listing {
122103
font-family: $code-font-family;
123-
margin: $pre-mg-v $pre-mg-h;
124104
}
125105

126106
blockquote {
127-
margin: $blockquote-mg-v $blockquote-mg-h;
128-
129107
>:first-child {
130108
margin-top: 0;
131109
}
@@ -135,23 +113,37 @@ blockquote {
135113
}
136114
}
137115

138-
figure {
139-
margin: $figure-mg-v $figure-mg-h;
140-
}
141-
142116
hr {
143-
margin: $hr-mg-v $hr-mg-h;
144117
border-style: $hr-bd-style;
145118
border-width: $hr-bd-width;
146119
}
147120

148-
/* inline */
149-
150121
img {
151122
max-width: 100%;
152123
height: auto
153124
}
154125

126+
/* list */
127+
128+
li {
129+
word-wrap: break-all;
130+
}
131+
132+
li+li {
133+
margin-top: $li-mg-t;
134+
}
135+
136+
ul ul, ol ul, ul ol, ol ol {
137+
margin-top: 0;
138+
margin-bottom: 0;
139+
}
140+
141+
.task-list-item {
142+
list-style-type: none;
143+
}
144+
145+
/* inline */
146+
155147
a {
156148
color: $link-color;
157149
text-decoration: $link-decoration;
@@ -182,9 +174,9 @@ del, s {
182174
}
183175

184176
/* table */
177+
185178
table {
186179
color: $table-font-color;
187-
margin: $table-mg-v $table-mg-h;
188180
border-collapse: collapse;
189181
background-color: $table-bg-color;
190182
border-spacing: $table-border-spacing;
@@ -209,10 +201,4 @@ td {
209201
font-weight: $td-font-weight;
210202
}
211203

212-
/* task list */
213-
214-
.task-list-item {
215-
list-style-type: none;
216-
}
217-
218204
}

src/themes/variables/bear_override.scss

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11

2-
// spacing
3-
$pre-mg-v: $block-mg-v;
4-
$blockquote-mg-v: $block-mg-v;
5-
62
// color
73
$table-font-color: $code-font-color;
84
$table-bg-color: $code-bg-color;

src/themes/variables/default.scss

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ $md-body-mg-v: 0px;
5252
$md-body-pd-h: 3.2rem;
5353
$md-body-pd-v: 1.6rem;
5454

55-
$p-mg-t: 1em;
56-
$p-mg-b: 1em;
5755
$h1-mg-v: 0.67em;
5856
$h1-mg-t: $h1-mg-v;
5957
$h1-mg-b: $h1-mg-v;
@@ -74,16 +72,6 @@ $h6-mg-t: $h6-mg-v;
7472
$h6-mg-b: $h6-mg-v;
7573
$block-mg-t: 1em;
7674
$block-mg-b: 1em;
77-
$blockquote-mg-v: 1em;
78-
$blockquote-mg-h: 40px;
79-
$figure-mg-v: 1em;
80-
$figure-mg-h: 40px;
81-
$hr-mg-v: 0.5em;
82-
$hr-mg-h: auto;
83-
$pre-mg-v: 1em;
84-
$pre-mg-h: 0;
85-
$table-mg-v: 1em;
86-
$table-mg-h: 0;
8775
$th-pd-v: 1px;
8876
$th-pd-h: 1px;
8977
$td-pd-v: 1px;

0 commit comments

Comments
 (0)