Userdesk
Home
  • 👋Welcome to Userdesk
  • Overview
    • 💡What we do
  • âš¡Product Guides
    • Training data
      • Sitemaps
        • Shopify Store
        • Gitbook
    • Chatbot configuration
      • Welcome message
      • Escalate to human
      • Missing response message
    • Add the Chatbot widget to your website
      • WordPress
      • Shopify
      • Webflow
      • Wix
      • Notion pages
      • Any Website
    • Slack integration
    • JavaScript Widget
    • Customize Widget CSS
    • Chat Widget Changelog
  • 📖API
    • Authentication
    • Create a conversation
    • Send a message
Powered by GitBook
On this page

Was this helpful?

  1. Product Guides

Customize Widget CSS

Use CSS to customize the look and feel of the widget

Available since widget version 1.10.0

In order to override the default CSS styles of the Chat bubble widget, the widget exposes a global function Userdesk.setCustomCSS(<css string>).

To globally update the text settings use

Userdesk.setCustomCSS(`
  * {
    letter-spacing: 0.05em;
  }
`)

To update the settings of the header use

Userdesk.setCustomCSS(`
  .userdesk-header {
    letter-spacing: 0.1em;
  }
`)

To reset the CSS settings use

Userdesk.setCustomCSS(``)

If you want to update multiple elements, you need to define all the styles.

For instance:

Userdesk.setCustomCSS(`
  * {
    letter-spacing: 0.05em;
  }

  .userdesk-header {
    letter-spacing: 0.1em;
  }
`)

CSS classes

These are the classes currently present

PreviousJavaScript WidgetNextChat Widget Changelog

Last updated 1 year ago

Was this helpful?

âš¡