Skip to content

Commit 8c78652

Browse files
committed
ScadaDoc: improve appearance
1 parent e8caef6 commit 8c78652

File tree

8 files changed

+52
-23
lines changed

8 files changed

+52
-23
lines changed

ScadaDoc/ScadaDoc/ScadaDoc.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@
232232
<Content Include="css\contents.less" />
233233
<Content Include="css\search.less" />
234234
<Content Include="css\cover.less" />
235+
<Content Include="css\variables.less" />
235236
<None Include="Web.Debug.config">
236237
<DependentUpon>Web.config</DependentUpon>
237238
</None>

ScadaDoc/ScadaDoc/css/common.less

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
body {
1+
@import "variables.less";
2+
3+
body {
4+
background-color: @content-back-color;
5+
color: @content-fore-color;
26
font-family: Arial, Helvetica, sans-serif;
37
font-size: 14px;
48
margin: 0;
@@ -33,20 +37,20 @@ p, ul, ol {
3337
}
3438

3539
em {
36-
color: #dd0055;
40+
color: @content-fore-color-em;
3741
}
3842

3943
a,
4044
a:active,
4145
a:hover,
4246
a:focus,
4347
a:visited {
44-
color: #1fa2d6;
48+
color: @link-fore-color;
4549
outline: 0;
4650
text-decoration: none;
4751
}
4852

4953
a:hover {
50-
color: #0074a2;
54+
color: @link-hover-fore-color;
5155
text-decoration: underline;
5256
}

ScadaDoc/ScadaDoc/css/contents.less

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
.sd-contents-wrapper {
1+
@import "variables.less";
2+
3+
.sd-contents-wrapper {
24
border-right: 5px solid #ddd;
35
display: inline-block;
46
margin: 0;
@@ -11,25 +13,30 @@
1113
.sd-contents {
1214
font-size: 13px;
1315
margin: 0;
14-
padding: 10px;
16+
padding: 10px 0;
1517
}
1618

1719
.sd-contents-item {
18-
margin: 7px 0;
20+
padding: 5px 10px;
1921
}
2022

2123
.sd-contents-item.level1 {
22-
margin-left: 20px;
24+
padding-left: 30px;
2325
}
2426

2527
.sd-contents-item.level2 {
26-
margin-left: 40px;
28+
padding-left: 40px;
2729
}
2830

2931
.sd-contents-item.level3 {
30-
margin-left: 60px;
32+
padding-left: 70px;
3133
}
3234

3335
.sd-contents-item.selected {
34-
font-weight: bold;
36+
background-color: @link-fore-color;
37+
color: @content-back-color;
3538
}
39+
40+
.sd-contents-item.selected a {
41+
color: @content-back-color;
42+
}

ScadaDoc/ScadaDoc/css/scadadoc.css

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
body {
2+
background-color: white;
3+
color: black;
24
font-family: Arial, Helvetica, sans-serif;
35
font-size: 14px;
46
margin: 0;
@@ -56,22 +58,26 @@ a:hover {
5658
.sd-contents {
5759
font-size: 13px;
5860
margin: 0;
59-
padding: 10px;
61+
padding: 10px 0;
6062
}
6163
.sd-contents-item {
62-
margin: 7px 0;
64+
padding: 5px 10px;
6365
}
6466
.sd-contents-item.level1 {
65-
margin-left: 20px;
67+
padding-left: 30px;
6668
}
6769
.sd-contents-item.level2 {
68-
margin-left: 40px;
70+
padding-left: 40px;
6971
}
7072
.sd-contents-item.level3 {
71-
margin-left: 60px;
73+
padding-left: 70px;
7274
}
7375
.sd-contents-item.selected {
74-
font-weight: bold;
76+
background-color: #1fa2d6;
77+
color: white;
78+
}
79+
.sd-contents-item.selected a {
80+
color: white;
7581
}
7682
.sd-article-wrapper {
7783
display: inline-block;
@@ -117,6 +123,7 @@ table.sd-article-table {
117123
}
118124
.gsc-control-cse {
119125
padding: 0 !important;
126+
margin: 0 10px !important;
120127
}
121128
.gsc-control-cse input {
122129
box-sizing: content-box;

ScadaDoc/ScadaDoc/css/scadadoc.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ScadaDoc/ScadaDoc/css/search.less

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.gsc-control-cse {
22
padding: 0 !important;
3+
margin: 0 10px !important;
34
}
45

56
.gsc-control-cse input {

ScadaDoc/ScadaDoc/css/variables.less

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@content-back-color: white;
2+
@content-fore-color: black;
3+
@content-fore-color-em: #dd0055;
4+
@link-fore-color: #1fa2d6;
5+
@link-hover-fore-color: #0074a2;

ScadaDoc/ScadaDoc/js/scadadoc.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,18 @@ function createContents() {
5757
$.getScript(context.siteRoot + "js/contents-" + context.lang + ".js", function () {
5858
addContents(context);
5959

60-
var selItem = $(".sd-contents-item.selected:first");
61-
if (selItem.length > 0) {
62-
context.contents.scrollTop(selItem.offset().top);
63-
}
64-
6560
if (typeof onContentsCreated == "function") {
6661
onContentsCreated();
6762
}
63+
64+
// scroll contents
65+
var selItem = $(".sd-contents-item.selected:first");
66+
if (selItem.length > 0) {
67+
// delay is needed to load search panel that affects contents height
68+
setTimeout(function () {
69+
context.contents.parent().scrollTop(selItem.offset().top)
70+
}, 200);
71+
}
6872
});
6973
}
7074

0 commit comments

Comments
 (0)