Skip to content

Commit 2e2b3c5

Browse files
committed
Improve Calendar styles
* Create new stacking context for the month view to ensure selection stays visible * Always keep border around day cell to prevent flicker on hover
1 parent a075ae0 commit 2e2b3c5

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

packages/circuit-ui/components/Calendar/Calendar.module.css

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
.months {
2121
display: flex;
22+
isolation: isolate;
2223
}
2324

2425
.month:not(:last-child) {
@@ -97,7 +98,7 @@
9798
touch-action: manipulation;
9899
cursor: pointer;
99100
background: none;
100-
border: 0;
101+
border: 1px solid transparent;
101102
border-radius: var(--cui-border-radius-circle);
102103
}
103104

@@ -114,17 +115,17 @@
114115
}
115116

116117
.day[aria-current="date"] {
117-
border: 1px solid var(--cui-border-normal);
118+
border-color: var(--cui-border-normal);
118119
}
119120

120121
.day:hover {
121122
background: var(--cui-bg-normal-hovered);
122-
border: 1px solid var(--cui-border-strong-hovered);
123+
border-color: var(--cui-border-strong-hovered);
123124
}
124125

125126
.day:active {
126127
background: var(--cui-bg-normal-pressed);
127-
border: 1px solid var(--cui-border-strong-pressed);
128+
border-color: var(--cui-border-strong-pressed);
128129
}
129130

130131
/* Selected */
@@ -203,7 +204,7 @@ td:not(:last-of-type) .range-end.last-day::before {
203204
}
204205

205206
.day[aria-current="date"][aria-disabled="true"] {
206-
border: 1px solid var(--cui-border-normal-disabled);
207+
border-color: var(--cui-border-normal-disabled);
207208
}
208209

209210
.day[aria-disabled="true"].selected,

0 commit comments

Comments
 (0)