barua-ui 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/css/components/content.css +30 -1
- package/package.json +1 -1
|
@@ -33,7 +33,36 @@
|
|
|
33
33
|
}
|
|
34
34
|
.b-card__title { font-size: var(--b-text-headline); font-weight: var(--b-weight-semibold); }
|
|
35
35
|
.b-card__subtitle { font-size: var(--b-text-footnote); color: var(--b-text-secondary); }
|
|
36
|
-
|
|
36
|
+
/*
|
|
37
|
+
* The media slot works two ways and only one of them used to.
|
|
38
|
+
*
|
|
39
|
+
* When the slot IS the picture — <img class="b-card__media"> — object-fit
|
|
40
|
+
* crops it and all is well. When it WRAPS one, which is what a card with a
|
|
41
|
+
* zoom button or an async image needs, object-fit does nothing: it only
|
|
42
|
+
* applies to replaced elements. The child then rendered at its natural size
|
|
43
|
+
* and burst out of the card, and anything positioned absolutely inside it
|
|
44
|
+
* escaped to the page, because there was no positioned ancestor to hold it.
|
|
45
|
+
*/
|
|
46
|
+
.b-card__media {
|
|
47
|
+
position: relative;
|
|
48
|
+
width: 100%;
|
|
49
|
+
aspect-ratio: 16 / 9;
|
|
50
|
+
overflow: hidden;
|
|
51
|
+
object-fit: cover;
|
|
52
|
+
}
|
|
53
|
+
/* Direct children fill the slot; the picture fills whatever wraps it, at any
|
|
54
|
+
depth, because a zoom button or an async-image span usually sits between. */
|
|
55
|
+
.b-card__media > * {
|
|
56
|
+
display: block;
|
|
57
|
+
width: 100%;
|
|
58
|
+
height: 100%;
|
|
59
|
+
}
|
|
60
|
+
.b-card__media :is(img, video, picture) {
|
|
61
|
+
display: block;
|
|
62
|
+
width: 100%;
|
|
63
|
+
height: 100%;
|
|
64
|
+
object-fit: cover;
|
|
65
|
+
}
|
|
37
66
|
.b-card__eyebrow {
|
|
38
67
|
font-size: var(--b-text-caption);
|
|
39
68
|
font-weight: var(--b-weight-semibold);
|