openvibers/openvibe.rent Commits

Price moves use the readable status text colours (#182)

OP OpenVibers committed 12 days ago · 99d917347d · 2 files, +19 −2

Changes

ddiff --git a/public/css/cities.css b/public/css/cities.css
iindex b0d1a00..f1ece99 100644
---- a/public/css/cities.css
++++ b/public/css/cities.css
@@@ -86,8 +86,8 @@
.rent-move strong { display: block; font-size: 1.3rem; font-variant-numeric: tabular-nums; color: var(--text-primary, #e6edf7); }
.rent-move .rent-move-none { font-size: .95rem; color: var(--text-secondary, #96a7c2); }
.rent-move-note { display: block; font-size: .76rem; color: var(--text-muted, #7386a3); }
--.rent-move strong.rent-move-up { color: var(--warning, #f59e0b); }
--.rent-move strong.rent-move-down { color: var(--success, #22c55e); }
++.rent-move strong.rent-move-up { color: var(--warning-text, #f59e0b); }
++.rent-move strong.rent-move-down { color: var(--success-text, #22c55e); }
.listing-report-mini { margin-top: 6px; }
.listing-report-mini button { font-family: inherit; line-height: inherit; cursor: pointer; background: transparent; }
/* A figure's source in its own card (market outcome 5), and the one line on who pays us (outcome 3) */
ddiff --git a/test/move-colours.test.js b/test/move-colours.test.js
nnew file mode 100644
iindex 0000000..e383cba
---- /dev/null
++++ b/test/move-colours.test.js
@@@ -0,0 +1,17 @@
++'use strict';
++/**
++ * Price-move words are text, not fills: the status fill colours read 2:1 on a light theme (Daylight's white),
++ * so up and down use the theme's readable --warning-text / --success-text pair.
++ */
++const assert = require('assert');
++const fs = require('fs');
++const path = require('path');
++
++const css = fs.readFileSync(path.join(__dirname, '..', 'public', 'css', 'cities.css'), 'utf8');
++assert.match(css, /\.rent-move strong\.rent-move-up \{ color: var\(--warning-text,/);
++assert.match(css, /\.rent-move strong\.rent-move-down \{ color: var\(--success-text,/);
++assert.ok(
++ !/\.rent-move strong\.rent-move-(up|down) \{ color: var\(--(warning|success),/.test(css),
++ 'no price-move word uses the fill colour'
++);
++console.log('move colours: the status text pair is used');