Skip to content

Commit 604f286

Browse files
authored
Merge pull request #1097 from cambridge-cares/dev-css-hotfix
Dev-css-hotfix
2 parents 839524f + 342bdf6 commit 604f286

File tree

3 files changed

+66
-53
lines changed

3 files changed

+66
-53
lines changed

web/twa-vis-framework/library/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
[//]: # (Note that version headers need to start with "# " characters to be picked up by some automated scripts)
22

3+
#4.5.0
4+
### Bug Fixes
5+
* Removed linear-gradient effect in sidebar due to scrollbar getting affected
6+
* Increased hover height of selected sidebar tab
7+
* Fixed content container overlapping with tabs in sidebar
8+
* Removed grey outlines in hovered and selected sidebar tabs
9+
310
#4.5.0
411
### Features
512
Three control buttons are now included by default. These are:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.5.0
1+
4.5.1

web/twa-vis-framework/library/src/css/twa-vf.css

Lines changed: 58 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,20 @@
66
* a tool that can do it for me, looks like it'll beed to be done manually.
77
*/
88

9+
@media (prefers-color-scheme: light) {
10+
:root {
11+
/* Background colors */
12+
--cmcl-blue: #18677a;
13+
}
14+
}
15+
16+
@media (prefers-color-scheme: dark) {
17+
:root {
18+
/* Background colors */
19+
--cmcl-blue: #18677a;
20+
}
21+
}
22+
923
html,
1024
body {
1125
width: 100%;
@@ -96,10 +110,10 @@ h6 {
96110

97111
#sidePanel {
98112
z-index: 999;
99-
background-color: #18677a;
113+
background-color: var(--cmcl-blue);
100114
box-sizing: border-box;
101-
border: 1px solid #18677a;
102-
box-shadow: 0 4px 8px 0 #18677a;
115+
border: 1px solid var(--cmcl-blue);
116+
box-shadow: 0 4px 8px 0 var(--cmcl-blue);
103117
font-family: Inter, sans-serif !important;
104118
font-size: 11pt;
105119
height: 100%
@@ -116,7 +130,8 @@ h6 {
116130
width: 15px;
117131
height: 15px;
118132
text-align: center;
119-
margin: 6px
133+
margin: 6px;
134+
float: right
120135
}
121136

122137
#sidePanel.small {
@@ -137,10 +152,6 @@ h6 {
137152
border-radius: 8px
138153
}
139154

140-
#expandButtonContainer {
141-
float: right
142-
}
143-
144155
#sidePanel.large #expandButtonContainer {
145156
margin-top: -8px;
146157
margin-right: 20px;
@@ -209,17 +220,6 @@ p {
209220
overflow-y: auto
210221
}
211222

212-
#contentContainer {
213-
width: 100%;
214-
height: 100%;
215-
margin-bottom: 70px;
216-
flex: 1 1 auto;
217-
display: flex;
218-
flex-direction: column;
219-
overflow-x: hidden;
220-
overflow-y: auto
221-
}
222-
223223
#meta-tree {
224224
flex: 1;
225225
overflow-y: scroll
@@ -235,7 +235,7 @@ p {
235235

236236
#footerContainer {
237237
text-shadow: 2px 2px 3px #000;
238-
font-family: Verdana;
238+
font-family: Verdana, sans-serif;
239239
color: #51b7a6;
240240
text-align: center;
241241
height: 40px;
@@ -866,7 +866,7 @@ label[for=select-feature] {
866866
}
867867

868868
.json-container {
869-
font-family: 'Open Sans';
869+
font-family: 'Open Sans', sans-serif;
870870
font-size: 16px;
871871
background-color: #fff;
872872
color: grey;
@@ -985,22 +985,15 @@ label[for=select-feature] {
985985
height: 100%
986986
}
987987

988-
#sidePanelLegend {
989-
height: 100%;
990-
overflow-x: hidden;
991-
overflow-y: auto;
992-
display: block;
993-
padding: 5px;
994-
margin: 0 20px 40px 20px
995-
}
988+
996989

997990
.ui-tabs-anchor {
998991
font-size: 10pt;
999992
font-weight: 700
1000993
}
1001994

1002995
#sidePanelInner .ui-widget-header {
1003-
background: #18677a;
996+
background: var(--cmcl-blue);
1004997
border: none;
1005998
border-radius: 0;
1006999
padding: 5px 5px 0 5px
@@ -1040,13 +1033,24 @@ label[for=select-feature] {
10401033

10411034
#sidePanelInner .ui-tabs-nav li.ui-state-active,
10421035
#sidePanelInner .ui-tabs-nav li.ui-tabs-selected {
1043-
top: -3px;
1036+
top: -7px;
10441037
background: #628f9d !important;
10451038
box-shadow: 0 4px 8px 0 #222
10461039
}
10471040

1048-
#sidePanelGeneral {
1049-
height: calc(100% - 50px)
1041+
1042+
#sidePanelGeneral,
1043+
#sidePanelLegend,
1044+
#sidePanelLinks,
1045+
#sidePanelAck,
1046+
#sidePanelFailure {
1047+
position: relative;
1048+
overflow: auto;
1049+
/* background: linear-gradient(white, rgba(255, 255, 255, 0));
1050+
-webkit-mask-image: linear-gradient(to bottom, black 90%, transparent); <-- nice effect but messing with the scroll bar. Can't rn figure how to fix
1051+
mask-image: linear-gradient(to bottom, black 95%, transparent); */
1052+
margin: 0px 0px 35px 0px;
1053+
padding: 1em 1em 3em
10501054
}
10511055

10521056
#sidePanelLinks {
@@ -1070,7 +1074,7 @@ label[for=select-feature] {
10701074
}
10711075

10721076
#sidePanelLinks ul:hover a:hover {
1073-
color: #18677a;
1077+
color: var(--cmcl-blue);
10741078
text-shadow: #333;
10751079
}
10761080

@@ -1082,7 +1086,6 @@ label[for=select-feature] {
10821086
width: 250px;
10831087
height: auto;
10841088
position: fixed;
1085-
top: 0;
10861089
left: 0;
10871090
margin: 20px;
10881091
z-index: 1;
@@ -1145,7 +1148,8 @@ label[for=select-feature] {
11451148
#layerContainer .controlContents {
11461149
display: flex;
11471150
flex-flow: column;
1148-
overflow: hidden
1151+
overflow: hidden;
1152+
flex-grow: 1;
11491153
}
11501154

11511155
#layerTree {
@@ -1689,25 +1693,27 @@ li {
16891693
background-color: #f6f8fa
16901694
}
16911695

1692-
#sidePanelGeneral {
1693-
position: relative;
1694-
z-index: 1;
1695-
overflow: hidden;
1696-
background: linear-gradient(white, rgba(255,255,255,0));
1697-
-webkit-mask-image: linear-gradient(to bottom, black 90%, transparent);
1698-
mask-image: linear-gradient(to bottom, black 90%, transparent);
1699-
}
1696+
/* override jquery-ui.css styling for hovering over sidebar tabs */
17001697

1701-
#sidePanelLegend, #sidePanelLinks {
1702-
position: relative;
1703-
z-index: 1;
1704-
overflow: auto;
1705-
background: linear-gradient(white, rgba(255,255,255,0));
1706-
-webkit-mask-image: linear-gradient(to bottom, black 90%, transparent);
1707-
mask-image: linear-gradient(to bottom, black 50%, transparent);
1698+
.ui-state-hover,
1699+
.ui-state-active,
1700+
.ui-widget-content .ui-state-hover,
1701+
.ui-widget-header .ui-state-hover,
1702+
.ui-state-focus,
1703+
.ui-widget-content .ui-state-focus,
1704+
.ui-widget-header .ui-state-focus,
1705+
.ui-button,
1706+
.ui-button:hover,
1707+
.ui-button:focus,
1708+
.ui-state-default,
1709+
.ui-widget-content .ui-state-default,
1710+
.ui-widget-header .ui-state-default,
1711+
html .ui-button.ui-state-disabled:hover,
1712+
html .ui-button.ui-state-disabled:active {
1713+
border: unset;
17081714
}
17091715

17101716
/* zoom and compass element shifted down below the mapbox logo */
1711-
.mapboxgl-ctrl-top-right{
1717+
.mapboxgl-ctrl-top-right {
17121718
top: 30px
17131719
}

0 commit comments

Comments
 (0)