Overriding Dark/Light Theme
By default, the UI uses the system color-scheme (dark or light). This may not suit your application though, so you can force either dark or light using thecolor-scheme CSS property. For example, the styles below will force light mode.
Direct CSS Properties
Some CSS properties can be set directly on thecorti-dictation component and will affect the component’s :host element, similar to how color-scheme works. These include inherited properties that affect the host:
Using CSS Variables
For more control in customization of the UI component, you can redefine the variables inside a global CSS file or within a<style> tag. Note, the following CSS variables may change over time.
Available Styling Variables
Component Defaults
Card Styling
Action Buttons
Customizing with Shadow DOM
Important: Due to Shadow DOM encapsulation, you cannot use CSS selectors likecorti-dictation button from outside the component. Shadow DOM prevents external styles from penetrating into the component’s internal structure. The component does not expose CSS parts (part attributes), so ::part() selectors are not available.
If you need to style internal elements beyond what CSS custom properties allow, you must access the Shadow DOM directly. Element IDs and internal structure can change at any time though, so you should only consider this in very specific situations. If you need to access nested elements, you’ll need to traverse multiple shadow roots:
Using Individual Components
If you use the individual Dictation components (likedictation-recording-button, dictation-settings-menu, dictation-device-selector, dictation-language-selector) directly instead of the corti-dictation wrapper, you can still set CSS properties directly on them (similar to color-scheme), and use CSS custom properties. However, you cannot use CSS selectors like dictation-recording-button button because these components also use Shadow DOM.
See also
- Overview — installation and quickstart
- API Reference — full property tables for all components