Skip to content

Commit 766f61e

Browse files
authoredFeb 19, 2025··
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
}

‎web/styles/dartdoc/_signature.scss

+48-51
Original file line numberDiff line numberDiff line change
@@ -6,39 +6,34 @@
66
white-space: nowrap;
77
}
88

9-
.multi-line-signature .type-parameter .parameter {
10-
margin-left: 0;
11-
display: unset;
12-
}
13-
149
.parameter-list {
1510
display: table-cell;
1611
margin-left: 10px;
1712
list-style-type: none;
1813
padding-inline-start: unset;
19-
}
2014

21-
.parameter-list.single-line {
22-
display: inline;
23-
margin-left: 0;
24-
}
15+
&.single-line {
16+
display: inline;
17+
margin-left: 0;
2518

26-
.parameter-list.single-line > li {
27-
display: inline;
28-
}
19+
> li {
20+
display: inline;
2921

30-
.parameter-list.single-line > li > .parameter {
31-
display: inline;
32-
margin-left: 0;
33-
text-indent: 0;
22+
> .parameter {
23+
display: inline;
24+
margin-left: 0;
25+
text-indent: 0;
26+
}
27+
}
28+
}
3429
}
3530

3631
.signature {
3732
color: var(--main-text-color);
38-
}
3933

40-
.signature a {
41-
color: var(--main-hyperlinks-color);
34+
a {
35+
color: var(--main-hyperlinks-color);
36+
}
4237
}
4338

4439
.deprecated {
@@ -48,12 +43,17 @@
4843
.multi-line-signature {
4944
font-size: 17px;
5045
color: #727272;
51-
}
5246

53-
.multi-line-signature .parameter {
54-
margin-left: 60px;
55-
display: block;
56-
text-indent: -36px;
47+
.type-parameter .parameter {
48+
margin-left: 0;
49+
display: unset;
50+
}
51+
52+
.parameter {
53+
margin-left: 60px;
54+
display: block;
55+
text-indent: -36px;
56+
}
5757
}
5858

5959
.annotation-list {
@@ -66,18 +66,14 @@
6666
list-style: none;
6767
padding: 0;
6868
display: inline;
69-
}
7069

71-
.comma-separated li {
72-
display: inline;
73-
}
74-
75-
.comma-separated li:after {
76-
content: ", ";
77-
}
70+
li {
71+
display: inline;
7872

79-
.comma-separated li:last-child:after {
80-
content: "";
73+
&:not(:last-child):after {
74+
content: ", ";
75+
}
76+
}
8177
}
8278

8379
.container > section:first-child {
@@ -90,20 +86,21 @@
9086

9187
/* Note that the generated HTML for pub packages may have `section` tags
9288
transformed into `div` tags, so we have two selectors here. */
93-
section.multi-line-signature div.parameters,
94-
div.multi-line-signature div.parameters {
95-
margin-left: 24px;
96-
}
97-
98-
#instance-methods dt.inherited .name,
99-
#instance-properties dt.inherited .name,
100-
#operators dt.inherited .name {
101-
font-weight: 400;
102-
font-style: italic;
103-
}
104-
105-
#instance-methods dt.inherited .signature,
106-
#instance-properties dt.inherited .signature,
107-
#operators dt.inherited .signature {
108-
font-weight: 400;
89+
section, div {
90+
.multi-line-signature div.parameters {
91+
margin-left: 24px;
92+
}
93+
}
94+
95+
#instance-methods, #instance-properties, #operators {
96+
dt.inherited {
97+
.name {
98+
font-weight: 400;
99+
font-style: italic;
100+
}
101+
102+
.signature {
103+
font-weight: 400;
104+
}
105+
}
109106
}

0 commit comments

Comments
 (0)
Please sign in to comment.