Dynamic styling

Overview

Update the CSS of Odyssey UI elements using Odyssey's MessageChannel API. Simply provide a selector string to the desired element, accompanied by an array of styling changes to be applied. Using this powerful feature you can rebrand tooltips, move collaboration UI to different locations, change the mouse cursor, and customize the look and feel of Odyssey to however you like.

To apply custom styling, initiate a message with type === "update-document-style". Include a data property with elementSelector specifying the target element by its string identifier. Additionally, provide a styleUpdates array, containing objects with both a property and value field. property defines the CSS property to modify and value indicates the desired styling value.

Example payloads

Update cursor

{
  "type": "update-document-style",
  "data": {
    "elementSelector": "#player",
    "styleUpdates": [
      {"property": "cursor", "value": "pointer"},
    ]
  }
}

Update button background and text color

{
  "type": "update-document-style",
  "data": {
    "elementSelector": ".app-button",
    "styleUpdates": [
      {"property": "background", "value": "#000000"},
      {"property": "color", "value": "#FFFFFF"},
    ]
  }
}

Last updated