Global CSS Classes
DayFlow provides a set of CSS classes with the df- prefix that allow you to customize the appearance of calendar components. These classes are designed for easy styling customization without modifying the core library.
Choosing the Right CSS Entry
Choose the stylesheet based on whether your app already uses Tailwind CSS:
| Entry | Includes | Use when |
|---|---|---|
styles.css | Full bundle including Tailwind preflight | You are not using Tailwind |
styles.components.css | Component styles only, without CSS reset | You already use Tailwind |
@import '@dayflow/core/dist/styles.components.css';
@import 'tailwindcss';For theme overrides, prefer --df-color-* variables or the stable df-* semantic classes documented below.
Table of Contents
- Common Classes
- Semantic Utility Classes
- Layout & Motion Helpers
- Day View Classes
- Week View Classes
- Month View Classes
- Year View Classes
- Mini Calendar Classes
- Sidebar Classes
- Navigation Classes
- Event Detail Classes
- Content Slot Classes
- Event State Attributes
Common
Common CSS classes used across all calendar views.
| Class Name | Description |
|---|---|
df-calendar-container | Outer root container for the Sidebar and Calendar; supports --df-calendar-height. |
df-calendar | Main calendar container (includes header and view content) |
df-header | Calendar header section (includes title, today button, and view switcher) |
df-header-left | Left section of the header (title and navigation buttons) |
df-header-mid | Middle section of the header (current date range title) |
df-header-right | Right section of the header (view switcher and search) |
df-navigation | Navigation controls container |
df-view-header-container | Shared container used by the secondary view header area |
df-view-header-title | Shared title text class used in view-level headers |
df-view-header-subtitle | Shared subtitle text class used in view-level headers |
df-event | Base class for all events |
df-event-title | Event title text |
df-event-time | Event time text |
df-event-color-bar | Colored bar on the left side of events (Day/Week view) |
df-month-event-color-bar | Colored indicator for regular events (Month view) |
df-all-day-row | All-day event row container |
df-all-day-label | All-day label text |
df-all-day-content | All-day event content area |
df-all-day-cell | Individual all-day event cell |
df-date-number | Date number display |
df-current-time-line | Current time indicator line container |
df-current-time-label | Current time label text |
df-current-time-bar | Current time horizontal line |
df-calendar-checkbox | Shared checkbox style used by calendar lists and related controls |
df-portal | Root scope class used by floating overlays rendered with portals |
df-range-picker | Root scope class used by the range picker popup and trigger wrapper |
Semantic Utility Classes
DayFlow now exposes a stable set of df-* semantic classes for internal states such as selected buttons, highlighted dates, destructive actions, and focus rings. These are defined inside the shared foundation CSS and are safe to target from your own stylesheet.
Use these classes when you want to align custom content, plugin UI, or content-slot output with DayFlow's theme tokens:
| Class Name | Purpose |
|---|---|
df-fill-primary | Primary filled background + matching foreground text |
df-fill-secondary | Secondary filled background + matching foreground text |
df-fill-destructive | Destructive filled background + matching foreground text |
df-tint-primary | Primary 10% tint + primary text |
df-tint-primary-md | Primary 20% tint + primary text |
df-tint-primary-lg | Primary 30% tint + primary text |
df-hover-primary | Primary-tinted hover state |
df-hover-primary-md | Stronger primary-tinted hover state |
df-hover-primary-solid | Solid primary hover state for filled buttons |
df-hover-base | Default hover background using DayFlow's hover token |
df-hover-muted | Muted hover background |
df-hover-destructive | Destructive hover state |
df-text-primary | Primary text color |
df-text-muted | Muted text color |
df-text-primary-fg | Text color for primary-filled backgrounds |
df-text-secondary-fg | Text color for secondary-filled backgrounds |
df-text-destructive | Destructive text color |
df-text-destructive-fg | Text color for destructive-filled backgrounds |
df-bg-base | Base surface background |
df-bg-card | Card surface background |
df-bg-sidebar | Sidebar-style muted background |
df-bg-secondary | Secondary muted background |
df-bg-tertiary | Tertiary background / divider surface |
df-border-base | Base border |
df-border-light | Lighter / softer border |
df-border-strong | Strong border using the primary token |
df-border-primary | Primary border color |
df-border-primary-soft | Softer primary border color |
df-ring-primary | Primary focus/selection ring color |
df-ring-primary-solid | Solid primary ring color |
df-shadow-sm | Small elevation shadow |
df-shadow-md | Medium elevation shadow |
df-shadow-primary | Primary shadow color token |
df-focus-ring | Combined primary border-color + ring-color on :focus |
df-focus-ring-only | Primary ring-color on :focus without changing border color |
df-focus-border-primary | Primary border-color on :focus only |
Prefer these classes or the --df-color-* variables for theming. Avoid targeting old internal combinations such as bg-primary, text-primary, or hover:bg-primary/90 on DayFlow internals, because those Tailwind semantic names are no longer part of the public styling contract.
Layout & Motion Helpers
These classes are useful when you want custom slot content or plugin UI to inherit DayFlow's layout and animation behavior.
| Class Name | Purpose |
|---|---|
df-content-slot-stacked | Makes a content slot fill available height and stack vertically |
df-scrollbar-hide | Hides scrollbars while preserving scroll behavior |
df-animate-in | Base animation timing helper for entry transitions |
df-fade-in | Fade-in animation helper |
df-zoom-in-95 | Slight zoom-in animation helper |
df-animate-slide-up | Slide-up entry animation |
df-animate-slide-down | Slide-down exit animation |
Day View
CSS classes specific to the Day View.
| Class Name | Description |
|---|---|
df-day-view | Day view container |
df-day-event | Individual event in day view |
df-day-time-grid | Time grid container |
df-time-column | Time column (left sidebar with hours) |
df-time-slot | Individual time slot container (left column) |
df-time-label | Time label text (e.g., "1 PM") |
df-time-grid-row | Horizontal row in the time grid |
df-time-grid-cell | Individual cell in the time grid |
df-right-panel | Right panel in day view (mini calendar + event list) |
Week View
CSS classes specific to the Week View.
| Class Name | Description |
|---|---|
df-week-view | Week view container |
df-week-event | Individual event in week view |
df-week-header | Week header container with day names |
df-week-header-row | The sticky header row containing day names |
df-week-day-cell | Individual weekday cell in header |
df-time-column | Time column (left sidebar with hours) |
df-time-slot | Individual time slot container (left column) |
df-time-label | Time label text |
df-time-grid-row | Horizontal row in the time grid |
df-time-grid-cell | Individual cell in the time grid |
Month View
CSS classes specific to the Month View.
| Class Name | Description |
|---|---|
df-month-view | Month view container |
df-month-grid | The main grid container for the month view |
df-month-day-cell | Individual day cell in month view |
df-month-date-number-container | Container for date number area |
df-month-date-number | Date number in month view |
df-month-more-events | "+ x more" indicator for hidden events |
df-month-title | Floating month title during scroll |
Year View
CSS classes specific to the Year View. These are particularly useful for customizing event appearance in the year overview.
| Class Name | Description |
|---|---|
df-year-event | Event outer container - wraps the entire event element |
df-event-year-content | Event content container - contains icon, title, and other content |
df-event-year-title | Event title text - use this to customize title alignment, font, etc. |
df-event-icon-svg | Event icon SVG used across event renderers, including Year view |
df-event-year-indicator | Timed event color indicator - the colored dot/bar for timed events |
df-year-grid-month | Month card container in grid-based Year view |
df-year-fixed-day-cell | Day cell in fixed-week Year view |
Mini Calendar
CSS classes for the Mini Calendar component (usually found in the sidebar or day view).
| Class Name | Description |
|---|---|
df-mini-calendar | Mini calendar container |
df-mini-calendar-body | Mini calendar body wrapper |
df-mini-calendar-header-nav | Month navigation row |
df-mini-calendar-nav-btn | Previous / next month button |
df-mini-calendar-month-label | Current month label |
df-mini-calendar-grid | The grid container for days |
df-mini-calendar-header | Weekday header cell (e.g., "Mo", "Tu") |
df-mini-calendar-day | Base class for a mini calendar date button |
df-mini-calendar-day-cell | Styled date cell surface |
df-mini-calendar-day-number | Numeric day label |
df-mini-calendar-dots | Event-dot container inside a day cell |
df-mini-calendar-dot | Individual event dot |
Sidebar
CSS classes for the sidebar component.
| Class Name | Description |
|---|---|
df-sidebar | Sidebar container |
df-sidebar-header | Sidebar header container |
df-sidebar-toggle | Sidebar collapse/expand toggle button |
df-sidebar-header-title | Sidebar header title ("Calendars") |
df-sidebar-list-shell | Scrollable wrapper around sidebar lists |
df-sidebar-list | Calendar list container |
df-sidebar-list-item | Individual calendar item in list |
df-sidebar-row | Interactive row inside each list item |
df-sidebar-chip | Small sidebar label / chip |
df-sidebar-dialog | Sidebar modal/dialog container |
df-sidebar-button | Shared sidebar button class |
Navigation
CSS classes for navigation buttons.
| Class Name | Description |
|---|---|
df-nav-button | Base navigation arrow button class (prev/next) |
df-calendar-nav-button | Styled calendar navigation arrow button |
df-today-button | Base "Today" button class |
df-calendar-today-button | Styled calendar "Today" button |
Event Detail
CSS classes for event detail panels and dialogs.
| Class Name | Description |
|---|---|
df-event-detail-panel | Floating event detail panel |
df-event-dialog-overlay | Event detail dialog overlay root |
df-event-dialog-backdrop | Event detail dialog backdrop |
df-dialog-container | Dialog content container |
df-event-dialog-close | Event detail dialog close button |
df-portal | Shared portal root class |
Content Slots
CSS classes used for the Content Slot rendering system.
| Class Name | Description |
|---|---|
df-content-slot | Container for a content slot |
df-slot-[id] | Dynamic class assigned to a specific slot instance where [id] is a unique identifier |
Event State Attributes
Every calendar event element exposes a set of data-* attributes that reflect its current state. You can target these directly in CSS without adding extra classes.
| Attribute | Values | Description |
|---|---|---|
data-view | "day" "week" "month" "year" | Which view is currently rendering the event |
data-all-day | "true" "false" | Whether the event is an all-day event |
data-selected | "true" "false" | Whether the event is currently selected |
data-dragging | "true" "false" | Whether the event is being dragged |
data-resizing | "true" "false" | Whether the event is being resized |
data-multi-day | "true" "false" | Whether the event spans multiple days |
data-editable | "true" "false" | Whether the event can be edited |
data-segment-shape | "full" "start" "middle" "end" | Rounded-corner shape for multi-segment events |
Example
/* Selected events */
.df-event[data-selected='true'] {
outline: 2px solid var(--df-color-primary);
}
/* Events while being dragged */
.df-event[data-dragging='true'] {
opacity: 0.6;
}
/* Only target month-view events */
.df-event[data-view='month'] {
font-size: 11px;
}
/* All-day events only */
.df-event[data-all-day='true'] {
font-weight: 600;
}How to Customize
To customize the appearance, target these classes or override the --df-color-* variables in your global CSS. Most theme-level changes should not need !important; use it only when you intentionally want to beat a highly specific local rule.
Example
/* Change the background of all events */
.df-event {
border-radius: 8px !important;
}
/* Customize the current time indicator */
.df-current-time-line {
z-index: 100;
}
.df-current-time-bar {
height: 3px !important;
background-color: #ef4444 !important;
}
/* Customize specific view */
.df-day-view .df-event {
border-left: 4px solid #3b82f6;
}
/* Style the sidebar */
.df-sidebar {
background-color: #f8fafc !important;
}
/* Style mini calendar */
.df-mini-calendar-day:hover {
background-color: #e2e8f0;
}
/* Reuse DayFlow semantic helpers in your own slot or plugin markup */
.my-custom-primary-chip {
background-color: var(--df-color-primary);
color: var(--df-color-primary-foreground);
}
/* Dark mode overrides */
.dark .df-calendar {
background-color: #111827;
}
/* Style event detail panel */
.df-event-detail-panel {
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
}Usage Tips
-
Specificity: If your styles don't apply, increase specificity by wrapping the calendar in a custom class:
.my-custom-calendar .df-event { ... } -
Responsive Design: Use media queries to adjust styles for mobile devices:
@media (max-width: 768px) { .df-event-title { font-size: 10px; } .df-time-label { font-size: 10px; } } -
Dark Mode: Use the
.darkselector for dark mode specific styles:.dark .df-month-day-cell { border-color: #374151; } -
CSS Variables: DayFlow uses
--df-color-*custom properties for colors. Override them on.df-calendar-container(and.df-portalfor floating overlays) for scoped color changes:.df-calendar-container, .df-portal { --df-color-primary: #3b82f6; --df-color-primary-foreground: #ffffff; }
Upgrading from Earlier Versions
Breaking change: calendar-event class removed
The calendar-event class has been removed from event elements. If your stylesheet targets .calendar-event { ... }, update it to .df-event { ... }.
Internal Tailwind utility classes (flex, rounded-md, shadow-sm, etc.) that were previously present on DayFlow DOM elements have also been removed. These were never part of the public API. Use the documented df-* classes and data-* attributes for all CSS customization.
Related Documentation
- Theme Customization - Advanced theming options
- Dark Mode - Dark mode configuration