Skip to content

Commit b0d9a1a

Browse files
sjimbonatorSjimmie
andauthored
fix: image width height auto (#2581)
Doordat de height en width altijd op auto staan kun je de img size niet aanpassen: https://nl-design-system.github.io/utrecht/storybook/?path=/docs/css_css-img--docs --------- Co-authored-by: Sjimmie <[email protected]>
1 parent 2e398a8 commit b0d9a1a

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

.changeset/slow-drinks-applaud.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@utrecht/img-css": patch
3+
---
4+
5+
Fix CSS image component to support `img` attributes `width` and `height`.

components/img/src/_mixin.scss

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,15 @@
55
*/
66

77
@mixin utrecht-img {
8-
/* stylelint-disable-next-line property-disallowed-list */
9-
height: auto;
8+
&:not(img[height]) {
9+
/* stylelint-disable-next-line property-disallowed-list */
10+
height: auto;
11+
}
1012

11-
/* stylelint-disable-next-line property-disallowed-list */
12-
width: auto;
13+
&:not(img[width]) {
14+
/* stylelint-disable-next-line property-disallowed-list */
15+
width: auto;
16+
}
1317
}
1418

1519
@mixin utrecht-img--scale-down {

0 commit comments

Comments
 (0)