Skip to content

Commit 3d879b7

Browse files
Redesign dottydoc theme
Lighter and closer to the old one instead of the front page. See issue #7595
1 parent efa10ce commit 3d879b7

File tree

4 files changed

+103
-38
lines changed

4 files changed

+103
-38
lines changed

doc-tool/bootstrap-theme/theme.scss

Lines changed: 65 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,67 @@
44
@import "node_modules/bootstrap/scss/mixins";
55

66
// Web fonts
7-
@import url('https://fonts.googleapis.com/css?family=Roboto+Slab:300|Source+Code+Pro:400,600|Source+Sans+Pro:400,600|Lobster&display=fallback');
7+
@import url('https://fonts.googleapis.com/css?family=Lato:400,700|Roboto+Slab:300|Fira+Code:400,700&display=fallback');
8+
9+
// Custom colors
10+
$pro-grey: #414551;
11+
$soft-red: #ca445e;
12+
$primary: $pro-grey;
13+
$light: #fafafa;
14+
$code-color: $soft-red; // overrides bootstrap
815

9-
// Custom values that override the default variables of Bootstrap
1016
$theme-colors: (
11-
"primary": #002b36, // primary toolbar+sidebar dark color
12-
"secondary": #ca445e, // secondary color used on light backgrounds
13-
"secondary-lite": #ca44c822, // less opaque version of secondary
14-
"accent": #ca445e, // secondary-like for dark backgrounds
15-
"contrast": #f26527, // used on dark backgrounds
17+
"primary": $primary,
18+
"secondary": $soft-red
19+
);
20+
21+
$colors: (
22+
"light": $light,
23+
24+
"toolbar": $pro-grey,
25+
"toolbar-entry": $light,
26+
"toolbar-active": lighten($pro-grey, 25),
27+
28+
"sidebar": $light,
29+
"sidebar-category": #000,
30+
"sidebar-page": $pro-grey,
31+
"sidebar-active": $soft-red,
32+
33+
"pre-bg": $light, // <pre> blocks of code background
34+
"doc-bg": rgba($soft-red, 0.135) //#ca44c822
1635
);
36+
37+
// Responsive control
1738
$container-max-widths: (
1839
md: 720px,
1940
lg: 960px,
2041
xl: 960px
2142
);
2243

23-
$code-color: theme-color("secondary");
24-
$font-family-monospace: "Source Code Pro", "Andale Mono", "Courier New", monospace;
25-
$font-family-sans-serif: "Source Sans Pro", "Tahoma", "Geneva", sans-serif;
44+
// Body Fonts
45+
$font-family-monospace: "Fira Code", "Andale Mono", monospace;
46+
$font-family-sans-serif: "Lato", sans-serif;
2647
$font-family-serif: "Roboto Slab", "Georgia", serif;
2748
$font-family-base: $font-family-serif;
2849
$headings-font-family: $font-family-sans-serif;
2950

51+
$font-weight-light: 300;
52+
$font-weight-normal: 400;
53+
$font-weight-bold: 700;
54+
$headings-font-weight: 700;
55+
56+
// Nav Fonts
57+
$toolbar-main-font: $headings-font-family;
58+
$toolbar-main-weight: $font-weight-normal;
59+
$toolbar-details-font: $headings-font-family;
60+
$toolbar-details-weight: $font-weight-normal;
61+
62+
$sidebar-font: $headings-font-family;
63+
$sidebar-category-weight: $font-weight-normal;
64+
$sidebar-category-size: 18px;
65+
$sidebar-page-weight: $font-weight-normal;
66+
$sidebar-page-size: 1rem;
67+
3068
// Features imports - follow the order of bootstrap.scss (bootstrap's module)
3169
@import "node_modules/bootstrap/scss/root";
3270
@import "node_modules/bootstrap/scss/reboot";
@@ -43,3 +81,20 @@ $headings-font-family: $font-family-sans-serif;
4381
@import "node_modules/bootstrap/scss/badge";
4482
@import "node_modules/bootstrap/scss/spinners";
4583
@import "node_modules/bootstrap/scss/utilities";
84+
85+
// Additional CSS variables
86+
:root {
87+
--font-family-toolbar-main: #{inspect($toolbar-main-font)};
88+
--font-weight-toolbar-main: #{$toolbar-main-weight};
89+
90+
--font-family-toolbar-details: #{inspect($toolbar-details-font)};
91+
--font-weight-toolbar-details: #{$toolbar-details-weight};
92+
93+
--font-family-sidebar: #{inspect($sidebar-font)};
94+
95+
--font-size-sidebar-category: #{$sidebar-category-size};
96+
--font-weight-sidebar-category: #{$sidebar-category-weight};
97+
98+
--font-size-sidebar-page: #{$sidebar-page-size};
99+
--font-weight-sidebar-page: #{$sidebar-page-weight};
100+
}

doc-tool/resources/css/dottydoc.css

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ footer img#author-img {
154154
width: 100%;
155155
}
156156
.api .member:hover {
157-
background: var(--secondary-lite);
157+
background: var(--doc-bg);
158158
cursor: pointer;
159159
}
160160
.api .left-column {
@@ -175,10 +175,13 @@ footer img#author-img {
175175
}
176176

177177
/* code */
178+
pre, code {
179+
font-variant-ligatures: none;
180+
}
178181
pre {
179182
padding: 0;
180183
font-size: 13px;
181-
background: rgba(244, 243, 244, 0.6);
184+
background: var(--pre-bg);
182185
border-radius: 2px;
183186
border: 1px solid rgba(0, 0, 0, 0.1);
184187
}
@@ -222,10 +225,10 @@ aside.success {
222225
background-color: grey;
223226
}
224227
.gitter-open-chat-button:focus, .gitter-open-chat-button:hover {
225-
background-color: var(--secondary);
228+
background-color: var(--primary);
226229
}
227230
.gitter-open-chat-button:focus {
228-
box-shadow: 0 0 8px var(--secondary);
231+
box-shadow: 0 0 8px var(--primary);
229232
}
230233
.gitter-chat-embed {
231234
top: 40px; /* 50px (navbar) - 10px (aside's margin) */
@@ -253,4 +256,7 @@ aside.success {
253256
display: flex;
254257
flex-flow: wrap;
255258
}
259+
main.container {
260+
padding: 15px 45px;
261+
}
256262
}

doc-tool/resources/css/sidebar.css

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,12 @@
55
z-index: 1000;
66
width: 100%;
77
height: 100%;
8-
/* Safari and some others don't support overflow: x y */
9-
overflow-x: hidden;
8+
overflow-x: hidden; /* Safari and some others don't support overflow: x y */
109
overflow-y: auto;
1110
-webkit-overflow-scrolling: touch; /* nicer scrolling on touch screens */
12-
font-family: var(--font-family-sans-serif);
13-
font-weight: 400;
14-
background: var(--primary);
15-
border-top: 1px solid black;
16-
/* hidden by default, shown by toggle (on small screens) */
17-
visibility: hidden;
11+
font-family: var(--font-family-sidebar);
12+
background: var(--sidebar);
13+
visibility: hidden; /* hidden by default, shown by toggle (on small screens) */
1814
opacity: 0;
1915
transition: visibility .25s ease-out, opacity .25s ease-out;
2016
}
@@ -53,15 +49,21 @@
5349
}
5450

5551
.sidebar .toc > li {
56-
border-left: 2px solid var(--accent);
52+
border-left: 2px solid var(--sidebar-active);
5753
padding-left: 1em;
5854
}
5955

56+
.sidebar li a {
57+
font-size: var(--font-size-sidebar-page);
58+
font-weight: var(--font-weight-sidebar-page);
59+
}
60+
6061
.sidebar > ul > li.leaf > a, .sidebar li.section > a {
61-
color: white;
62-
font-size: 18px;
63-
text-transform: uppercase;
62+
font-size: var(--font-size-sidebar-category);
63+
font-weight: var(--font-weight-sidebar-category);
64+
text-transform: capitalize;
6465
cursor: pointer;
66+
color: var(--sidebar-category);
6567
}
6668

6769
.sidebar .entity-package > .entity-name {
@@ -70,11 +72,11 @@
7072

7173
.sidebar a {
7274
width: 100%;
73-
color: var(--contrast);
75+
color: var(--sidebar-page);
7476
transition: color .2s ease-out;
7577
}
7678
.sidebar a:hover {
77-
color: var(--accent) !important;
79+
color: var(--sidebar-active) !important;
7880
}
7981

8082
/* API Documentation */
@@ -122,17 +124,17 @@
122124

123125
@media (min-width: 768px) {
124126
.sidebar { /* visible by default, hidden by toggle */
125-
width: 320px;
127+
width: 275px;
126128
visibility: visible;
127129
opacity: 1;
128130
margin-left: 0;
129131
transition: margin .25s ease-out;
130132
}
131133
.sidebar.toggled {
132-
margin-left: -320px;
134+
margin-left: -275px;
133135
}
134136
#content-wrapper {
135-
margin-left: 320px !important;
137+
margin-left: 275px !important;
136138
transition: margin .25s ease-out;
137139
}
138140
.sidebar.toggled ~ #content-wrapper {

doc-tool/resources/css/toolbar.css

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,17 @@ nav.navbar {
66
height: 50px;
77
line-height: 1;
88
font-size: 24px;
9-
font-family: var(--font-family-sans-serif);
10-
background: var(--primary);
9+
font-family: var(--font-family-toolbar-details);
10+
background-color: var(--toolbar);
11+
box-shadow: 0 0 6px;
1112
}
1213
nav.navbar-dark * {
13-
color: white;
14+
color: var(--toolbar-entry);
1415
transition: color .2s ease-out;
1516
}
1617

1718
nav.navbar-dark a:hover *, nav.navbar-dark a:focus * {
18-
color: var(--accent);
19+
color: var(--toolbar-active);
1920
}
2021
nav.navbar a:hover {
2122
text-decoration: none;
@@ -43,13 +44,14 @@ nav.navbar a {
4344
line-height: inherit;
4445
}
4546
.navbar-brand .project-details h1 {
46-
font-size: 1.1em;
47-
font-family: "Lobster", cursive;
47+
font-size: 1em;
48+
font-family: var(--font-family-toolbar-main);
49+
font-weight: var(--font-weight-toolbar-main);
4850
}
4951
.navbar-brand .project-details h2 {
5052
font-size: 0.5em;
51-
color: grey;
5253
margin-top: 2px;
54+
font-weight: var(--font-weight-toolbar-details);
5355
}
5456

5557
#search-api-input {

0 commit comments

Comments
 (0)