Browse Source

Closes #910: make transparency of message bubbles overridable via CSS (#911)

* Closes #910: make transparency of message bubbles overridable via CSS

* Fix CSS variable declaration
pull/918/head
Aral Balkan 4 years ago committed by GitHub
parent
commit
2409cab5b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      webroot/js/utils/user-colors.js
  2. 6
      webroot/styles/chat.css

2
webroot/js/utils/user-colors.js

@ -8,7 +8,7 @@ export function messageBubbleColorForString(str) { @@ -8,7 +8,7 @@ export function messageBubbleColorForString(str) {
// Tweak these to adjust the result of the color
const saturation = 25;
const lightness = 45;
const alpha = 0.3;
const alpha = 'var(--message-background-alpha)';
const hue = parseInt(Math.abs(hash), 16) % 360;
return `hsla(${hue}, ${saturation}%, ${lightness}%, ${alpha})`;

6
webroot/styles/chat.css

@ -1,5 +1,11 @@ @@ -1,5 +1,11 @@
/* some base styles for chat and messaging components */
:root {
/* Override this in your custom CSS to change the
opacity of the message backgrounds. */
--message-background-alpha: 0.3;
}
#chat-container {
position: fixed;
z-index: 9;

Loading…
Cancel
Save