openvibers/openvibe.live Commits
The chat send button takes the on-accent ink (#633)
Changes
@@@ -3098,11 +3098,11 @@ a.pulse-card:hover { border-color: var(--accent); transform: translateY(-2px); }position: absolute; right: 4px; bottom: 4px;padding: 6px 8px; background: var(--accent-dark);border: none; border-radius: var(--radius);-- color: var(--text-primary); font-size: 0.85rem;++ color: var(--on-accent, #fff); font-size: 0.85rem;cursor: pointer; transition: background var(--ov-dur-2, 0.15s);z-index: 1;}--.chat-send-btn:hover { background: var(--accent); color: #000; }++.chat-send-btn:hover { background: var(--accent-dark); color: var(--on-accent, #fff); filter: brightness(1.18); }.chat-tools-row {display: flex; gap: 4px; align-items: center;padding: 4px 0 0;@@@ -7766,7 +7766,6 @@ body.fabs-tucked .messenger-toggle, body.fabs-tucked .floating-chat-fab, body.fa@media (hover: none) {.stream-card:hover { transform: none; border-color: var(--border); box-shadow: none; }.paste-card:hover { transform: none; border-color: var(--border); box-shadow: none; }-- .chat-send-btn:hover { background: var(--accent-dark); color: var(--text-primary); }.btn:hover { filter: none; }}nnew file mode 100644@@@ -0,0 +1,41 @@++/**++ * The chat send button sits on an accent fill, so it takes the on-accent ink. It used to take++ * `var(--text-primary)`, which is the theme's *page* ink: fine on the dark themes (near-white on++ * #1d4ed8) and unreadable on the light ones, where daylight's #1a1a2e sat on #6d28d9 at 2.4:1++ * (measured at 390 px, signed out, openvibe.live/chat). That is below even the 3:1 a UI icon needs.++ *++ * node test/send-button-ink.test.js++ */++'use strict';++const assert = require('assert');++const fs = require('fs');++const path = require('path');++++const css = fs.readFileSync(path.join(__dirname, '..', 'public', 'css', 'style.css'), 'utf8');++++// Every rule that paints the send button: selector, then its declarations.++const rules = [...css.matchAll(/([^{}]*\.chat-send-btn[^{}]*)\{([^{}]*)\}/g)]++ .map(([, sel, body]) => ({ sel: sel.trim().split('\n').pop().trim(), body }))++ .filter((r) => r.sel.startsWith('.chat-send-btn') || r.sel.includes('.chat-send-btn'));++++assert.ok(rules.length >= 2, `found the send button's rules (${rules.length})`);++++for (const r of rules) {++ const color = (/(?:^|;|\s)color:\s*([^;]+)/.exec(r.body) || [])[1];++ const overrides = /\.chat-send-btn/.test(r.sel) && !/^\.chat-send-btn(\.[\w-]+)?(:[\w-]+)?$/.test(r.sel.split(',')[0].trim());++ if (!color || overrides) continue; // layout-only or a wider context rule++ assert.ok(++ /var\(--on-accent\b/.test(color),++ `${r.sel}: "${color.trim()}" is the page ink; an accent fill takes var(--on-accent, #fff)`++ );++}++++// The touch-device block must not put the page ink back on the fill.++const touch = /@media \(hover: none\) \{([\s\S]*?)\n\}/.exec(css);++assert.ok(touch, 'the touch-device block is still there');++assert.ok(++ !/\.chat-send-btn:hover\s*\{[^}]*color:\s*var\(--text-primary\)/.test(touch[1]),++ 'the touch-device hover rule still paints the page ink on the send button'++);++++console.log(`send button ink: ${rules.length} rules take the on-accent ink`);
@@ -3098,11 +3098,11 @@ a.pulse-card:hover { border-color: var(--accent); transform: translateY(-2px); }
@@ -3098,11 +3098,11 @@ a.pulse-card:hover { border-color: var(--accent); transform: translateY(-2px); }
position: absolute; right: 4px; bottom: 4px;
position: absolute; right: 4px; bottom: 4px;
padding: 6px 8px; background: var(--accent-dark);
padding: 6px 8px; background: var(--accent-dark);
border: none; border-radius: var(--radius);
border: none; border-radius: var(--radius);
- color: var(--text-primary); font-size: 0.85rem;
+ color: var(--on-accent, #fff); font-size: 0.85rem;
cursor: pointer; transition: background var(--ov-dur-2, 0.15s);
cursor: pointer; transition: background var(--ov-dur-2, 0.15s);
z-index: 1;
z-index: 1;
}
}
-.chat-send-btn:hover { background: var(--accent); color: #000; }
+.chat-send-btn:hover { background: var(--accent-dark); color: var(--on-accent, #fff); filter: brightness(1.18); }
.chat-tools-row {
.chat-tools-row {
display: flex; gap: 4px; align-items: center;
display: flex; gap: 4px; align-items: center;
padding: 4px 0 0;
padding: 4px 0 0;
@@ -7766,7 +7766,6 @@ body.fabs-tucked .messenger-toggle, body.fabs-tucked .floating-chat-fab, body.fa
@@ -7766,7 +7766,6 @@ body.fabs-tucked .messenger-toggle, body.fabs-tucked .floating-chat-fab, body.fa
@media (hover: none) {
@media (hover: none) {
.stream-card:hover { transform: none; border-color: var(--border); box-shadow: none; }
.stream-card:hover { transform: none; border-color: var(--border); box-shadow: none; }
.paste-card:hover { transform: none; border-color: var(--border); box-shadow: none; }
.paste-card:hover { transform: none; border-color: var(--border); box-shadow: none; }
- .chat-send-btn:hover { background: var(--accent-dark); color: var(--text-primary); }
.btn:hover { filter: none; }
.btn:hover { filter: none; }
}
}
new file mode 100644
new file mode 100644
@@ -0,0 +1,41 @@
@@ -0,0 +1,41 @@
+/**
+ * The chat send button sits on an accent fill, so it takes the on-accent ink. It used to take
+ * `var(--text-primary)`, which is the theme's *page* ink: fine on the dark themes (near-white on
+ * #1d4ed8) and unreadable on the light ones, where daylight's #1a1a2e sat on #6d28d9 at 2.4:1
+ * (measured at 390 px, signed out, openvibe.live/chat). That is below even the 3:1 a UI icon needs.
+ *
+ * node test/send-button-ink.test.js
+ */
+'use strict';
+const assert = require('assert');
+const fs = require('fs');
+const path = require('path');
+
+const css = fs.readFileSync(path.join(__dirname, '..', 'public', 'css', 'style.css'), 'utf8');
+
+// Every rule that paints the send button: selector, then its declarations.
+const rules = [...css.matchAll(/([^{}]*\.chat-send-btn[^{}]*)\{([^{}]*)\}/g)]
+ .map(([, sel, body]) => ({ sel: sel.trim().split('\n').pop().trim(), body }))
+ .filter((r) => r.sel.startsWith('.chat-send-btn') || r.sel.includes('.chat-send-btn'));
+
+assert.ok(rules.length >= 2, `found the send button's rules (${rules.length})`);
+
+for (const r of rules) {
+ const color = (/(?:^|;|\s)color:\s*([^;]+)/.exec(r.body) || [])[1];
+ const overrides = /\.chat-send-btn/.test(r.sel) && !/^\.chat-send-btn(\.[\w-]+)?(:[\w-]+)?$/.test(r.sel.split(',')[0].trim());
+ if (!color || overrides) continue; // layout-only or a wider context rule
+ assert.ok(
+ /var\(--on-accent\b/.test(color),
+ `${r.sel}: "${color.trim()}" is the page ink; an accent fill takes var(--on-accent, #fff)`
+ );
+}
+
+// The touch-device block must not put the page ink back on the fill.
+const touch = /@media \(hover: none\) \{([\s\S]*?)\n\}/.exec(css);
+assert.ok(touch, 'the touch-device block is still there');
+assert.ok(
+ !/\.chat-send-btn:hover\s*\{[^}]*color:\s*var\(--text-primary\)/.test(touch[1]),
+ 'the touch-device hover rule still paints the page ink on the send button'
+);
+
+console.log(`send button ink: ${rules.length} rules take the on-accent ink`);