Skip to content

Commit 766f61e

Browse files
authored
Utilize scss nesting in /styles/dartdoc (#4003)
1 parent 02cfbe1 commit 766f61e

File tree

7 files changed

+160
-157
lines changed

7 files changed

+160
-157
lines changed

lib/resources/styles.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/sig.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8863C34F7B0AA9147CD23809CF67E875
1+
6AD77EE4737CB53C3F7994D7BCC1E463

web/styles/dartdoc/_category.scss

+37-37
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,6 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5-
.category.linked {
6-
font-weight: bold;
7-
opacity: 1;
8-
}
9-
10-
/* Colors for category based on categoryOrder in dartdoc_options.config. */
11-
.category.cp-0 {
12-
background-color: #54b7c4
13-
}
14-
15-
.category.cp-1 {
16-
background-color: #54c47f
17-
}
18-
19-
.category.cp-2 {
20-
background-color: #c4c254
21-
}
22-
23-
.category.cp-3 {
24-
background-color: #c49f54
25-
}
26-
27-
.category.cp-4 {
28-
background-color: #c45465
29-
}
30-
31-
.category.cp-5 {
32-
background-color: #c454c4
33-
}
34-
35-
.category a {
36-
color: white;
37-
}
38-
395
.category {
406
padding: 2px 4px;
417
font-size: 12px;
@@ -44,8 +10,42 @@
4410
text-transform: uppercase;
4511
color: white;
4612
opacity: .5;
47-
}
4813

49-
h1 .category {
50-
vertical-align: middle;
14+
a {
15+
color: white;
16+
}
17+
18+
h1 & {
19+
vertical-align: middle;
20+
}
21+
22+
&.linked {
23+
font-weight: bold;
24+
opacity: 1;
25+
}
26+
27+
/* Colors for category based on categoryOrder in dartdoc_options.config. */
28+
&.cp-0 {
29+
background-color: #54b7c4
30+
}
31+
32+
&.cp-1 {
33+
background-color: #54c47f
34+
}
35+
36+
&.cp-2 {
37+
background-color: #c4c254
38+
}
39+
40+
&.cp-3 {
41+
background-color: #c49f54
42+
}
43+
44+
&.cp-4 {
45+
background-color: #c45465
46+
}
47+
48+
&.cp-5 {
49+
background-color: #c454c4
50+
}
5151
}

web/styles/dartdoc/_feature.scss

+5-5
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414
font-size: 12px;
1515
padding: 1px 6px;
1616
margin: 0 8px 0 0;
17+
18+
h1 & {
19+
vertical-align: middle;
20+
margin: 0 -2px 0 0;
21+
}
1722
}
1823

1924
a.feature:hover {
2025
border-color: #13B9FD;
2126
}
22-
23-
h1 .feature {
24-
vertical-align: middle;
25-
margin: 0 -2px 0 0;
26-
}

web/styles/dartdoc/_members.scss

+67-59
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,52 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5-
.markdown.desc {
6-
margin-bottom: 1em;
7-
max-width: 700px;
8-
}
9-
10-
.markdown h1 {
11-
font-size: 24px;
12-
margin-bottom: 8px;
13-
}
14-
15-
.markdown h2 {
16-
font-size: 20px;
17-
margin-top: 24px;
18-
margin-bottom: 8px;
19-
}
20-
21-
.markdown h3 {
22-
font-size: 18px;
23-
margin-bottom: 8px;
24-
color: var(--main-text-color);
25-
}
26-
27-
.markdown h4 {
28-
font-size: 16px;
29-
margin-bottom: 0;
30-
}
31-
32-
.markdown li p {
33-
margin: 0;
5+
.markdown {
6+
&.desc {
7+
margin-bottom: 1em;
8+
max-width: 700px;
9+
}
10+
11+
h1 {
12+
font-size: 24px;
13+
margin-bottom: 8px;
14+
}
15+
16+
h2 {
17+
font-size: 20px;
18+
margin-top: 24px;
19+
margin-bottom: 8px;
20+
}
21+
22+
h3 {
23+
font-size: 18px;
24+
margin-bottom: 8px;
25+
color: var(--main-text-color);
26+
}
27+
28+
h4 {
29+
font-size: 16px;
30+
margin-bottom: 0;
31+
}
32+
33+
li p {
34+
margin: 0;
35+
}
3436
}
3537

3638
/* Note that the generated HTML for pub packages may have `section` tags
3739
transformed into `div` tags, so we have two selectors here. */
38-
section#setter, div#setter {
39-
border-top: 1px solid #ddd;
40-
padding-top: 36px;
40+
section, div {
41+
&#setter {
42+
border-top: 1px solid #ddd;
43+
padding-top: 36px;
44+
}
45+
46+
/* indents wrapped lines */
47+
&.summary dt {
48+
margin-left: 24px;
49+
text-indent: -24px;
50+
}
4151
}
4252

4353
li.inherited a {
@@ -51,33 +61,31 @@ dt.constant + dd p {
5161
margin-bottom: 1em;
5262
}
5363

54-
/* indents wrapped lines */
55-
/* Note that the generated HTML for pub packages may have `section` tags
56-
transformed into `div` tags, so we have two selectors here. */
57-
section.summary dt, div.summary dt {
58-
margin-left: 24px;
59-
text-indent: -24px;
60-
}
61-
62-
.dl-horizontal dd {
63-
margin-left: initial;
64-
}
65-
66-
dl.dl-horizontal dt {
67-
font-style: normal;
68-
text-align: left;
69-
color: #727272;
70-
margin-right: 20px;
71-
width: initial;
72-
}
73-
74-
dt .name {
75-
font-weight: 500;
76-
}
77-
78-
dl dt.callable .name {
79-
float: none;
80-
width: auto;
64+
dl {
65+
&.dl-horizontal {
66+
dd {
67+
margin-left: initial;
68+
}
69+
70+
dt {
71+
font-style: normal;
72+
text-align: left;
73+
color: #727272;
74+
margin-right: 20px;
75+
width: initial;
76+
}
77+
}
78+
79+
dt {
80+
&.callable .name {
81+
float: none;
82+
width: auto;
83+
}
84+
85+
.name {
86+
font-weight: 500;
87+
}
88+
}
8189
}
8290

8391
/* Do not display "provided by X extension" text on extension pages. */

web/styles/dartdoc/_misc.scss

+1-3
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,8 @@
1212
padding: 18px 4px;
1313
font-size: 18px;
1414
vertical-align: middle;
15-
}
1615

17-
@media (max-width: 840px) {
18-
.source-link {
16+
@media (max-width: 840px) {
1917
padding: 7px 2px;
2018
font-size: 10px;
2119
}

0 commit comments

Comments
 (0)