2 // Size of each cell width and height when `fixedSize`property is set.
3 --fixed-cell-size: #{em(34)};
5 min-inline-size: rem(150);
6 max-inline-size: rem(400);
24 justify-content: center;
26 inline-size: var(--cell-width, auto);
28 // Chrome since v94 has a jiggling bug provoked by a cascade of minicalendar re-sizings at
29 // the threshold for the scrollbar to appear in the sidebar.
30 // We use a rather edgy browser check to avoid using aspect-ratio in Chrome because of this bug
31 @supports (aspect-ratio: 1 / 1) and (-moz-appearance: none) {
35 @supports (not (aspect-ratio: 1 / 1)) or (not (-moz-appearance: none)) {
36 block-size: var(--cell-height, initial);
44 &:not(.with-weeknumbers) {
45 grid-template-columns: 7fr; // It could be 1fr, but well… just for you to understand ^^
46 grid-template-rows: auto;
47 /* stylelint-disable-next-line declaration-block-no-redundant-longhand-properties */
54 grid-template-columns: 1fr 1px 7fr;
55 grid-template-rows: auto;
56 /* stylelint-disable-next-line declaration-block-no-redundant-longhand-properties */
58 'weeknumbers rule weekdays'
59 'weeknumbers rule monthdays';
63 --cell-width: var(--fixed-cell-size);
66 // Chrome since v94 has a jiggling bug provoked by a cascade of minicalendar re-sizings at
67 // the threshold for the scrollbar to appear in the sidebar.
68 // We use a rather edgy browser check to avoid using aspect-ratio in Chrome because of this bug
69 @supports (not (aspect-ratio: 1 / 1)) or (not (-moz-appearance: none)) {
70 // Ensure the aspect ratio while waiting for aspect-ratio property
71 --cell-height: var(--computed-cell-width, var(--fixed-cell-size));
76 grid-area: weeknumbers;
77 grid-template-columns: 1fr;
78 grid-template-rows: repeat(var(--week-count, 4), 1fr);
81 // Use a vertical rule instead of a border the use the grid gaps for spacing
88 grid-template-columns: repeat(var(--weekdays-count, 7), 1fr);
89 grid-template-rows: auto;
90 color: var(--text-weak);
93 // No buttons for weekdays, so no need to stretch
98 color: var(--mini-calendar-today-color);
103 grid-area: monthdays;
104 grid-template-columns: repeat(var(--cols, 7), 1fr);
105 grid-template-rows: repeat(var(--rows, 4), 1fr);
110 @extend .interactive-pseudo;
114 border-radius: var(--border-radius-sm);
116 &[aria-pressed='true'] {
117 background: var(--interaction-weak);
118 color: var(--text-norm);
121 background: var(--interaction-weak-hover);
125 background: var(--interaction-weak-active);
131 // This is the 'selected' and 'current' marker, placed below the number by z-index
137 border-radius: var(--border-radius-sm);
138 border: 1px solid transparent;
139 pointer-events: none;
140 transition: 0.15s easing(ease-out-quad);
150 background: var(--interaction-norm);
155 &--selected:focus-visible {
157 background: var(--interaction-norm-hover);
163 background: var(--interaction-norm-active);
167 &--selected &-number {
168 font-weight: var(--font-weight-bold);
169 color: var(--interaction-norm-contrast);
172 &[aria-current='date'] {
173 font-weight: var(--font-weight-bold);
174 color: var(--mini-calendar-today-color);
178 border-color: var(--mini-calendar-today-color);
183 color: var(--text-weak);
185 // Separate style of days out of month from the other ones when part of a range
186 &[aria-pressed='true'] {
187 background: var(--background-weak);
188 color: var(--text-weak);
192 &--range:not(#{&}--range-bound-start) {
193 border-start-start-radius: 0;
194 border-end-start-radius: 0;
197 &--range:not(#{&}--range-bound-end) {
198 border-start-end-radius: 0;
199 border-end-end-radius: 0;