Skip to content

cssLayers

Whether the calendar’s CSS sits in cascade layers, under any rule of the page outside a layer.

Typeboolean
Defaulttrue
Live update (update())No — at creation only
Declared inpackages/dom/src/calendar.ts

In layers (@layer dzcalendar.base, dzcalendar.theme, the default), any rule of your page outside a layer wins over ours whatever its weight: restyling is plain CSS. A page whose global reset is not layered (Tailwind 3, Bootstrap’s reboot, normalize.css) would then win over our structure too: set false, and the CSS is plain — our class selectors outweigh those resets, and a page rule of the same weight coming after still wins. Import the theme unlayered too: @dzcalendar/theme/unlayered.css (or tailwind3.css). The first calendar of a document decides for all.

It is read when the calendar is made.

import { createCalendar } from '@dzcalendar/dom';
// A page on Tailwind 3: its preflight is not in a layer (the theme: @dzcalendar/theme/tailwind3.css).
createCalendar(element, { timeZone: 'Europe/Paris', cssLayers: false });

It is read when the calendar is made: in Angular through the defaults (DZ_CALENDAR_DEFAULTS, provideDzCalendar), in React and Vue through initial.