Skip to content

Commit 8c18a71

Browse files
authored
Merge pull request #12891 from zbartyzel/scaladoc/docs-styles
Improve docs styles
2 parents 8924449 + 2f62646 commit 8c18a71

File tree

8 files changed

+278
-196
lines changed

8 files changed

+278
-196
lines changed

docs/logo.svg

Lines changed: 15 additions & 29 deletions
Loading

scaladoc-js/resources/scaladoc-searchbar.css

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
/* button */
22
.search span {
3-
background: #ED3522;
4-
fill: #fff;
3+
background: var(--red500);
4+
fill: var(--white);
55
cursor: pointer;
66
border: none;
77
padding: 9px;
88
border-radius: 24px;
9-
box-shadow: 0 0 16px #F27264;
9+
box-shadow: 0 0 16px var(--code-bg);
1010
}
1111
.search span:hover {
12-
fill: #F27264;
12+
background: var(--red600);
1313
}
1414

1515
@media(max-width: 576px) {
@@ -29,7 +29,7 @@
2929
}
3030

3131
#scaladoc-search {
32-
margin-top: 10px;
32+
margin-top: 16px;
3333
cursor: pointer;
3434
position: fixed;
3535
top: 0;
@@ -65,15 +65,15 @@
6565
}
6666

6767
#scaladoc-searchbar-results {
68-
background: white;
68+
background: var(--white);
6969
display: flex;
7070
flex-direction: column;
7171
max-height: 500px;
7272
overflow: auto;
7373
}
7474

7575
.scaladoc-searchbar-result {
76-
background: white;
76+
background: var(--white);
7777
line-height: 24px;
7878
display: flex;
7979
padding: 4px 10px 4px 10px;
@@ -90,11 +90,11 @@
9090
}
9191

9292
.scaladoc-searchbar-result[selected] {
93-
background-color: #d4edff;
93+
background-color: var(--blue100);
9494
}
9595

9696
.scaladoc-searchbar-result a {
97-
color: #1f2326;
97+
color: var(--grey900);
9898
/* for some reason, with display:block if there's a wrap between the
9999
* search result text and the location span, the dead space to the
100100
* left of the location span doesn't get treated as part of the block,
@@ -134,7 +134,7 @@
134134
background-size: 50% 2px, 2px 50%;
135135
background-repeat: no-repeat;
136136
border-radius: 12px;
137-
box-shadow: 0 0 2px black;
137+
box-shadow: 0 0 2px var(--black);
138138
}
139139

140140
.snippet-comment-button:hover {
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
:root {
2+
/* White */
3+
--white: hsl(193, 24%, 99%);
4+
5+
/* Black */
6+
--black: hsl(200, 72%, 6%);
7+
8+
/* Grey */
9+
--grey100: hsl(193, 24%, 97%);
10+
--grey200: hsl(193, 20%, 95%);
11+
--grey300: hsl(193, 16%, 86%);
12+
--grey400: hsl(193, 16%, 74%);
13+
--grey500: hsl(193, 16%, 66%);
14+
--grey600: hsl(193, 14%, 52%);
15+
--grey700: hsl(193, 14%, 42%);
16+
--grey800: hsl(193, 12%, 28%);
17+
--grey900: hsl(193, 12%, 16%);
18+
19+
/* Blue */
20+
--blue100: hsl(200, 64%, 92%);
21+
--blue200: hsl(200, 66%, 82%);
22+
--blue300: hsl(200, 68%, 70%);
23+
--blue400: hsl(200, 62%, 58%);
24+
--blue500: hsl(200, 72%, 42%);
25+
--blue600: hsl(200, 71%, 24%);
26+
--blue700: hsl(200, 72%, 18%);
27+
--blue800: hsl(200, 72%, 12%);
28+
--blue900: hsl(200, 72%, 8%);
29+
30+
/* Red */
31+
--red500: hsl(1 , 60% , 92%);
32+
--red500: hsl(1 , 64% , 84%);
33+
--red500: hsl(1 , 66% , 72%);
34+
--red500: hsl(1 , 66% , 64%);
35+
--red500: hsl(1 , 71% , 52%);
36+
--red600: hsl(1 , 71% , 40%);
37+
--red700: hsl(1 , 72% , 32%);
38+
--red800: hsl(1 , 72% , 24%);
39+
--red900: hsl(1 , 75% , 12%);
40+
41+
42+
/* Light Mode */
43+
--border-light: var(--grey200);
44+
--border-medium: var(--grey300);
45+
46+
--body-bg: var(--white);
47+
--body-fg: var(--grey900);
48+
--title-fg: var(--grey800);
49+
50+
--active-bg: var(--blue300);
51+
--active-bg-shadow: var(--blue400);
52+
--active-fg: var(--grey900);
53+
54+
--inactive-bg: var(--grey400);
55+
--inactive-bg-shadow: var(--grey700);
56+
--inactive-fg: var(--grey700);
57+
58+
--code-bg: var(--grey200);
59+
--code-fg: var(--grey800);
60+
--symbol-fg: var(--grey900);
61+
--documentable-bg: var(--grey200);
62+
63+
--link-fg: var(--blue500);
64+
--link-hover-fg: var(--blue600);
65+
--link-sig-fg: var(--blue500);
66+
67+
--leftbar-bg: var(--grey100);
68+
--leftbar-fg: var(--grey900);
69+
--leftbar-current-bg: var(--blue100);
70+
--leftbar-current-fg: var(--blue500);
71+
--leftbar-hover-bg: var(--blue100);
72+
--leftbar-hover-fg: var(--grey900);
73+
74+
--footer-bg: var(--white);
75+
--footer-fg: var(--grey700);
76+
77+
--icon-color: var(--grey400);
78+
--selected-fg: var(--blue900);
79+
--selected-bg: var(--blue200);
80+
}
81+
82+
/* Dark Mode */
83+
:root.theme-dark {
84+
--border-light: var(--blue800);
85+
--border-medium: var(--blue700);
86+
87+
--body-bg: var(--blue900);
88+
--body-fg: var(--grey300);
89+
--title-fg: var(--blue200);
90+
91+
--active-bg: var(--blue500);
92+
--active-bg-shadow: var(--blue400);
93+
--active-fg: var(--grey300);
94+
95+
--inactive-bg: var(--grey800);
96+
--inactive-bg-shadow: var(--grey600);
97+
--inactive-fg: var(--grey600);
98+
99+
--code-bg: var(--blue800);
100+
--code-fg: var(--grey400);
101+
--symbol-fg: var(--grey300);
102+
--documentable-bg: var(--blue800);
103+
104+
--link-fg: var(--blue400);
105+
--link-hover-fg: var(--blue300);
106+
--link-sig-fg: var(--blue400);
107+
108+
--leftbar-bg: var(--black);
109+
--leftbar-fg: var(--grey300);
110+
--leftbar-current-bg: var(--blue700);
111+
--leftbar-current-fg: var(--white);
112+
--leftbar-hover-bg: var(--blue800);
113+
--leftbar-hover-fg: var(--grey300);
114+
115+
--footer-bg: var(--blue900);
116+
--footer-fg: var(--grey400);
117+
118+
--icon-color: var(--grey600);
119+
--selected-fg: var(--blue800);
120+
--selected-bg: var(--blue200);
121+
122+
--tab-selected: var(--white);
123+
--tab-default: var(--grey300);
124+
}

scaladoc/resources/dotty_res/styles/diagram.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@
1919
height: 400px;
2020
}
2121

22+
.diagram-class {
23+
background-color: var(--code-bg);
24+
margin-bottom: 16px;
25+
}
26+
2227
.diagram-class a {
2328
text-decoration: underline;
2429
color: #FFF;

scaladoc/resources/dotty_res/styles/filter-bar.css

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.documentableFilter {
2-
padding: 24px 12px;
2+
padding: 24px 24px 24px 12px;
33
background-color: var(--code-bg);
44
}
55

@@ -26,22 +26,28 @@
2626
}
2727

2828
.filterToggleButton svg {
29-
fill: var(--body-fg);
29+
fill: var(--icon-color);
3030
transition: fill 0.1s ease-in, transform 0.1s ease-in-out;
3131
}
3232

3333
.filterToggleButton:hover svg,
3434
.filterToggleButton:focus svg {
35-
fill: var(--active-fg);
35+
fill: var(--icon-color);
3636
}
3737

3838
.filterableInput {
39-
padding: 6px 4px;
4039
flex: 1;
4140
outline: 0;
42-
border: 0;
41+
border: 1px solid var(--border-medium);
4342
border-radius: 3px;
4443
background-color: var(--body-bg);
44+
font-family: "Lato", sans-serif;
45+
padding: 8px;
46+
margin-left: 8px;
47+
}
48+
49+
.filterableInput:focus {
50+
border: 1px solid var(--active-bg-shadow);
4551
}
4652

4753
.filterLowerContainer {

0 commit comments

Comments
 (0)