Styling your own Web Component

Theme & Core Colors

  • --bbc-color-primary β†’ Used in buttons, links, texts and more to hightlight and emphasize.

  • --bbc-color-secondary β†’ Used for hints, descriptions and subtitles.

  • --bbc-color-theme β†’ Used as the app-wide default background.

  • --bbc-icon-hover-color β†’ Used for icon color on hover.

  • --bbc-button-hover-bg-color β†’ Used for button background on hover.

  • --bbc-button-hover-text-color β†’ Used for button text color on hover.


  • --bbc-sidebar-bg-color β†’ Sidebar background color

  • --bbc-sidebar-text-color β†’ Sidebar text color

  • --bbc-sidebar-font-size β†’ Sidebar font size

  • --bbc-sidebar-font-weight β†’ Sidebar font weight

  • --bbc-sidebar-font-family β†’ Sidebar font family

Sidebar active item
  • --bbc-sidebar-active-item-bg-color β†’ Active-item background in sidebar


Top Bar

Top bar

You can hide the top bar using the hideTopbar parameter.

  • --bbc-top-bar-text-color β†’ Top bar text color

  • --bbc-top-bar-bg-color β†’ Top bar background color

  • --bbc-top-bar-font-family β†’ Top bar font family

  • --bbc-top-bar-font-weight β†’ Top bar font weight

  • --bbc-top-bar-font-size β†’ Top bar font size

Message Citation

Message citation
  • --bbc-msg-citation-text-color β†’ Citation text color

  • --bbc-msg-citation-bg-color β†’ Citation background color

  • --bbc-msg-citation-font-family β†’ Citation font family

  • --bbc-msg-citation-font-size β†’ Citation font size

  • --bbc-msg-citation-font-weight β†’ Citation font weight

  • --bbc-msg-citation-py β†’ Citation vertical padding

  • --bbc-msg-citation-px β†’ Citation horizontal padding

  • --bbc-msg-timestamp-color: #007b5e; β€” sets the color for all message timestamps


Desktop Messages

  • Bot message

    • --bbc-bot-msg-bg-color β†’ Bot-message background

    • --bbc-bot-msg-text-color β†’ Bot-message text color

    • --bbc-bot-msg-font-family β†’ Bot font family

    • --bbc-bot-msg-font-size β†’ Bot font size

    • --bbc-bot-msg-font-weight β†’ Bot font weight

    • --bbc-bot-msg-py β†’ Bot vertical padding

    • --bbc-bot-msg-px β†’ Bot horizontal padding

  • User message

    • --bbc-user-msg-bg-color β†’ User-message background

    • --bbc-user-msg-text-color β†’ User-message text color

    • --bbc-user-msg-font-family β†’ User font family

    • --bbc-user-msg-font-size β†’ User font size

    • --bbc-user-msg-font-weight β†’ User font weight

    • --bbc-user-msg-py β†’ User vertical padding

    • --bbc-user-msg-px β†’ User horizontal padding


Document Layout

  • Title

    • --bbc-document-title-font-size β†’ Title font size

    • --bbc-document-title-font-weight β†’ Title font weight

    • --bbc-document-title-text-color β†’ Title text color

  • Chunk

    • --bbc-document-chunk-text-color β†’ Chunk text color

    • --bbc-document-chunk-bg-color β†’ Chunk background color

    • --bbc-document-chunk-border-color: #007b5e; β€” controls the left‑border color of document chunks


Reference List & Cards

  • List Title

    • --bbc-ref-list-title-font-size β†’ List title font size

    • --bbc-ref-list-title-font-weight β†’ List title font weight

    • --bbc-ref-list-title-text-color β†’ List title text color

  • Card

    • --bbc-ref-list-card-border-color β†’ Card border color

    • --bbc-ref-list-card-border-radius β†’ Card corner radius

    • --bbc-ref-list-card-text-color β†’ Card text color

    • --bbc-ref-list-card-bg-gradient-start β†’ Card gradient start

    • --bbc-ref-list-card-bg-gradient-stop β†’ Card gradient end

    • --bbc-ref-list-card-icon-bg-color β†’ Card-icon background


Example Usage

    <blockbrain-main
    style="
        /* Theme & Core */
        --bbc-color-primary: #007b5e;
        --bbc-color-hover: #007b5e;
        --bbc-color-theme: #f3f4f6;

        /* Sidebar */
        --bbc-color-sidebar-bg: #ffffff;
        --bbc-color-sidebar-active-item-bg: #f5f9ff;

        /* Citation */
        --bbc-msg-citation-text-color: #000000;
        --bbc-msg-citation-font-weight: bold;

        /* Mobile Messages */
        --bbc-bot-msg-sm-bg-color: #f2f2f2;
        --bbc-user-msg-sm-bg-color: #007b5e;
        --bbc-user-msg-sm-text-color: #f2f2f2;
        --bbc-user-msg-sm-px: 4px;
        --bbc-bot-msg-sm-px: 4px;
        --bbc-msg-timestamp-color: #007b5e;

        /* Document */
        --bbc-document-title-text-color: #313131;
        --bbc-document-chunk-bg-color: #f2f2f2;
        --bbc-document-chunk-border-color: #007b5e;

        /* Reference List */
        --bbc-ref-list-title-text-color: #7f7f7f;
        --bbc-ref-list-title-font-weight: 500;
        --bbc-ref-list-card-border-color: #d9d9d9;
        --bbc-ref-list-card-bg-gradient-start: #f2f2f2;
        --bbc-ref-list-card-bg-gradient-stop: #ffffff;
        --bbc-ref-list-card-icon-bg-color: #007b5e;
    "
    layout="compact"
    width="100%"
    height="90vh"
    hideTopbar
    ...
></blockbrain-main>

Last updated