Skip to content

Commit 87aa749

Browse files
Handle long entries on Connecticut map (#321)
Changes: * Make scorecard title smaller on mobile on both maps so it doesn't cover as much of the map * Truncate overly wrong dropdown entries when currently chosen * Make the dropdown wider in CT map * But we also don't make it the full width necessary of 300px because it makes the dropdown look way too wide for most entries.
1 parent f80e7b0 commit 87aa749

File tree

4 files changed

+42
-1
lines changed

4 files changed

+42
-1
lines changed

packages/ct/src/css/overrides.scss

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// These values come from packages/shared.
2+
$xs-width: 480px;
3+
$sm-width: 640px;
4+
5+
@mixin gt-xxs() {
6+
@media screen and (min-width: $xs-width) {
7+
@content();
8+
}
9+
}
10+
11+
@mixin gt-xs() {
12+
@media screen and (min-width: $sm-width) {
13+
@content();
14+
}
15+
}
16+
17+
// Make the header wider on large breakpoints.
18+
.choices[data-type*="select-one"] {
19+
.choices__inner {
20+
@include gt-xxs() {
21+
width: 245px;
22+
}
23+
@include gt-xs() {
24+
width: 270px;
25+
}
26+
}
27+
}

packages/ct/src/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<meta charset="utf-8" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
77
<link rel="stylesheet" href="../../shared/src/css/style.scss" />
8+
<link rel="stylesheet" href="./css/overrides.scss" />
89
</head>
910

1011
<body>

packages/shared/src/css/_dropdown.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@
2121
border-top-right-radius: borders.$border-radius;
2222
border-bottom-left-radius: 0;
2323
border-bottom-right-radius: 0;
24+
25+
// Ensure the dropdown does not ever make the header too tall if we have long
26+
// entries. Note that the scorecard will already show the full title of the
27+
// selected city.
28+
.choices__list--single .choices__item--selectable {
29+
white-space: nowrap;
30+
overflow: hidden;
31+
width: 95%;
32+
}
2433
}
2534

2635
&:not(.is-open) {

packages/shared/src/css/_scorecard.scss

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@
4646

4747
color: colors.$teal;
4848
font-weight: bold;
49-
font-size: typography.$font-size-xl;
49+
font-size: typography.$font-size-lg;
50+
51+
@include breakpoints.gt-xs {
52+
font-size: typography.$font-size-xl;
53+
}
5054
}
5155

5256
.scorecard-accordion-toggle {

0 commit comments

Comments
 (0)