Skip to content

Commit 4dbb59f

Browse files
Add active styles for Card and Event Summary (#1852)
Co-authored-by: Gerardo Rodriguez <[email protected]>
1 parent 4a95532 commit 4dbb59f

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

.changeset/thin-worms-whisper.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@cloudfour/patterns': minor
3+
---
4+
5+
Make active states more consistent between Button, Card and Event Summary

src/components/card/card.scss

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,14 +274,17 @@ $_focus-overflow: (size.$edge-large * -1);
274274

275275
/**
276276
* Hover effect for when the card contains a link. The image appears to zoom in
277-
* a very slight amount.
277+
* a very slight amount. We negate that zoom for the `:active` state for some
278+
* subtle consistency with other scale interactions, such as buttons and event
279+
* summary calendars, but we don't go quite as dramatic since these are larger
280+
* elements that would feel a bit more jarring.
278281
*/
279282

280283
.c-card__cover > *,
281284
.c-card__cover > picture > img {
282285
transition: transform transition.$prompt ease.$out;
283286

284-
.c-card--with-link:hover & {
287+
.c-card--with-link:hover:not(:active) & {
285288
transform: scale(1.025);
286289
}
287290
}

src/components/event-summary/event-summary.scss

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
@use '../../compiled/tokens/scss/brightness';
12
@use '../../compiled/tokens/scss/color';
23
@use '../../compiled/tokens/scss/ease';
34
@use '../../compiled/tokens/scss/scale';
@@ -55,9 +56,16 @@ $_focus-overflow: (size.$edge-large * -1);
5556
}
5657

5758
.c-event-summary__calendar-date {
58-
transition: transform transition.$quick ease.$out;
59+
transition: filter transition.$slow ease.$out,
60+
transform transition.$quick ease.$out;
5961

6062
.c-event-summary:hover & {
63+
filter: brightness(brightness.$control-brighten);
6164
transform: scale(scale.$effect-grow);
6265
}
66+
67+
.c-event-summary:active & {
68+
filter: brightness(brightness.$control-dim);
69+
transform: scale(scale.$effect-shrink);
70+
}
6371
}

0 commit comments

Comments
 (0)