Skip to content

Commit fe70297

Browse files
Rework the toolbar
1 parent 66fbd68 commit fe70297

File tree

2 files changed

+62
-66
lines changed

2 files changed

+62
-66
lines changed
Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,25 @@
1-
<div id="toolbar">
2-
<a id="home-button" href="{{ site.baseurl }}/index.html">
3-
{% include "scala-logo.svg" %}
4-
</a>
5-
<div id="project-details">
6-
<h1 id="project-name"><a href="{{ site.baseurl }}/docs/">{{ site.project }} Documentation</a></h1>
7-
<h2 id="project-version">{{ site.version }}</h2>
1+
<nav class="navbar navbar-expand navbar-dark fixed-top bg-primary">
2+
<i class="fas fa-bars"></i>
3+
<i class="fas fa-search" id="search-icon"></i>
4+
<!--<form class="form-inline" action="{{ site.baseurl }}/api/search.html" method="get">
5+
<input type="text" class="form-control" placeholder="Search" aria-label="Search">
6+
</form>-->
7+
<div class="navbar-brand">
8+
{% if site.logo %}
9+
<a href="{{ site.baseurl }}/index.html">
10+
<img class="project-logo" src="{{ site.baseurl }}/images/{{ site.logo }}">
11+
</a>
12+
{% endif %}
13+
<a href="{{ site.baseurl }}/docs/index.html">
14+
<div class="project-details">
15+
<h1>{{ site.project }} Documentation</h1>
16+
<h2>{{ site.version }}</h2>
17+
</div>
18+
</a>
819
</div>
920

1021
{% if site.projectUrl %}
11-
<a title="Project repository" id="github-link" href="{{ site.projectUrl }}">
22+
<a id="github-link" title="Project repository" href="{{ site.projectUrl }}">
1223
{% if site.projectUrl contains "github" %}
1324
<i class="fab fa-github" aria-hidden="true"></i>
1425
{% elsif site.projectUrl contains "gitlab" %}
@@ -18,5 +29,4 @@ <h2 id="project-version">{{ site.version }}</h2>
1829
{% endif %}
1930
</a>
2031
{% endif %}
21-
</div>
22-
<div id="toolbar-spacing"></div>
32+
</nav>

doc-tool/resources/css/toolbar.css

Lines changed: 42 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,64 @@
11
@import url(https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,300,400,600,700);
22

3-
div#toolbar {
4-
height: 75px;
5-
width: 100%;
6-
background-color: #414551;
7-
position: fixed;
8-
top: 0; left: 0;
9-
z-index: 2;
3+
body {
4+
margin-top: 50px;
105
}
116

12-
div#toolbar-spacing {
13-
width: 100%;
14-
height: 75px;
7+
nav.navbar {
8+
height: 50px;
9+
line-height: 1;
10+
font-size: 24px;
1511
}
16-
17-
div#toolbar > a#home-button svg g#logo-foreground {
18-
fill: rgba(202, 68, 94, 1);
12+
nav.navbar-dark * {
13+
color: white;
1914
}
2015

21-
div#toolbar > a#home-button svg g#logo-background {
22-
fill: rgba(202, 68, 94, 0.45);
16+
nav.navbar-dark a:hover *, nav.navbar-dark a:focus * {
17+
color: var(--contrast);
2318
}
24-
25-
div#toolbar > a#home-button {
26-
margin: 9px 0 0 38px;
27-
user-select: none;
28-
float: left;
19+
nav.navbar a:hover {
20+
text-decoration: none;
2921
}
3022

31-
div#toolbar > div#project-details {
32-
float: left;
33-
color: #fff;
34-
font-family: "Source Sans Pro", sans-serif;
35-
margin: 18px 0 0 40px;
36-
padding-left: 10px;
23+
.navbar-brand {
24+
margin-right: auto;
25+
margin-left: auto;
26+
font-size: inherit;
27+
display: flex;
28+
align-items: center;
29+
font-family: "Source Sans Pro", sans-serif;
3730
}
3831

39-
div#toolbar > div#project-details:before {
40-
display: block;
41-
content: '';
42-
position: absolute;
43-
top: 22px;
44-
left: 95px;
45-
width: 1px;
46-
bottom: 20px;
47-
background-color: #767e94;
32+
.navbar-brand .project-logo {
33+
display: none;
34+
height: 40px;
35+
margin-right: 7px;
4836
}
4937

50-
div#toolbar > div#project-details > h1#project-name {
51-
font-size: 20px;
52-
font-weight: 300;
53-
margin-bottom: 3px;
38+
.navbar-brand .project-details * {
39+
margin: 0;
40+
line-height: inherit;
5441
}
55-
56-
div#toolbar > div#project-details > h1#project-name > a {
57-
color: #fff;
42+
.navbar-brand .project-details h1 {
43+
font-size: 1.1em;
44+
}
45+
.navbar-brand .project-details h2 {
46+
font-size: 0.5em;
47+
color: grey;
5848
}
5949

60-
div#toolbar > div#project-details > h1#project-name > a:hover,
61-
div#toolbar > div#project-details > h1#project-name > a:focus {
62-
text-decoration: none;
63-
color: rgba(255, 255, 255, 0.8);
50+
#search-icon {
51+
margin-left: .5em;
6452
}
6553

66-
div#toolbar > div#project-details > h2#project-version {
67-
font-size: 12px;
68-
font-weight: 200;
69-
margin-left: 1px;
54+
@media (min-width: 410px) {
55+
.navbar-brand .project-logo {
56+
display: inline;
57+
}
7058
}
7159

72-
div#toolbar > a#github-link {
73-
color: #fff;
74-
position: absolute;
75-
top: 7px;
76-
right: 15px;
77-
font-size: 40px;
60+
@media (min-width: 768px) {
61+
#search-icon {
62+
margin-left: 1em;
63+
}
7864
}

0 commit comments

Comments
 (0)