Docs

Docs

menu-to-close

CSS tricks for Joinchat

Joinchat CSS Variables

Joinchat uses a few variables to modify its styles globally, so in general it’s better to change these variables instead of the specific CSS property.

VariableDefault valueWhat it does
--sep20px (6px mobile)Widget side spacing
--bottomvar(–sep)Widget bottom spacing
--s60pxFloating button size
--headerCalculated (–s * 1.6)Chat window header height
CSS size variables

Colors are calculated automatically from the color picker in Joinchat settings. The easiest way to change them is from there. But for more specific changes (for example, defining another hover color) these are the variables:

VariableDefault valueWhat it does
--chColor set in settingsHue
--csColor set in settingsColor saturation
--clColor set in settingsColor lightness
--hslCalculatedHSL package for reuse
--colorCalculatedMain color
--hoverCalculated (–color 20% lighter)Lighter variant for hover
--darkCalculated (–color 10% darker)Darker variant for dark mode
--bgCalculated (–color with 4% opacity)Chat window background
--msgCalculated (same as –color)Links, buttons, etc. color
--bwColor set in settingsWhite (1) or black (0) text
--textCalculated (–bw)Text color in buttons and header
CSS color/text variables

Customize the plugin with CSS styles

Change Joinchat’s appearance by adding some styles in your theme’s stylesheet or from Appearance > Customize > Additional CSS

You can combine several styles:

.joinchat {
 --bottom: 80px;
 --s: 52px;
}Code language: CSS (css)

To apply changes only on mobile devices, use “media queries”:

@media (max-width: 480px), (orientation: landscape) and (max-width: 767px) {
 .joinchat {
 --bottom: 80px;
 --s: 52px;
 }
}Code language: CSS (css)

👆 Move the floating button up

/* defaults: desktop 20px, mobile 6px */
.joinchat {
 --bottom: 80px;
}Code language: CSS (css)

🤏 Change the floating button size

/* default: 60px */
.joinchat {
 --s: 50px;
}Code language: CSS (css)

☝️ Place Joinchat above other elements

/* default: before v4.4 1000, after v4.4 9999, after v4.5.10 9000 */
.joinchat {
 z-index: 99999; 
}Code language: CSS (css)

📏 Change the chat header height

/* defaults: desktop 70px, mobile 55px */
.joinchat {
 --header: 60px;
}Code language: CSS (css)

🎨 Change the floating button color

/* default: #25d366 */
.joinchat__button {
 background-color: #999;
}Code language: CSS (css)

🌅 Keep the alternative image static

/* Starting from v6 this is done from settings */
.joinchat--show .joinchat__button__image {
 animation: none !important;
 opacity: 1 !important;
}Code language: CSS (css)

CSS tricks for Joinchat