Skip to content

Theming ​

Light and dark ​

The picker follows the color-scheme of the page. It picks it up from:

Page usesResult
data-fdp-theme="dark", "light" or "auto" on any ancestorthat theme
Bootstrap data-bs-theme="dark" / "light"that theme
data-theme="dark" / "light"that theme
.dark class on <html> (Tailwind, VitePress)dark
CSS color-schemethat theme
nothinglight

The nearest ancestor wins, so a light card inside a dark page works.

Custom properties ​

Every colour and size is a CSS custom property declared with zero specificity, so you can override it anywhere: on :root, on a wrapper, or inline on the input.

css
:root {
  --fdp-cap-bg: #673de6;
  --fdp-cap-text: #fff;
  --fdp-band-bg: light-dark(#ede7fd, #2d2347);
}
html
<input type="date" style="--fdp-radius: 0.5em" data-flow-datepicker>

Colours ​

PropertyUsed for
--fdp-popover-bgpopover background
--fdp-field-bgfield background
--fdp-field-border, --fdp-field-border-focusfield border
--fdp-focus-ringsoft ring around a focused field
--fdp-outlinekeyboard focus outline
--fdp-lineborders and dividers
--fdp-text, --fdp-muted, --fdp-disabledtext
--fdp-hover-bghovered rows and days
--fdp-selected-bgselected preset, focused time part
--fdp-band-bgrange band
--fdp-cap-bg, --fdp-cap-textselected day circle
--fdp-dangerinvalid field border
--fdp-shadowpopover shadow

Use light-dark(light, dark) to set both themes at once.

Sizes ​

Sizes are in em of --fdp-font-size (default 0.875rem), so changing that one value scales the whole popover.

PropertyDefault
--fdp-font-size0.875rem
--fdp-field-width, --fdp-field-height, --fdp-field-pad100%, 2.5em, 0.75em
--fdp-radiuspopover corner radius
--fdp-control-radius, --fdp-row-radius, --fdp-band-radiusfield, rows, band
--fdp-day-size, --fdp-day-column, --fdp-row-gapcalendar grid
--fdp-month-gap, --fdp-month-paddingtwo-month layout
--fdp-pill-heightpill trigger
--fdp-presets-width, --fdp-preset-heightpresets list
--fdp-time-height, --fdp-meridiem-widthtime row

Layout classes ​

Width and margin classes on the input (w-50, mb-3, col-6) and inline width / margin are copied to the picker.

Released under the MIT License.