Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
099ad17
feat: add arrow container and arrow styles to card component
pixelgitter Jan 9, 2026
446114c
feat: update card component to include focus and hover styles, and ad…
pixelgitter Jan 9, 2026
29bb6bc
feat: add appearance variants (primary, secondary, tertiary) to card …
pixelgitter Jan 9, 2026
abb535c
feat: update card component with new appearance variants and aspect r…
pixelgitter Jan 21, 2026
98b818f
feat: update card component styles and adjust design tokens for impro…
pixelgitter Jan 21, 2026
3dba37b
feat: update card stories to use componentContainerStyle for consiste…
pixelgitter Jan 21, 2026
17167a9
feat: update bright card mixin to include border properties and box-s…
pixelgitter Feb 4, 2026
0d7e619
feat: refactor card component to support link functionality and updat…
pixelgitter Feb 6, 2026
528bd75
feat: enhance card component link styles and update design tokens for…
pixelgitter Feb 6, 2026
1256e14
feat: add link styles, transition properties, design tokens
pixelgitter Feb 13, 2026
3301048
feat: update card mixin and design tokens for border properties and i…
pixelgitter Feb 17, 2026
28dbf17
feat: enhance card component focus-visible styles and update design t…
pixelgitter Feb 17, 2026
4fe4a2a
feat: update card component image margin properties in design tokens
pixelgitter Feb 18, 2026
93325ec
feat: enhance card component tokens for hover, focus, and link states
pixelgitter Feb 18, 2026
eea3c68
feat: update card component to include focus and hover styles, and ad…
pixelgitter Jan 9, 2026
dd5f7cf
feat: update card mixins and tokens for color management
pixelgitter Feb 18, 2026
c0aa9df
feat: update focus mixin for background color
pixelgitter Feb 19, 2026
50f37a9
feat: add image ratio option, appearance colors, and focus-visible st…
pixelgitter Feb 19, 2026
3e82ef8
chore: pnpm file
pixelgitter Feb 24, 2026
224b246
fix: remove redundant arrow class from card component styles
pixelgitter Feb 24, 2026
d26f775
fixup! chore: pnpm file
pixelgitter Feb 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/soft-frogs-attend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@utrecht/card-react": minor
"@utrecht/card-css": minor
---

Added image ratio option, appearance colors, focus-visible (ring + spotlight), chevron, and related tokens
2 changes: 2 additions & 0 deletions components/card/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
"clean": "rimraf dist"
},
"devDependencies": {
"@utrecht/focus-ring-css": "workspace:*",
"@utrecht/link-css": "workspace:*",
"@utrecht/build-utils-css": "workspace:*"
},
"keywords": [
Expand Down
130 changes: 123 additions & 7 deletions components/card/src/_mixin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,108 @@
*/

@use "~@utrecht/img-css/src/mixin" as *;
@use "~@utrecht/focus-ring-css/src/mixin" as focus-ring;
@use "~@utrecht/link-css/src/mixin" as link-css;

@mixin utrecht-card {
--utrecht-link-text-decoration: none;
--utrecht-link-text-decoration-thickness: var(--utrecht-card-text-decoration-thickness, 2px);
--_utrecht-card-transition-duration: var(--utrecht-card-transition-duration, 0);

background-color: var(--utrecht-card-background-color);
border-radius: var(--utrecht-card-border-radius);
box-shadow: var(--utrecht-card-box-shadow);
color: var(--utrecht-card-color);
display: flex;
flex-direction: column;
inline-size: var(--utrecht-card-inline-size, 100%);
justify-content: space-between;
max-inline-size: var(--utrecht-card-max-inline-size, 100%);
row-gap: var(--utrecht-card-row-gap);
transition-duration: var(--utrecht-card-transition-duration);
transition-property: scale;
transition-timing-function: ease-in-out;

@media (prefers-reduced-motion: reduce) {
& {
@include utrecht-card--reduced-motion;
}
}
}
@mixin utrecht-card--link {
cursor: pointer;
text-decoration-skip-ink: none;

@mixin utrecht-card__arrow {
--utrecht-icon-size: 18px;

align-self: end;
padding-block-end: var(--utrecht-card-arrow-padding-block-end);
padding-inline-end: var(--utrecht-card-arrow-padding-inline-end);
}
@mixin utrecht-card--hover {
--utrecht-link-text-decoration: underline;
--utrecht-link-text-decoration-thickness: var(--utrecht-card-link-hover-text-decoration-thickness);

@mixin utrecht-card--has-link {
cursor: var(--utrecht-card-has-link-cursor, pointer);
text-decoration-skip-ink: all;
}

@mixin utrecht-card__link {
color: var(--utrecht-card-link-color);

@include link-css.utrecht-link--any-link;
}

@mixin utrecht-card__heading {
--utrecht-heading-color: var(--utrecht-card-heading-color);
--utrecht-heading-color: var(--utrecht-card-color);

order: 2;
padding-inline-end: var(--utrecht-card-heading-padding-inline-end);
padding-inline-start: var(--utrecht-card-heading-padding-inline-start);
}

@mixin utrecht-card--neutral {
--utrecht-card-background-color: var(--utrecht-card-neutral-background-color);
--utrecht-card-color: var(--utrecht-card-neutral-color);
}

@mixin utrecht-card--warm {
--utrecht-card-background-color: var(--utrecht-card-warm-background-color);
--utrecht-card-color: var(--utrecht-card-warm-color);
}

@mixin utrecht-card--cool {
--utrecht-card-background-color: var(--utrecht-card-cool-background-color);
--utrecht-card-color: var(--utrecht-card-cool-color);
}

@mixin utrecht-card--soft {
--utrecht-card-background-color: var(--utrecht-card-soft-background-color);
--utrecht-card-color: var(--utrecht-card-soft-color);
}

@mixin utrecht-card--bright {
--utrecht-card-background-color: var(--utrecht-card-bright-background-color);
--utrecht-card-color: var(--utrecht-card-bright-color);

border-color: var(--utrecht-card-bright-border-color);
border-style: solid;
border-width: var(--utrecht-card-bright-border-width);
box-sizing: border-box;

.utrecht-card__image {
margin-block: var(--utrecht-card-bright-image-margin-block);
margin-inline: var(--utrecht-card-bright-image-margin-inline);
}
}

@mixin utrecht-card__image {
order: 1;

img {
display: block;
}

img:not(.utrecht-img) {
@include utrecht-img;

object-fit: cover;
}
img:not(img[height]) {
@include utrecht-img--photo;
Expand All @@ -47,6 +117,22 @@
}
}

@mixin utrecht-card--16by9 {
img {
aspect-ratio: 16 / 9;
}
}
@mixin utrecht-card--4by3 {
img {
aspect-ratio: 4 / 3;
}
}
@mixin utrecht-card--1by1 {
img {
aspect-ratio: 1 / 1;
}
}

@mixin utrecht-card__content {
display: flex;
flex-direction: column;
Expand All @@ -62,3 +148,33 @@
padding-inline-end: var(--utrecht-card-body-padding-inline-end);
padding-inline-start: var(--utrecht-card-body-padding-inline-start);
}

@mixin utrecht-card--hover {
--utrecht-link-text-decoration: underline;

scale: var(--utrecht-card-hover-scale, 1);
}

@mixin utrecht-card--focus-visible {
/* the pseudo-class for `:focus-visible` is implemented via the mixin */
@include focus-ring.utrecht-focus-visible;

--utrecht-card-background-color: var(
--utrecht-card-focus-visible-background-color,
var(--utrecht-card-background-color)
);
--utrecht-card-color: var(--utrecht-card-focus-visible-color, var(--utrecht-card-color));
--utrecht-card-link-color: var(--utrecht-card-focus-visible-color, var(--utrecht-card-link-color));
}

@mixin utrecht-card--focus {
--utrecht-card-background-color: var(--utrecht-card-focus-background-color, var(--utrecht-card-background-color));
}

@mixin utrecht-card--active {
scale: var(--utrecht-card-active-scale, 1);
}

@mixin utrecht-card--reduced-motion {
--_utrecht-card-scale-animation-duration: 0;
}
65 changes: 61 additions & 4 deletions components/card/src/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@
.utrecht-card {
@include utrecht-card;
}
.utrecht-card--link {
@include utrecht-card--link;

.utrecht-card--has-link {
@include utrecht-card--has-link;
}

.utrecht-card--link:hover {
@include utrecht-card--hover;
.utrecht-card__arrow {
@include utrecht-card__arrow;
}

.utrecht-card__heading {
Expand All @@ -31,3 +32,59 @@
.utrecht-card__body {
@include utrecht-card__body;
}

.utrecht-card__link {
@include utrecht-card__link;
}

.utrecht-card--neutral {
@include utrecht-card--neutral;
}

.utrecht-card--warm {
@include utrecht-card--warm;
}

.utrecht-card--cool {
@include utrecht-card--cool;
}

.utrecht-card--soft {
@include utrecht-card--soft;
}

.utrecht-card--bright {
@include utrecht-card--bright;
}

.utrecht-card--16by9 {
@include utrecht-card--16by9;
}

.utrecht-card--4by3 {
@include utrecht-card--4by3;
}

.utrecht-card--1by1 {
@include utrecht-card--1by1;
}

.utrecht-card--active,
.utrecht-card:active {
@include utrecht-card--active;
}

.utrecht-card--focus-visible,
.utrecht-card--focus,
.utrecht-card:focus {
@include utrecht-card--focus;
}

.utrecht-card:focus-visible {
@include utrecht-card--focus-visible;
}

.utrecht-card--hover,
.utrecht-card--has-link:hover {
@include utrecht-card--hover;
}
Loading
Loading