Skip to content

Commit 4a95532

Browse files
authored
Brighten card covers in alternate theme (#1851)
1 parent 349b1be commit 4a95532

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

.changeset/cuddly-hairs-compare.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+
Card covers within an alternate theme container will be brightened slightly to better offset covers with similar backgrounds to the container

src/components/card/card.scss

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
@use '../../compiled/tokens/scss/aspect-ratio';
22
@use '../../compiled/tokens/scss/breakpoint';
3+
@use '../../compiled/tokens/scss/brightness';
34
@use '../../compiled/tokens/scss/color';
45
@use '../../compiled/tokens/scss/ease';
56
@use '../../compiled/tokens/scss/size';
@@ -228,6 +229,17 @@ $_focus-overflow: (size.$edge-large * -1);
228229
grid-area: cover;
229230
transform: translate(0, 0); /* 3 */
230231

232+
/**
233+
* Subtly brighten covers within our alternate theme containers to help offset
234+
* imagery with light backgrounds from the surrounding container. We could
235+
* also do this for contained cards, but since those are a less common
236+
* occurrence we'll keep this simple for now.
237+
*/
238+
239+
@include theme.styles(alternate) {
240+
filter: brightness(brightness.$image-brighten);
241+
}
242+
231243
/**
232244
* Square aspect ratio + fully rounded corners = circular cover image
233245
*/

src/tokens/number/brightness.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
"control": {
55
"brighten": { "value": "110%" },
66
"dim": { "value": "80%" }
7+
},
8+
"image": {
9+
"brighten": { "value": "102.5%" }
710
}
811
}
912
}

0 commit comments

Comments
 (0)