openvibers/openvibe.design Commits
The LIVE badge reads on its white text (#111)
Changes
@@@ -62,7 +62,7 @@ html, body { margin: 0; background: var(--bg-primary, #0a0f1c); color: var(--tex.pv-frame { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 16px; background: var(--bg-primary); color: var(--text-primary); border: 1px solid var(--border); min-width: 0; font-size: .86rem; }.pv-label { margin: 0; font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }.pv-video { position: relative; aspect-ratio: 16 / 8; border-radius: 12px; background: radial-gradient(120% 120% at 70% 30%, color-mix(in srgb, var(--accent) 40%, transparent), transparent 60%), linear-gradient(160deg, var(--bg-tertiary, var(--bg-card)), var(--bg-card)); }--.pv-badge { position: absolute; left: 8px; top: 8px; padding: 1px 7px; border-radius: 5px; background: var(--live-red, #e11d48); color: #fff; font-size: .68rem; font-weight: 800; }++.pv-badge { position: absolute; left: 8px; top: 8px; padding: 1px 7px; border-radius: 5px; background: color-mix(in srgb, var(--live-red, #e11d48) 80%, #000); color: #fff; font-size: .68rem; font-weight: 800; }.pv-viewers { position: absolute; right: 8px; bottom: 8px; padding: 1px 7px; border-radius: 5px; background: rgba(0, 0, 0, .6); color: #fff; font-size: .7rem; font-weight: 700; }.pv-row { display: flex; align-items: center; gap: 10px; min-width: 0; }.pv-col { display: flex; flex-direction: column; min-width: 0; flex: 1; }nnew file mode 100644@@@ -0,0 +1,15 @@++'use strict';++// WCAG 2.1 AA: the preview's LIVE badge was white on the live red (3.8:1). The red is now 80% over black,++// which keeps the badge red and lifts the white text.++// node test/contrast.test.js++const assert = require('assert');++const fs = require('fs');++const path = require('path');++++const css = fs.readFileSync(path.join(__dirname, '..', 'public', 'css', 'design.css'), 'utf8');++assert.ok(++ css.includes('background: color-mix(in srgb, var(--live-red, #e11d48) 80%, #000); color: #fff; font-size: .68rem; font-weight: 800; }'),++ 'the LIVE badge darkens its red under white text'++);++assert.ok(!css.includes('.pv-badge { position: absolute; left: 8px; top: 8px; padding: 1px 7px; border-radius: 5px; background: var(--live-red, #e11d48);'), 'the plain live red is gone from the badge');++console.log('contrast: the LIVE badge reads');
@@ -62,7 +62,7 @@ html, body { margin: 0; background: var(--bg-primary, #0a0f1c); color: var(--tex
@@ -62,7 +62,7 @@ html, body { margin: 0; background: var(--bg-primary, #0a0f1c); color: var(--tex
.pv-frame { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 16px; background: var(--bg-primary); color: var(--text-primary); border: 1px solid var(--border); min-width: 0; font-size: .86rem; }
.pv-frame { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 16px; background: var(--bg-primary); color: var(--text-primary); border: 1px solid var(--border); min-width: 0; font-size: .86rem; }
.pv-label { margin: 0; font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.pv-label { margin: 0; font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.pv-video { position: relative; aspect-ratio: 16 / 8; border-radius: 12px; background: radial-gradient(120% 120% at 70% 30%, color-mix(in srgb, var(--accent) 40%, transparent), transparent 60%), linear-gradient(160deg, var(--bg-tertiary, var(--bg-card)), var(--bg-card)); }
.pv-video { position: relative; aspect-ratio: 16 / 8; border-radius: 12px; background: radial-gradient(120% 120% at 70% 30%, color-mix(in srgb, var(--accent) 40%, transparent), transparent 60%), linear-gradient(160deg, var(--bg-tertiary, var(--bg-card)), var(--bg-card)); }
-.pv-badge { position: absolute; left: 8px; top: 8px; padding: 1px 7px; border-radius: 5px; background: var(--live-red, #e11d48); color: #fff; font-size: .68rem; font-weight: 800; }
+.pv-badge { position: absolute; left: 8px; top: 8px; padding: 1px 7px; border-radius: 5px; background: color-mix(in srgb, var(--live-red, #e11d48) 80%, #000); color: #fff; font-size: .68rem; font-weight: 800; }
.pv-viewers { position: absolute; right: 8px; bottom: 8px; padding: 1px 7px; border-radius: 5px; background: rgba(0, 0, 0, .6); color: #fff; font-size: .7rem; font-weight: 700; }
.pv-viewers { position: absolute; right: 8px; bottom: 8px; padding: 1px 7px; border-radius: 5px; background: rgba(0, 0, 0, .6); color: #fff; font-size: .7rem; font-weight: 700; }
.pv-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pv-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pv-col { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.pv-col { display: flex; flex-direction: column; min-width: 0; flex: 1; }
new file mode 100644
new file mode 100644
@@ -0,0 +1,15 @@
@@ -0,0 +1,15 @@
+'use strict';
+// WCAG 2.1 AA: the preview's LIVE badge was white on the live red (3.8:1). The red is now 80% over black,
+// which keeps the badge red and lifts the white text.
+// node test/contrast.test.js
+const assert = require('assert');
+const fs = require('fs');
+const path = require('path');
+
+const css = fs.readFileSync(path.join(__dirname, '..', 'public', 'css', 'design.css'), 'utf8');
+assert.ok(
+ css.includes('background: color-mix(in srgb, var(--live-red, #e11d48) 80%, #000); color: #fff; font-size: .68rem; font-weight: 800; }'),
+ 'the LIVE badge darkens its red under white text'
+);
+assert.ok(!css.includes('.pv-badge { position: absolute; left: 8px; top: 8px; padding: 1px 7px; border-radius: 5px; background: var(--live-red, #e11d48);'), 'the plain live red is gone from the badge');
+console.log('contrast: the LIVE badge reads');