Skip to content

Commit d775ed4

Browse files
committed
CSS changes to ensure the layout is preserved and optimised on mobile and small screen widths.
1 parent 72892b4 commit d775ed4

1 file changed

Lines changed: 33 additions & 16 deletions

File tree

index.html

Lines changed: 33 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,16 @@
7474
width: 100%; /* these cards are larger than the default due to the contents of each being so large */
7575
margin: 0.5em 0;
7676
}
77+
78+
/* For browsers which support grid layouts - Reset the widths and margins applied in the initial .card styles above as they aren't required when using grid layout */
79+
@supports (display: grid)
80+
{
81+
.card
82+
{
83+
width: auto;
84+
margin: 0;
85+
}
86+
}
7787

7888
.cardHead
7989
{
@@ -96,7 +106,7 @@
96106

97107
#outputCategoriesMenu /* APPS | COLLECTIONS | REPORTS | GRAPHICS */
98108
{
99-
padding-top: 3.3em;
109+
padding-top: 3.4em;
100110
margin-top: 0;
101111
margin-bottom: 0;
102112
margin-left: 2.5em;
@@ -168,36 +178,43 @@
168178
}
169179

170180

171-
/* Display cards in a single column on smaller displays, rather than in the default 2-column */
181+
/* Reduce the size of certain elements on very small displays */
172182
@media (max-width:750px)
173183
{
184+
/* Display cards in a single column on smaller displays, rather than in the default 2-column */
174185
.cardContainer
175186
{
176-
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); /* to fix issue on small displays where the minimum width is still to large and so causes horizontal scrolling */
187+
grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); /* to fix issue on small displays where the minimum width is still to large and so causes horizontal scrolling */
188+
gap: 1em;
189+
190+
/* legacy spec definitions for extra safety */
191+
grid-gap: 1em;
177192
}
178-
}
179-
180-
/* Reduce the size of the output categories menu on very small displays */
181-
@media (max-width:640px) {
193+
182194
#outputCategoriesMenu /* APPS | COLLECTIONS | REPORTS | GRAPHICS */
183195
{
184196
padding-top: 3.2em;
185-
margin-bottom: -1px;
197+
margin-bottom: -2px;
198+
margin-left: 1.1em;
186199
}
187200

188201
#outputCategoriesMenu a
189202
{
190-
font-size: 0.80em;
203+
font-size: 0.7em;
204+
}
205+
206+
#featured
207+
{
208+
border-radius: 1em;
209+
padding: 0.7em;
191210
}
192211
}
193212

194-
/* For browsers which support grid layouts - Reset the widths and margins applied in the .card styles above as they aren't required when using grid layout */
195-
@supports (display: grid)
213+
@media (max-width:620px)
196214
{
197-
.card
215+
#outputCategoriesMenu /* APPS | COLLECTIONS | REPORTS | GRAPHICS */
198216
{
199-
width: auto;
200-
margin: 0;
217+
padding-top: 5.9em;
201218
}
202219
}
203220
</style>
@@ -212,8 +229,8 @@
212229
<li><a href="#footer" class="themeBlockDark">Skip to footer</a></li>
213230
</ul>
214231
<img src="https://www.trafforddatalab.io/assets/logo/trafforddatalab_logo.svg" alt="Trafford Data Lab" width="93" class="traffordDataLabLogo"/>
215-
<p class="hideContent">Main Menu</p>
216-
<ul class="navbar">
232+
<p id="mainMenu" class="hideContent">Main Menu</p>
233+
<ul class="navbar" labelled-by="mainMenu">
217234
<li><a href="charticles.html">Charticles</a></li>
218235
<li><a href="data.html">Data</a></li>
219236
<li><a href="learning.html">Learning</a></li>

0 commit comments

Comments
 (0)