Skip to content

Commit 6b2727c

Browse files
committed
Compare site: make summaries responsive
1 parent 28b4459 commit 6b2727c

File tree

1 file changed

+35
-8
lines changed

1 file changed

+35
-8
lines changed

site/static/compare.html

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -236,14 +236,41 @@
236236
border-radius: 6px;
237237
}
238238

239+
.summary-container {
240+
display: flex;
241+
flex-direction: column;
242+
margin-bottom: 10px;
243+
}
239244
.summary {
240245
display: flex;
241-
justify-content: center;
242-
align-items: center;
243-
width: 20%;
244246
}
245-
.summary-wide {
246-
width: 35%;
247+
.summary-values {
248+
display: flex;
249+
flex-direction: column;
250+
}
251+
@media (min-width: 650px) {
252+
.summary-container {
253+
flex-direction: row;
254+
margin-bottom: 0;
255+
align-items: center;
256+
}
257+
.summary-container > span {
258+
text-align: right;
259+
width: 20%;
260+
}
261+
.summary-values {
262+
width: 100%;
263+
flex-direction: row;
264+
justify-content: flex-end;
265+
align-items: center;
266+
}
267+
.summary {
268+
width: 15%;
269+
align-items: center;
270+
}
271+
.summary-wide {
272+
width: 20%;
273+
}
247274
}
248275
</style>
249276
<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
@@ -430,10 +457,10 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
430457
</span>
431458
</span>
432459
</div>
433-
<div v-for="summaryPair in Object.entries(summary)" style="display: flex;">
434-
<span style="font-weight: bold; width: 30%; margin-left: 15%; text-transform: capitalize;">{{
460+
<div v-for="summaryPair in Object.entries(summary)" class="summary-container">
461+
<span style="font-weight: bold; margin-left: 5px; text-transform: capitalize;">{{
435462
summaryPair[0] }}:</span>
436-
<div style="display: flex; justify-content: flex-end; width: 80%; margin-right: 5%;">
463+
<div class="summary-values">
437464
<span class="summary summary-wide positive">
438465
{{summaryPair[1].regressions.toString().padStart(3, "&nbsp;")}}
439466
<svg style="width:18px;height:18px" viewBox="0 0 24 24">

0 commit comments

Comments
 (0)