The date picker provides four independent sizing systems that can be controlled via attributes, plus complete theming via CSS custom properties.

Four Independent Systems:

  • input-size attribute - Controls input field size (floating mode only) New in v1.4.0
  • font-size attribute - Controls calendar text size only
  • spacing attribute - Controls calendar gaps, padding, margins only
  • cell-size attribute - Controls day cell dimensions and structural sizes only

All four systems use the same 5-level scale: xs, sm, md (default), lg, xl

Input Size (New in v1.4.0)

Control input field size independently from calendar size

Live Demo
Very compact input - 3.1rem (31px) height
Compact input - 3.3rem (33px) height
Normal input - 3.5rem (35px) height
Spacious input - 3.8rem (38px) height
Touch-friendly input - 4.1rem (41px) height
Code Examples
HTML
 
Details
New in v1.4.0

The input-size attribute controls the input field dimensions independently from calendar sizing.

Available Sizes
  • xs - 3.1rem / 31px (very compact)
  • sm - 3.3rem / 33px (compact)
  • md - 3.5rem / 35px (default)
  • lg - 3.8rem / 38px (spacious)
  • xl - 4.1rem / 41px (touch-friendly)
Use Cases
  • Floating mode only - This attribute applies to the input field in floating/popup mode
  • Coordinated sizing - Use same size for input and calendar for consistent UI
  • Mixed sizing - Large touch-friendly input with compact popup calendar
CSS Variables

Each size has corresponding CSS variables:

  • --drp-input-size-{size}-font
  • --drp-input-size-{size}-padding-v
  • --drp-input-size-{size}-padding-h
  • --drp-input-size-{size}-height
  • --drp-input-size-{size}-icon-size

Coordinated Input + Calendar Sizing

Combine input-size with calendar sizing for consistent UI

Live Demo
Compact input with compact calendar
Large input with large calendar
Large touch target, compact popup
Code
HTML
 
Details
Consistent UI

For consistent visual design, use the same size value across all four attributes.

Mixed Sizing Strategy

Sometimes you want different sizes for input and calendar:

  • Large input + compact calendar - Touch-friendly input that opens a space-efficient popup
  • Small input + large calendar - Compact form field with spacious date selection

Calendar Sizing Systems

Control font, spacing, and cell dimensions independently

Live Demo
Readable text in a tight layout with normal cells
Compact text with generous spacing and small cells
Maximum size for everything - very touch-friendly
Large readable text in ultra-compact layout
Code Examples
HTML - Independent Attributes
 
How It Works
Independence

Each system works independently - combine them any way you like!

  • Font Size: font-size="xs|sm|md|lg|xl" - Text size only
  • Spacing: spacing="xs|sm|md|lg|xl" - Gaps, padding, margins only
  • Cell Size: cell-size="xs|sm|md|lg|xl" - Day cell dimensions only
Scale Values
  • xs - 0.6× scale (60% of normal size)
  • sm - 0.8× scale (80% of normal size)
  • md - 1.0× scale (baseline, default)
  • lg - 1.5× scale (150% of normal size)
  • xl - 2.0× scale (200% of normal size)

Uniform Sizing

All three systems scaled together uniformly

Live Demo
No attributes needed for default size
Code Examples
HTML
 
Use Cases
When to Use Uniform Sizing
  • xs - Dense dashboards, data tables, compact layouts
  • sm - Mobile apps, modals, forms
  • md - Default size, general use
  • lg - Desktop applications, spacious layouts
  • xl - Touch interfaces, accessibility, presentations
Balanced Proportions

Using the same size for all three systems creates balanced, proportional calendars.

Compact Grid Layout

Dense dashboard calendar at 60% scale

Live Demo
Dense dashboard calendar
Code Example
HTML
 
Details
Use Case

Extra Small (xs) - Perfect for dense dashboards with limited space

Grid Layout Requirements

visible-months-count must equal grid-rows × grid-columns

Example: 2 rows × 3 columns = 6 months

Touch-Friendly 2×3 Grid (Large - 150%)

Large calendar with generous touch targets - ideal for touch interfaces and accessibility

Code
HTML
 
Perfect for: Touch interfaces, accessibility requirements, kiosks, and presentation mode where users need large, easy-to-tap targets.

CSS Custom Properties (Theming)

Customize colors, borders, and more with CSS variables

Available Variables
🆕 New in v1.3.0: Semantic Component Variables

Version 1.3.0 adds 60+ semantic CSS variables for component-specific customization. Each component (input, buttons, days, headers) now has dedicated variables for complete styling independence.

Total available: 90+ CSS custom properties

Base Color Variables
  • --drp-card-bg - Calendar background (#ffffff)
  • --drp-accent-color - Primary accent (#3b82f6)
  • --drp-accent-color-hover - Accent hover (#2563eb)
  • --drp-text-primary - Primary text (#111827)
  • --drp-text-secondary - Secondary text (#6b7280)
  • --drp-border-color - Border color (#e5e7eb)
  • --drp-primary-bg - Primary background (#f3f4f6)
  • --drp-primary-bg-hover - Primary hover (#e5e7eb)
Component-Specific Variables (New in v1.3.0)
  • Input: --drp-input-background, --drp-input-color, --drp-input-border-color, and 9 more
  • Buttons: --drp-button-today-color, --drp-button-apply-bg, and 8 more
  • Day Cells: --drp-day-text-color, --drp-day-selected-bg, and 10 more
  • Header/Nav: --drp-header-text-color, --drp-nav-bg-hover, and 14 more
  • Badges: --drp-badge-number-bg, --drp-badge-count-bg, and 4 more
Spacing Variables
  • --drp-spacing-xs - Extra small (0.25rem)
  • --drp-spacing-sm - Small (0.5rem)
  • --drp-spacing-md - Medium (1rem)
  • --drp-spacing-lg - Large (1.5rem)
  • --drp-spacing-xl - Extra large (2rem)
Typography Variables
  • --drp-font-size-base - Base font size (1rem)
  • --drp-font-size-sm - Small (0.875rem)
  • --drp-font-size-lg - Large (1.125rem)
  • --drp-font-weight-medium - Medium weight (500)
  • --drp-font-weight-semibold - Semibold (600)
Other Variables
  • --drp-border-radius - Border radius (0.375rem)
  • --drp-shadow-xl - Extra large shadow
  • --drp-transition-fast - Fast transition (150ms)

Complete list: See API Reference - CSS Custom Properties for all 90+ variables.

Code Examples
CSS
 
HTML
 
JavaScript
 
Component-Specific Variables (v1.3.0)
 
How to Use
How CSS Variables Work

The component defines all variables with :host inside its Shadow DOM. You can override them from outside:

  • Global - Target web-daterangepicker selector
  • Scoped - Add a class and target web-daterangepicker.your-class
  • Instance - Use inline styles (not recommended)
Benefits
  • Scoped - Theme individual pickers differently
  • Dynamic - Change themes at runtime with JavaScript
  • Maintainable - No need to modify component source
  • Performant - Browser-native CSS variable support
v1.3.0: Component Independence

The decoupled architecture means:

  • Independent styling - Customize inputs without affecting calendar
  • Component isolation - Change button colors without affecting day cells
  • Flexible theming - Override base OR semantic variables
  • Backwards compatible - All existing themes still work
Complete Documentation

See API.md - CSS Custom Properties for:

  • Full list of all 90+ variables
  • Default values for each variable
  • Dark theme example
  • Multiple theme switching

â„šī¸ Input Field Styling (Updated in v1.3.0)

v1.3.0 adds comprehensive input styling with the .drp-input class and 12 new CSS custom properties.


New Input Variables (v1.3.0)
  • --drp-input-background - Input background color
  • --drp-input-color - Input text color
  • --drp-input-border-color - Border color
  • --drp-input-border-color-hover - Border on hover
  • --drp-input-border-color-focus - Border when focused
  • --drp-input-placeholder-color - Placeholder text
  • --drp-input-focus-shadow-color - Focus ring color
Size Variants

Three size variants available: .drp-input--sm, default (md), and .drp-input--lg


Shadow DOM Limitation

The date picker uses Shadow DOM for style isolation. The <input> element lives in the light DOM (your page), while the calendar lives in the shadow DOM (component internals). Styles inside shadow DOM cannot reach out to style light DOM elements.

Styling Options

You have two options for styling the input:

Option 1: Override CSS variables (v1.3.0+)

CSS Variables (Recommended)
 

Option 2: Direct CSS styling

Direct CSS
 
Option 3: Provide Your Own Input

You can provide a pre-styled input element:

Custom Input
 
Framework Examples
Tailwind CSS:
Tailwind
 
Bootstrap:
Bootstrap
 

📚 Complete documentation: See the Known Limitations section in the API reference for detailed examples and workarounds.

Quick Reference

Sizing Attributes
AttributeValuesDefault
input-size v1.4.0xs, sm, md, lg, xlmd
font-sizexs, sm, md, lg, xlmd
spacingxs, sm, md, lg, xlmd
cell-sizexs, sm, md, lg, xlmd
Scale Values
SizeScalePercentage
xs0.6×60%
sm0.8×80%
md1.0×100%
lg1.5×150%
xl2.0×200%