Skip to content

Commit 3983b9d

Browse files
authored
Merge pull request #44 from developmentseed/style/table-labels
Color code stat table labels
2 parents b632d06 + 6a242ab commit 3983b9d

File tree

2 files changed

+34
-21
lines changed

2 files changed

+34
-21
lines changed

packages/web/src/app/stats.tsx

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ export function Stats(props: StatsProps) {
4545
<thead>
4646
<tr>
4747
<th>Feature</th>
48-
<th>Added</th>
49-
<th>Modified</th>
50-
<th>Deleted</th>
48+
<th><span class="feature--label feature--label__add">Added</span></th>
49+
<th><span class="feature--label feature--label__mod">Modified</span></th>
50+
<th><span class="feature--label feature--label__del">Deleted</span></th>
5151
</tr>
5252
</thead>
5353
<tbody>
@@ -145,19 +145,19 @@ export function Stats(props: StatsProps) {
145145
<span class="bar-chart__bar--label">Buildings</span>
146146
<div class="bar-chart__bar--value">
147147
<span
148-
class="bar-chart__bar--val1"
148+
class="bar-chart__bar--add"
149149
style={`flex-basis: ${
150150
(stats.buildingsAdded / stats.buildings) * 100
151151
}%`}
152152
/>
153153
<span
154-
class="bar-chart__bar--val2"
154+
class="bar-chart__bar--mod"
155155
style={`flex-basis: ${
156156
(stats.buildingsModified / stats.buildings) * 100
157157
}%`}
158158
/>
159159
<span
160-
class="bar-chart__bar--val3"
160+
class="bar-chart__bar--del"
161161
style={`flex-basis: ${
162162
(stats.buildingsDeleted / stats.buildings) * 100
163163
}%`}
@@ -168,19 +168,19 @@ export function Stats(props: StatsProps) {
168168
<span class="bar-chart__bar--label">Highways</span>
169169
<div class="bar-chart__bar--value">
170170
<span
171-
class="bar-chart__bar--val1"
171+
class="bar-chart__bar--add"
172172
style={`flex-basis: ${
173173
(stats.highwaysAdded / stats.highways) * 100
174174
}%`}
175175
/>
176176
<span
177-
class="bar-chart__bar--val2"
177+
class="bar-chart__bar--mod"
178178
style={`flex-basis: ${
179179
(stats.highwaysModified / stats.highways) * 100
180180
}%`}
181181
/>
182182
<span
183-
class="bar-chart__bar--val3"
183+
class="bar-chart__bar--del"
184184
style={`flex-basis: ${
185185
(stats.highwaysDeleted / stats.highways) * 100
186186
}%`}
@@ -191,17 +191,17 @@ export function Stats(props: StatsProps) {
191191
<span class="bar-chart__bar--label">Other</span>
192192
<div class="bar-chart__bar--value">
193193
<span
194-
class="bar-chart__bar--val1"
194+
class="bar-chart__bar--add"
195195
style={`flex-basis: ${(stats.otherAdded / stats.other) * 100}%`}
196196
/>
197197
<span
198-
class="bar-chart__bar--val2"
198+
class="bar-chart__bar--mod"
199199
style={`flex-basis: ${
200200
(stats.otherModified / stats.other) * 100
201201
}%`}
202202
/>
203203
<span
204-
class="bar-chart__bar--val3"
204+
class="bar-chart__bar--del"
205205
style={`flex-basis: ${
206206
(stats.otherDeleted / stats.other) * 100
207207
}%`}
@@ -213,9 +213,9 @@ export function Stats(props: StatsProps) {
213213
<thead>
214214
<tr>
215215
<th>Feature</th>
216-
<th>Added</th>
217-
<th>Modified</th>
218-
<th>Deleted</th>
216+
<th><span class="feature--label feature--label__add">Added</span></th>
217+
<th><span class="feature--label feature--label__mod">Modified</span></th>
218+
<th><span class="feature--label feature--label__del">Deleted</span></th>
219219
</tr>
220220
</thead>
221221
<tbody>

packages/web/src/index.css

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ p, h1, h2, h3, h4, h5, h6 {
3636
--base-light: #f4f4f4;
3737
--bg-dark: #051730;
3838
--bg-light: #eae9ee;
39+
40+
--color-success: #8CF8A3;
41+
--color-info: #619EFF;
42+
--color-danger: #FF7A7A;
3943
--font-family: 'DM Sans', Helvetica, Arial, sans-serif;
4044
}
4145

@@ -232,14 +236,14 @@ li.bar-chart__bar {
232236
width: 100%;
233237
box-shadow: inset 0 0 1px 1px rgba(222,222,222,0.25)
234238
}
235-
.bar-chart__bar--val1 {
236-
background: #8CF8A3;
239+
.bar-chart__bar--add {
240+
background: var(--color-success);
237241
}
238-
.bar-chart__bar--val2 {
239-
background: #619EFF;
242+
.bar-chart__bar--mod {
243+
background: var(--color-info)
240244
}
241-
.bar-chart__bar--val3 {
242-
background:#FF7A7A;
245+
.bar-chart__bar--del {
246+
background: var(--color-danger);
243247
}
244248
.stats table th {
245249
text-transform: uppercase;
@@ -248,6 +252,15 @@ li.bar-chart__bar {
248252
text-align: left;
249253
border-bottom: 1px solid rgba(255, 255, 255, 0.25);
250254
}
255+
.feature--label__add{
256+
color: var(--color-success);
257+
}
258+
.feature--label__mod{
259+
color: var(--color-info);
260+
}
261+
.feature--label__del{
262+
color: var(--color-danger);
263+
}
251264

252265
.stats table th:not(:first-child),
253266
.stats table td:not(:first-child) {

0 commit comments

Comments
 (0)