Overview

The MultiSelect component provides 125+ semantic CSS variables for complete visual customization, built on a semantic color system with accent and neutral color scales. All variables use the --ml- prefix to avoid naming conflicts.

Variables are applied inside the Shadow DOM, ensuring style encapsulation while allowing you to customize appearance through CSS variable inheritance.

How to Customize

CSS Approach

 

SCSS Approach (Recommended)

 

SCSS Color Palette

The component uses a semantic three-tier variable system: base primitivessemantic color scalescomponent variables. This allows you to customize the entire color scheme by overriding just the semantic colors.

Accent Colors

Primary/accent colors for interactive elements, selected states, and highlights:

SCSS VariableDefaultDescription
$ml-color-accent-lightest#eff6ffLightest accent shade - badge backgrounds
$ml-color-accent-lighter#e0f2feLighter accent shade - hover states
$ml-color-accent-base#3b82f6Base accent color - primary actions
$ml-color-accent-dark#2563ebDark accent shade - hover/active states
$ml-color-accent-darker#1d4ed8Darkest accent shade - pressed states

Neutral Colors

Grayscale colors for borders, backgrounds, and text:

SCSS VariableDefaultDescription
$ml-color-white#ffffffPure white - backgrounds
$ml-color-neutral-lightest#f9fafbLightest neutral - hover backgrounds
$ml-color-neutral-lighter#f3f4f6Lighter neutral - subtle backgrounds
$ml-color-neutral-light#e5e7ebLight neutral - borders, dividers
$ml-color-neutral-base#d1d5dbBase neutral - inactive elements
$ml-color-neutral-dark#6b7280Dark neutral - secondary text, placeholders
$ml-color-neutral-darkest#111827Darkest neutral - primary text

💡 Customization Example

 

Input Component

Variables controlling the main input/trigger area:

VariableDefaultDescription
--ml-input-bg#fffBackground color
--ml-input-color#212529Text color
--ml-input-border-color#dee2e6Border color
--ml-input-border-width1pxBorder width
--ml-input-border-radius0.375remBorder radius
--ml-input-padding0.5rem 0.75remInner padding
--ml-input-font-size1remFont size
--ml-input-line-height1.5Line height
--ml-input-placeholder-color#6c757dPlaceholder text color
--ml-input-disabled-bg#e9ecefBackground when disabled
--ml-input-disabled-color#6c757dText color when disabled

Focus State

Variables for the focused input state:

VariableDefaultDescription
--ml-input-focus-border-color#86b7feBorder color when focused
--ml-input-focus-shadow0 0 0 0.25rem rgba(13, 110, 253, 0.25)Box shadow when focused
--ml-input-focus-bg#fffBackground when focused

Dropdown

Variables controlling the dropdown menu appearance:

VariableDefaultDescription
--ml-dropdown-bg#fffBackground color
--ml-dropdown-border-color#dee2e6Border color
--ml-dropdown-border-width1pxBorder width
--ml-dropdown-border-radius0.375remBorder radius
--ml-dropdown-shadow0 0.5rem 1rem rgba(0, 0, 0, 0.15)Box shadow
--ml-options-max-height20remMaximum height
--ml-dropdown-z-index1000Z-index stacking
--ml-dropdown-padding0.5rem 0Inner padding

Options

Variables for individual option items in the dropdown:

VariableDefaultDescription
--ml-option-padding0.5rem 0.75remOption padding
--ml-option-font-size1remFont size
--ml-option-line-height1.5Line height
--ml-option-color#212529Text color
--ml-option-bgtransparentBackground color
--ml-option-hover-bg#f8f9faBackground on hover
--ml-option-hover-color#212529Text color on hover
--ml-option-selected-bg#0d6efdBackground when selected
--ml-option-selected-color#fffText color when selected
--ml-option-disabled-color#6c757dText color when disabled
--ml-option-disabled-bgtransparentBackground when disabled
--ml-option-disabled-opacity0.5Opacity when disabled

Option Subtitle

VariableDefaultDescription
--ml-option-subtitle-color#6c757dSubtitle text color
--ml-option-subtitle-font-size0.875remSubtitle font size
--ml-option-subtitle-margin0.25rem 0 0 0Subtitle margin

Option Icon

VariableDefaultDescription
--ml-option-icon-size1.25remIcon size
--ml-option-icon-margin0 0.5rem 0 0Icon margin

Pills (Selected Items)

Variables for the pill badges showing selected items:

VariableDefaultDescription
--ml-badge-bg#e9ecefBackground color
--ml-badge-color#212529Text color
--ml-badge-border-radius0.25remBorder radius
--ml-badge-padding0.25rem 0.5remPadding
--ml-badge-font-size0.875remFont size
--ml-badge-gap0.5remGap between pills
--ml-badge-margin0.25rem 0Margin around pill container

Pill Remove Button

VariableDefaultDescription
--ml-badge-remove-color#212529Remove button color
--ml-badge-remove-hover-bg#dc3545Background on hover
--ml-badge-remove-hover-color#fffColor on hover
--ml-badge-remove-size1remButton size
--ml-badge-remove-margin0 0 0 0.25remButton margin

Groups

Variables for grouped option headers:

VariableDefaultDescription
--ml-group-header-bg#f8f9faBackground color
--ml-group-header-color#6c757dText color
--ml-group-header-padding0.5rem 0.75remPadding
--ml-group-header-font-size0.875remFont size
--ml-group-header-font-weight600Font weight
--ml-group-header-text-transformuppercaseText transform
--ml-group-header-border-bottom1px solid #dee2e6Bottom border

Actions (Select All / Clear All)

Variables for action buttons:

VariableDefaultDescription
--ml-actions-padding0.5rem 0.75remContainer padding
--ml-actions-bg#fffBackground color
--ml-actions-border-bottom1px solid #dee2e6Bottom border
--ml-actions-gap0.5remGap between buttons
--ml-action-btn-color#0d6efdButton text color
--ml-action-btn-hover-color#0a58caButton hover color
--ml-action-btn-font-size0.875remButton font size

Search Input

Variables specific to the search/filter input:

VariableDefaultDescription
--ml-search-padding0.5rem 0.75remPadding
--ml-search-bordernoneBorder
--ml-search-font-size1remFont size
--ml-search-hint-color#6c757dHint text color
--ml-search-hint-font-size0.875remHint font size

Counter

Variables for the selection counter:

VariableDefaultDescription
--ml-counter-bg#0d6efdBackground color
--ml-counter-color#fffText color
--ml-counter-font-size0.75remFont size
--ml-counter-padding0.25rem 0.5remPadding
--ml-counter-border-radius0.25remBorder radius

Toggle Icon

Variables for the dropdown toggle icon:

VariableDefaultDescription
--ml-toggle-icon-color#6c757dIcon color
--ml-toggle-icon-size1remIcon size
--ml-toggle-icon-margin0 0 0 0.5remIcon margin

Checkboxes

Variables for option checkboxes:

VariableDefaultDescription
--ml-checkbox-size1remCheckbox size
--ml-checkbox-border-color#dee2e6Border color
--ml-checkbox-checked-bg#0d6efdBackground when checked
--ml-checkbox-checked-border#0d6efdBorder when checked
--ml-checkbox-margin0 0.5rem 0 0Checkbox margin

Loading & Empty States

Variables for loading and empty state messages:

VariableDefaultDescription
--ml-empty-color#6c757dEmpty state text color
--ml-empty-font-size0.875remEmpty state font size
--ml-empty-padding1rem 0.75remEmpty state padding
--ml-loading-color#6c757dLoading text color
--ml-loading-font-size0.875remLoading font size

Complete Theming Examples

Success Theme

Success Theme CSS
 

Dark Theme

Dark Theme CSS
 

Minimal Theme

Minimal Theme CSS
 

Compact Theme

Compact Theme CSS
 

SCSS Integration

For advanced customization, import the SCSS source and override semantic color variables. Use the modern @use syntax (recommended) instead of deprecated @import:

SCSS Configuration
 
⚠️ Note: The @import syntax is deprecated in Dart Sass and will be removed in version 3.0. Use @use for future-proof code.

🎨 Styling Best Practices

  • CSS Variables: All variables use --ml- prefix to prevent naming conflicts
  • Shadow DOM: Variables are inherited into Shadow DOM - set on the component or ancestor
  • Cascading: More specific selectors override global :root declarations
  • SCSS Source: For build-time customization, import SCSS and override variables before compilation
  • Responsive: Use CSS media queries to adjust variables for different screen sizes
  • Accessibility: Maintain sufficient color contrast ratios (WCAG AA: 4.5:1 for normal text)
  • Performance: CSS variables have negligible performance impact compared to dynamic styles