timepicker-ui
4.5.0GitHub
timepicker-ui
API Reference / CSS Variables

CSS Variables

All 168 --tp-* variables in timepicker-ui 4.5.0, with their default values and the classes that read them.

The tables are generated from the CSS and JavaScript in the published package, so they match what you install. Set a variable on .tp-ui-wrapper to change every picker, or on .tp-ui-wrapper.my-picker with ui: { cssClass: 'my-picker' } to change one. Setting Variables has the full example, and Reading the Table explains the entries in each column.

Matches names, default values and the entries in Used by.

Group

168 of 168 variables

Color

VariableDefaultUsed by
--tp-bg#ece6ee.tp-ui-wheel-column-wrapper .tp-ui-wrapper
--tp-surface#e6e0e9.tp-ui-clock-face
--tp-surface-hover#c8b3fd.tp-ui-hour .tp-ui-minutes .tp-ui-seconds
2 more.tp-ui-timezone-dropdown .tp-ui-timezone-option
--tp-input-bg#e6e0e9.tp-ui-hour .tp-ui-minutes .tp-ui-seconds
1 more.tp-ui-timezone-dropdown
--tp-text#1d1b20.tp-ui-dots .tp-ui-hour .tp-ui-input-ripple-wrapper
7 more.tp-ui-minutes .tp-ui-range-tab .tp-ui-seconds .tp-ui-timezone-dropdown .tp-ui-timezone-selected .tp-ui-value-tips .tp-ui-value-tips-24h
--tp-text-secondary#49454f.tp-ui-hour-text .tp-ui-minute-text .tp-ui-range-tab-label
6 more.tp-ui-second-text .tp-ui-select-time .tp-ui-timezone-arrow .tp-ui-timezone-label .tp-ui-timezone-menu .tp-ui-timezone-selected
--tp-text-disabledhsla(0,1%,61%,.6).tp-ui-tips-disabled
--tp-text-type-time#49454f.tp-ui-wrapper-type-time
--tp-text-icon#4e545a.tp-ui-keyboard-icon .tp-ui-keyboard-icon-wrapper
--tp-am-pm-active#ffd8e4.tp-ui-am .tp-ui-pm
--tp-am-pm-text-selected#633b48.tp-ui-am .tp-ui-pm
--tp-am-pm-text-unselected#49454f.tp-ui-am .tp-ui-pm
--tp-primary#6750a4.tp-ui-am .tp-ui-cancel-btn .tp-ui-circle-hand
15 more.tp-ui-clear-btn .tp-ui-clock-face .tp-ui-clock-hand .tp-ui-dot .tp-ui-hour .tp-ui-keyboard-icon .tp-ui-minutes .tp-ui-ok-btn .tp-ui-pm .tp-ui-range-tab .tp-ui-range-tab-value .tp-ui-seconds .tp-ui-timezone-dropdown .tp-ui-timezone-option .tp-ui-wheel-column
--tp-on-primary#fff.tp-ui-value-tips .tp-ui-value-tips-24h
--tp-primary-container#eaddff.tp-ui-hour .tp-ui-minutes .tp-ui-seconds
1 more.tp-ui-timezone-option
--tp-on-primary-container#21005d.tp-ui-hour .tp-ui-input-ripple-wrapper .tp-ui-minutes
2 more.tp-ui-seconds .tp-ui-timezone-option
--tp-primary-rgb103,80,164Not read by the library
--tp-on-surface#1d1b20.tp-ui-range-tab-value
--tp-on-surface-variant#49454fNot read by the library
--tp-on-surface-rgb29,27,32Not read by the library
--tp-surface-container#f3edf7Not read by the library
--tp-outline-variant#cac4d0.tp-ui-modal .tp-ui-popover .tp-ui-wrapper
--tp-tertiary-container#ffd8e4Not read by the library
--tp-on-tertiary-container#633b48Not read by the library
--tp-border#000.tp-ui-am .tp-ui-pm
--tp-outline#6750a4.tp-ui-timezone-dropdown
--tp-hover-bg#d6d6d6Not read by the library
--tp-error#d50000.tp-ui-invalid-format .tp-ui-invalid-text
--tp-btn-textvar(--tp-primary)Fallback.tp-ui-cancel-btn .tp-ui-clear-btn .tp-ui-ok-btn
2 more.tp-ui-range-tab .tp-ui-range-tab-value

Typography

VariableDefaultUsed by
--tp-font-size-xs12px.tp-ui-select-time
--tp-font-size-sm12.8pxNot read by the library
--tp-font-size-base14pxNot read by the library
--tp-font-size-lg16px.tp-ui-wrapper-type-time
--tp-font-size-number17.6pxNot read by the library
--tp-font-size-xl51.2px.tp-ui-hour .tp-ui-minutes .tp-ui-seconds
--tp-font-size-seconds-12h36px.tp-ui-has-seconds .tp-ui-hour .tp-ui-minutes
2 more.tp-ui-seconds .tp-ui-wrapper-time
--tp-font-size-seconds-24h44px.tp-ui-has-seconds .tp-ui-hour .tp-ui-minutes
2 more.tp-ui-seconds .tp-ui-wrapper-time-24h
--tp-font-family"Roboto",sans-serifFallback.tp-ui-wrapper

Size

VariableDefaultUsed by
--tp-size-clock256pxNot read by the library
--tp-size-wrapper328pxNot read by the library
--tp-size-wrapper-expanded584pxNot read by the library
--tp-size-wrapper-portrait315pxNot read by the library
--tp-size-wrapper-landscape-height360pxNot read by the library
--tp-size-wrapper-mobile-height258pxNot read by the library
--tp-size-input96px.tp-ui-hour .tp-ui-input-wrapper .tp-ui-minutes
1 more.tp-ui-seconds
--tp-size-input-height80px.tp-ui-hour .tp-ui-input-ripple-wrapper .tp-ui-minutes
1 more.tp-ui-seconds
--tp-size-input-mobile72px.tp-ui-input-ripple-wrapper .tp-ui-input-wrapper
--tp-size-hand-circle46pxNot read by the library
--tp-size-hand-circle-small36pxNot read by the library
--tp-size-hand-width2pxNot read by the library
--tp-size-hand-offsetcalc(50% - 1px)Not read by the library
--tp-size-hand-top4pxNot read by the library
--tp-size-hand-left1pxNot read by the library
--tp-size-button-min44pxNot read by the library
--tp-size-dot6px.tp-ui-dots
--tp-size-dot-center8pxNot read by the library
--tp-size-am-pm-width52px.tp-ui-pm
--tp-size-am-pm-height40px.tp-ui-am .tp-ui-pm
--tp-size-am-pm-height-landscape44px.tp-ui-am .tp-ui-pm
--tp-size-icon24pxNot read by the library
--tp-size-colon-width24px.tp-ui-dots
--tp-size-colon-height48pxNot read by the library
--tp-size-input-seconds-12h64px.tp-ui-has-seconds .tp-ui-hour .tp-ui-input-wrapper
3 more.tp-ui-minutes .tp-ui-seconds .tp-ui-wrapper-time
--tp-size-input-seconds-12h-narrow58px.tp-ui-has-seconds .tp-ui-wrapper-time
--tp-size-colon-seconds-12h12px.tp-ui-dots .tp-ui-has-seconds .tp-ui-wrapper-time
--tp-size-input-seconds-24h80px.tp-ui-has-seconds .tp-ui-hour .tp-ui-input-wrapper
3 more.tp-ui-minutes .tp-ui-seconds .tp-ui-wrapper-time-24h
--tp-size-input-seconds-24h-narrow74px.tp-ui-has-seconds .tp-ui-wrapper-time-24h
--tp-size-colon-seconds-24h20px.tp-ui-dots .tp-ui-has-seconds .tp-ui-wrapper-time-24h
--tp-size-number32pxNot read by the library
--tp-size-inner-circle200pxNot read by the library
--tp-size-inline-min-height500px.tp-ui--inline .tp-ui-wrapper
--tp-size-padding10px.tp-ui-cancel-btn .tp-ui-clear-btn .tp-ui-hour
3 more.tp-ui-minutes .tp-ui-ok-btn .tp-ui-seconds

Spacing

VariableDefaultUsed by
--tp-spacing-xs4px.tp-ui-cancel-btn .tp-ui-compact-wheel-mode .tp-ui-wheel-column-wrapper
1 more.tp-ui-wheel-container
--tp-spacing-sm8px.tp-ui-keyboard-icon .tp-ui-keyboard-icon-wrapper .tp-ui-range-header
4 more.tp-ui-range-mode .tp-ui-range-tab .tp-ui-wheel-container .tp-ui-wheel-mode
--tp-spacing-md12px.tp-ui-compact-wheel-mode .tp-ui-range-header .tp-ui-range-mode
3 more.tp-ui-range-tab .tp-ui-wrapper .tp-ui-wrapper-type-time
--tp-spacing-lg16px.tp-ui-range-header .tp-ui-wheel-container .tp-ui-wheel-highlight
1 more.tp-ui-wrapper-time
--tp-spacing-xl24px.tp-ui-cancel-btn .tp-ui-clear-btn .tp-ui-footer
4 more.tp-ui-header .tp-ui-ok-btn .tp-ui-range-header .tp-ui-select-time
--tp-spacing-2xl36px.tp-ui-header
--tp-spacing-3xl48pxNot read by the library
--tp-gap-sm8pxNot read by the library
--tp-gap-md12pxNot read by the library
--tp-position-hidden-10000pxNot read by the library
--tp-scrollbar-gapNot setSet by the library at runtime

Shape

VariableDefaultUsed by
--tp-border-radius28px.tp-ui-modal .tp-ui-popover .tp-ui-wrapper
--tp-border-width1px.tp-ui-am .tp-ui-pm
--tp-border-width-thick2px.tp-ui-clock-face .tp-ui-hour .tp-ui-invalid-format
6 more.tp-ui-minutes .tp-ui-seconds .tp-ui-timezone-dropdown .tp-ui-timezone-option .tp-ui-wheel-highlight .tp-ui-wrapper
--tp-border-width-half0.3752px.tp-ui-am .tp-ui-pm
--tp-border-width-pm1.5008px.tp-ui-pm
--tp-radius-sm7px.tp-ui-am .tp-ui-pm .tp-ui-timezone-dropdown
1 more.tp-ui-wheel-column
--tp-radius-md8px.tp-ui--inline .tp-ui-hour .tp-ui-input-ripple-wrapper
7 more.tp-ui-input-wrapper .tp-ui-minutes .tp-ui-range-tab .tp-ui-seconds .tp-ui-timezone-menu .tp-ui-wheel-highlight .tp-ui-wrapper
--tp-radius-lg20px.tp-ui-cancel-btn .tp-ui-clear-btn .tp-ui-ok-btn
--tp-radius-circle50%.tp-ui-keyboard-icon-wrapper
--tp-radius-full100%Not read by the library
--tp-btn-radiusvar(--tp-radius-lg)Fallback.tp-ui-cancel-btn .tp-ui-clear-btn .tp-ui-ok-btn

Focus

VariableDefaultUsed by
--tp-outline-width2px.tp-ui-timezone-option
--tp-outline-width-thick3px.tp-ui-am .tp-ui-cancel-btn .tp-ui-clear-btn
11 more.tp-ui-clock-face .tp-ui-hour .tp-ui-keyboard-icon .tp-ui-minutes .tp-ui-ok-btn .tp-ui-pm .tp-ui-range-tab .tp-ui-seconds .tp-ui-timezone-dropdown .tp-ui-timezone-option .tp-ui-wheel-column
--tp-outline-width-contrast4px.tp-ui-am .tp-ui-cancel-btn .tp-ui-clear-btn
10 more.tp-ui-clock-face .tp-ui-hour .tp-ui-keyboard-icon .tp-ui-minutes .tp-ui-ok-btn .tp-ui-pm .tp-ui-range-tab .tp-ui-seconds .tp-ui-timezone-dropdown .tp-ui-wheel-column
--tp-outline-offset2px.tp-ui-am .tp-ui-cancel-btn .tp-ui-clear-btn
11 more.tp-ui-clock-face .tp-ui-hour .tp-ui-keyboard-icon .tp-ui-minutes .tp-ui-ok-btn .tp-ui-pm .tp-ui-range-tab .tp-ui-seconds .tp-ui-timezone-dropdown .tp-ui-timezone-option .tp-ui-wheel-column
--tp-shadow-focus0 0 0 4px rgba(98,0,238,.2)Not read by the library
--tp-shadow-focus-ringnoneFallback.tp-ui-am .tp-ui-cancel-btn .tp-ui-clear-btn
10 more.tp-ui-clock-face .tp-ui-hour .tp-ui-keyboard-icon .tp-ui-minutes .tp-ui-ok-btn .tp-ui-pm .tp-ui-range-tab .tp-ui-seconds .tp-ui-timezone-dropdown .tp-ui-wheel-column
--tp-focus-ringvar(--tp-primary)Fallback.tp-ui-am .tp-ui-cancel-btn .tp-ui-clear-btn
11 more.tp-ui-clock-face .tp-ui-hour .tp-ui-keyboard-icon .tp-ui-minutes .tp-ui-ok-btn .tp-ui-pm .tp-ui-range-tab .tp-ui-seconds .tp-ui-timezone-dropdown .tp-ui-timezone-option .tp-ui-wheel-column

Elevation

VariableDefaultUsed by
--tp-shadowunset.tp-ui-timezone-menu .tp-ui-wrapper
--tp-z-backdrop5000Not read by the library
--tp-z-modal5001Not read by the library
--tp-z-keyboard-icon10Not read by the library
--tp-z-hidden-9999Not read by the library
--tp-shadow-inline0 2px 8px rgba(0,0,0,.15)Not read by the library

Motion

VariableDefaultUsed by
--tp-duration-fast150ms.tp-ui-modal .tp-ui-range-tab-value .tp-ui-wheel-column-wrapper
2 more.tp-ui-wheel-item [data-md3-ripple]
--tp-duration-base200ms.tp-ui-modal .tp-ui-range-tab-value
--tp-duration-slow300ms.tp-ui-hour .tp-ui-minutes .tp-ui-seconds
2 more.tp-ui-view-switching .tp-ui-wrapper
--tp-duration-slower400msNot read by the library
--tp-duration-slowest450msNot read by the library
--tp-duration-animation350msNot read by the library
--tp-duration-ripple700ms[data-md3-ripple]
--tp-duration-ripple-fade500ms[data-md3-ripple]
--tp-duration-reduced0.01ms.tp-ui
--tp-easing-standardcubic-bezier(0.4,0,0.2,1).tp-ui-range-tab-value .tp-ui-wheel-column-wrapper .tp-ui-wheel-item
1 more[data-md3-ripple]
--tp-easing-deceleratecubic-bezier(0,0,0.2,1).tp-ui-modal .tp-ui-view-switching .tp-ui-wrapper
--tp-easing-acceleratecubic-bezier(0.4,0,1,1).tp-ui-modal
--tp-easing-easeease.tp-ui-hour .tp-ui-minutes .tp-ui-seconds
--tp-easing-linearlinear[data-md3-ripple]

State

VariableDefaultUsed by
--tp-opacity-hover0.08Not read by the library
--tp-opacity-focus0.12Not read by the library
--tp-opacity-active0.16Not read by the library
--tp-opacity-disabled0.38.tp-ui-ok-btn .tp-ui-range-mode .tp-ui-range-tab
--tp-state-hover-opacity0.08[data-md3-ripple]
--tp-state-focus-opacity0.1.tp-ui-keyboard-icon-wrapper [data-md3-ripple]
--tp-state-pressed-opacity0.1[data-md3-ripple]
--tp-ripple-opacity1[data-md3-ripple]

Backdrop

VariableDefaultUsed by
--tp-backdroprgba(0,0,0,.5)Not read by the library
--tp-backdrop-filterunset.tp-ui-modal
--tp-opacity-backdrop0.6Not read by the library

Wheel

VariableDefaultUsed by
--tp-wheel-item-height44px.tp-ui-compact-wheel-mode .tp-ui-wheel-column-wrapper .tp-ui-wheel-container
3 more.tp-ui-wheel-highlight .tp-ui-wheel-item .tp-ui-wheel-padding
--tp-wheel-visible-items5.tp-ui-wheel-column-wrapper .tp-ui-wheel-container
--tp-wheel-column-width76px.tp-ui-wheel-column-wrapper
--tp-wheel-separator-width20px.tp-ui-wheel-separator
--tp-wheel-column-width-seconds64px.tp-ui-has-seconds .tp-ui-wheel-container
--tp-wheel-separator-width-seconds16px.tp-ui-has-seconds .tp-ui-wheel-container
--tp-wheel-landscape-footer-offset72px.tp-ui-mobile-clock-wrapper .tp-ui-wheel-mode
--tp-wheel-landscape-compact-width360px.tp-ui-compact-wheel-mode .tp-ui-wrapper
--tp-wheel-landscape-compact-visible-items3.tp-ui-compact-wheel-mode .tp-ui-wheel-column-wrapper .tp-ui-wheel-container
--tp-wheel-highlight-bgvar(--tp-primary-container,rgba(103,80,164,.08)).tp-ui-wheel-highlight
--tp-wheel-highlight-bordervar(--tp-outline-variant,rgba(0,0,0,.12)).tp-ui-wheel-highlight
--tp-wheel-text-colorvar(--tp-on-surface,#1d1b20).tp-ui-wheel-item .tp-ui-wheel-separator
--tp-wheel-selected-colorvar(--tp-primary,#6750a4).tp-ui-wheel-item
--tp-wheel-disabled-opacityvar(--tp-opacity-disabled,0.38).tp-ui-wheel-item
--tp-wheel-font-sizevar(--tp-font-size-lg,16px).tp-ui-wheel-item
--tp-wheel-selected-font-size22px.tp-ui-wheel-separator
--tp-wheel-highlight-radiusvar(--tp-radius-md)Fallback.tp-ui-wheel-highlight
--tp-wheel-fade-opacity.6Fallback.tp-ui-wheel-column-wrapper
--tp-wheel-ampm-column-width64pxFallback.tp-ui-wheel-ampm .tp-ui-wheel-column-wrapper

Popover

VariableDefaultUsed by
--tp-popover-gap4px.tp-ui-modal .tp-ui-popover .tp-ui-popover-anchored
--tp-popover-edge-margin4px.tp-ui-modal .tp-ui-popover .tp-ui-popover-anchored
--tp-popover-min-width260px.tp-ui-modal .tp-ui-popover .tp-ui-popover-anchored
--tp-popover-max-width328px.tp-ui-modal .tp-ui-popover .tp-ui-popover-anchored
--tp-popover-shadow0 4px 24px rgba(0,0,0,.15).tp-ui-modal .tp-ui-popover .tp-ui-wrapper
--tp-popover-spanspan-right.tp-ui-modal .tp-ui-popover .tp-ui-popover-anchored
--tp-popover-anchorNot set.tp-ui-modal .tp-ui-popover .tp-ui-popover-anchoredSet by the library at runtime
--tp-popover-radiusvar(--tp-border-radius)Fallback.tp-ui-modal .tp-ui-popover .tp-ui-wrapper
--tp-popover-available-heightNot set.tp-ui-modal .tp-ui-popover-constrained .tp-ui-wrapperSet by the library at runtime

Range

VariableDefaultUsed by
--tp-range-tab-value-font-size-seconds14px.tp-ui-has-seconds .tp-ui-range-tab-value

Timezone

VariableDefaultUsed by
--tp-dropdown-option-bg#fff.tp-ui-timezone-menu
--tp-dropdown-option-text#000.tp-ui-timezone-option
--tp-dropdown-option-hover-textvar(--tp-dropdown-option-text)Fallback.tp-ui-timezone-option

Mobile

VariableDefaultUsed by
--tp-mobile-landscape-width328px.tp-ui-wrapper
--tp-mobile-landscape-height258px.tp-ui-wrapper
--tp-mobile-landscape-height-range287px.tp-ui-range-mode .tp-ui-wrapper
--tp-mobile-landscape-height-timezone326px.tp-ui-tz-mode .tp-ui-wrapper

Setting Variables

#

Most defaults are declared on :root. The built-in themes other than basic set their own values on the modal through its data-theme attribute, which overrides :root. A value you set on .tp-ui-wrapper applies inside the panel with any theme.

index.css
/* Every picker */
.tp-ui-wrapper {
--tp-primary: #0b57d0;
}
/* One picker, created with ui: { cssClass: 'my-picker' } */
.tp-ui-wrapper.my-picker {
--tp-primary: #b3261e;
--tp-border-radius: 8px;
}
index.ts
import { TimepickerUI } from 'timepicker-ui';
import 'timepicker-ui/main.css';
const picker = new TimepickerUI('#time', {
ui: { cssClass: 'my-picker' },
});
picker.create();

A variable reaches only the element you set it on and the elements inside it. .tp-ui-wrapper sits inside .tp-ui-modal. When Used by lists .tp-ui-modal, a rule may read the variable on the modal itself, where a value on the wrapper does not reach. Set those variables on .tp-ui-modal or :root.

CSS Classes shows which element each class belongs to. Custom Styling has complete themes and covers the focus ring and the ripple.

Reading the Table

#

Default is the value in main.css, which the basic theme uses. Hex, rgb() and hsl() values have a color swatch. Used by lists the classes named in the rules that read the variable. Other entries in these two columns:

A class, such as .tp-ui-hour
A rule that names this class reads the variable. A row shows three entries and puts the rest under "more".
An attribute in brackets
A rule that matches the attribute, not a class, reads the variable. [data-md3-ripple] is on the controls that have the ripple and state layer.
Set by the library at runtime
The picker writes the value as an inline style while it is open, which replaces a value from your stylesheet. You can still read it in your own CSS.
Not read by the library
The stylesheet declares it, but no rule reads it and the picker does not set it. Changing it has no visible effect in this version.
Fallback
The stylesheet does not declare the variable. The value shown is the fallback written in the var() that reads it, and it applies until you set the variable.
Not set
The stylesheet gives the variable no value.

Variables that change nothing

In 4.5.0, no rule reads these variables, so setting them has no effect:

  • --tp-z-modal and --tp-z-backdrop. The stylesheet sets z-index: 5000 on .tp-ui-modal and 5001 on .tp-ui-wrapper. To change the stacking order, set z-index on .tp-ui-modal as shown in Troubleshooting.
  • --tp-backdrop and --tp-opacity-backdrop. The backdrop color is set on .tp-ui-modal itself. Set its background-color to change it.
  • --tp-hover-bg. The hover background of the time fields and the timezone list comes from --tp-surface-hover.
  • --tp-radius, which some theme files set. The panel corners come from --tp-border-radius.
Esc