@vaadin/card 24.8.0-alpha2 → 24.8.0-alpha20
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/README.md +0 -2
- package/package.json +8 -8
- package/src/vaadin-card.d.ts +15 -3
- package/src/vaadin-card.js +112 -4
- package/theme/lumo/vaadin-card-styles.js +14 -14
- package/web-types.json +48 -3
- package/web-types.lit.json +18 -3
package/README.md
CHANGED
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
A visual content container.
|
|
4
4
|
|
|
5
|
-
> ⚠️ This component is experimental and the API may change. In order to use it, enable the feature flag by setting `window.Vaadin.featureFlags.cardComponent = true`.
|
|
6
|
-
|
|
7
5
|
[Documentation + Live Demo ↗](https://vaadin.com/docs/latest/components/card)
|
|
8
6
|
|
|
9
7
|
[](https://www.npmjs.com/package/@vaadin/card)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/card",
|
|
3
|
-
"version": "24.8.0-
|
|
3
|
+
"version": "24.8.0-alpha20",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -34,15 +34,15 @@
|
|
|
34
34
|
"web-component"
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@vaadin/component-base": "24.8.0-
|
|
38
|
-
"@vaadin/vaadin-lumo-styles": "24.8.0-
|
|
39
|
-
"@vaadin/vaadin-material-styles": "24.8.0-
|
|
40
|
-
"@vaadin/vaadin-themable-mixin": "24.8.0-
|
|
37
|
+
"@vaadin/component-base": "24.8.0-alpha20",
|
|
38
|
+
"@vaadin/vaadin-lumo-styles": "24.8.0-alpha20",
|
|
39
|
+
"@vaadin/vaadin-material-styles": "24.8.0-alpha20",
|
|
40
|
+
"@vaadin/vaadin-themable-mixin": "24.8.0-alpha20",
|
|
41
41
|
"lit": "^3.0.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@vaadin/chai-plugins": "24.8.0-
|
|
45
|
-
"@vaadin/test-runner-commands": "24.8.0-
|
|
44
|
+
"@vaadin/chai-plugins": "24.8.0-alpha20",
|
|
45
|
+
"@vaadin/test-runner-commands": "24.8.0-alpha20",
|
|
46
46
|
"@vaadin/testing-helpers": "^1.1.0",
|
|
47
47
|
"sinon": "^18.0.0"
|
|
48
48
|
},
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"web-types.json",
|
|
51
51
|
"web-types.lit.json"
|
|
52
52
|
],
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "f091548b1f079f0c9de4be2a8ded77fb18671a2e"
|
|
54
54
|
}
|
package/src/vaadin-card.d.ts
CHANGED
|
@@ -9,10 +9,10 @@ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mix
|
|
|
9
9
|
/**
|
|
10
10
|
* `<vaadin-card>` is a versatile container for grouping related content and actions.
|
|
11
11
|
* It presents information in a structured and visually appealing manner, with
|
|
12
|
-
* customization options to fit various design requirements.
|
|
12
|
+
* customization options to fit various design requirements. The default ARIA role is `region`.
|
|
13
13
|
*
|
|
14
14
|
* ```html
|
|
15
|
-
* <vaadin-card theme="outlined cover-media">
|
|
15
|
+
* <vaadin-card role="region" theme="outlined cover-media">
|
|
16
16
|
* <img slot="media" width="200" src="..." alt="">
|
|
17
17
|
* <div slot="title">Lapland</div>
|
|
18
18
|
* <div slot="subtitle">The Exotic North</div>
|
|
@@ -41,7 +41,19 @@ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mix
|
|
|
41
41
|
*
|
|
42
42
|
* See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
|
|
43
43
|
*/
|
|
44
|
-
declare class Card extends ElementMixin(ThemableMixin(HTMLElement)) {
|
|
44
|
+
declare class Card extends ElementMixin(ThemableMixin(HTMLElement)) {
|
|
45
|
+
/**
|
|
46
|
+
* The title of the card. When set, any custom slotted title is removed and this string-based title is used instead. If this title is used, an `aria-labelledby` attribute that points to the generated title element is set.
|
|
47
|
+
* @attr {string} card-title
|
|
48
|
+
*/
|
|
49
|
+
cardTitle: string;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Sets the heading level (`aria-level`) for the string-based title. If not set, the level defaults to 2. Setting values outside the range [1, 6] can cause accessibility issues.
|
|
53
|
+
* @attr {number} title-heading-level
|
|
54
|
+
*/
|
|
55
|
+
titleHeadingLevel: number | null | undefined;
|
|
56
|
+
}
|
|
45
57
|
|
|
46
58
|
declare global {
|
|
47
59
|
interface HTMLElementTagNameMap {
|
package/src/vaadin-card.js
CHANGED
|
@@ -7,15 +7,16 @@ import { css, html, LitElement } from 'lit';
|
|
|
7
7
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
8
8
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
9
9
|
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
10
|
+
import { generateUniqueId } from '@vaadin/component-base/src/unique-id-utils.js';
|
|
10
11
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
14
|
* `<vaadin-card>` is a versatile container for grouping related content and actions.
|
|
14
15
|
* It presents information in a structured and visually appealing manner, with
|
|
15
|
-
* customization options to fit various design requirements.
|
|
16
|
+
* customization options to fit various design requirements. The default ARIA role is `region`.
|
|
16
17
|
*
|
|
17
18
|
* ```html
|
|
18
|
-
* <vaadin-card theme="outlined cover-media">
|
|
19
|
+
* <vaadin-card role="region" theme="outlined cover-media">
|
|
19
20
|
* <img slot="media" width="200" src="..." alt="">
|
|
20
21
|
* <div slot="title">Lapland</div>
|
|
21
22
|
* <div slot="subtitle">The Exotic North</div>
|
|
@@ -235,6 +236,8 @@ class Card extends ElementMixin(ThemableMixin(PolylitMixin(LitElement))) {
|
|
|
235
236
|
height: auto;
|
|
236
237
|
aspect-ratio: var(--vaadin-card-media-aspect-ratio, 16/9);
|
|
237
238
|
object-fit: cover;
|
|
239
|
+
/* Fixes an issue where an icon overflows the card boundaries on Firefox: https://github.com/vaadin/web-components/issues/8641 */
|
|
240
|
+
overflow: hidden;
|
|
238
241
|
}
|
|
239
242
|
|
|
240
243
|
:host([theme~='horizontal']:is([theme~='cover-media'], [theme~='stretch-media'])) {
|
|
@@ -279,8 +282,40 @@ class Card extends ElementMixin(ThemableMixin(PolylitMixin(LitElement))) {
|
|
|
279
282
|
`;
|
|
280
283
|
}
|
|
281
284
|
|
|
282
|
-
static get
|
|
283
|
-
return
|
|
285
|
+
static get properties() {
|
|
286
|
+
return {
|
|
287
|
+
/**
|
|
288
|
+
* The title of the card. When set, any custom slotted title is removed and this string-based title is used instead. If this title is used, an `aria-labelledby` attribute that points to the generated title element is set.
|
|
289
|
+
*
|
|
290
|
+
* @attr {string} card-title
|
|
291
|
+
*/
|
|
292
|
+
cardTitle: {
|
|
293
|
+
type: String,
|
|
294
|
+
observer: '__cardTitleChanged',
|
|
295
|
+
},
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* Sets the heading level (`aria-level`) for the string-based title. If not set, the level defaults to 2. Setting values outside the range [1, 6] can cause accessibility issues.
|
|
299
|
+
*
|
|
300
|
+
* @attr {number} title-heading-level
|
|
301
|
+
*/
|
|
302
|
+
titleHeadingLevel: {
|
|
303
|
+
type: Number,
|
|
304
|
+
reflectToAttribute: true,
|
|
305
|
+
observer: '__titleHeadingLevelChanged',
|
|
306
|
+
},
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/** @protected */
|
|
311
|
+
ready() {
|
|
312
|
+
super.ready();
|
|
313
|
+
|
|
314
|
+
// By default, if the user hasn't provided a custom role,
|
|
315
|
+
// the role attribute is set to "region".
|
|
316
|
+
if (!this.hasAttribute('role')) {
|
|
317
|
+
this.setAttribute('role', 'region');
|
|
318
|
+
}
|
|
284
319
|
}
|
|
285
320
|
|
|
286
321
|
/** @protected */
|
|
@@ -322,6 +357,79 @@ class Card extends ElementMixin(ThemableMixin(PolylitMixin(LitElement))) {
|
|
|
322
357
|
this.toggleAttribute('_hs', this.querySelector(':scope > [slot="header-suffix"]'));
|
|
323
358
|
this.toggleAttribute('_c', this.querySelector(':scope > :not([slot])'));
|
|
324
359
|
this.toggleAttribute('_f', this.querySelector(':scope > [slot="footer"]'));
|
|
360
|
+
if (this.__getCustomTitleElement()) {
|
|
361
|
+
this.__clearStringTitle();
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
/** @private */
|
|
366
|
+
__clearStringTitle() {
|
|
367
|
+
const stringTitleElement = this.__getStringTitleElement();
|
|
368
|
+
if (stringTitleElement) {
|
|
369
|
+
this.removeChild(stringTitleElement);
|
|
370
|
+
}
|
|
371
|
+
const ariaLabelledby = this.getAttribute('aria-labelledby');
|
|
372
|
+
if (ariaLabelledby && ariaLabelledby.startsWith('card-title-')) {
|
|
373
|
+
this.removeAttribute('aria-labelledby');
|
|
374
|
+
}
|
|
375
|
+
if (this.cardTitle) {
|
|
376
|
+
this.cardTitle = '';
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
/** @private */
|
|
381
|
+
__getCustomTitleElement() {
|
|
382
|
+
return Array.from(this.querySelectorAll('[slot="title"]')).find((el) => {
|
|
383
|
+
return !el.hasAttribute('card-string-title');
|
|
384
|
+
});
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
/** @private */
|
|
388
|
+
__cardTitleChanged(title) {
|
|
389
|
+
if (!title) {
|
|
390
|
+
this.__clearStringTitle();
|
|
391
|
+
return;
|
|
392
|
+
}
|
|
393
|
+
const customTitleElement = this.__getCustomTitleElement();
|
|
394
|
+
if (customTitleElement) {
|
|
395
|
+
this.removeChild(customTitleElement);
|
|
396
|
+
}
|
|
397
|
+
let stringTitleElement = this.__getStringTitleElement();
|
|
398
|
+
if (!stringTitleElement) {
|
|
399
|
+
stringTitleElement = this.__createStringTitleElement();
|
|
400
|
+
this.appendChild(stringTitleElement);
|
|
401
|
+
this.setAttribute('aria-labelledby', stringTitleElement.id);
|
|
402
|
+
}
|
|
403
|
+
stringTitleElement.textContent = title;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
/** @private */
|
|
407
|
+
__createStringTitleElement() {
|
|
408
|
+
const stringTitleElement = document.createElement('div');
|
|
409
|
+
stringTitleElement.setAttribute('slot', 'title');
|
|
410
|
+
stringTitleElement.setAttribute('role', 'heading');
|
|
411
|
+
this.__setTitleHeadingLevel(stringTitleElement, this.titleHeadingLevel);
|
|
412
|
+
stringTitleElement.setAttribute('card-string-title', '');
|
|
413
|
+
stringTitleElement.id = `card-title-${generateUniqueId()}`;
|
|
414
|
+
return stringTitleElement;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
/** @private */
|
|
418
|
+
__titleHeadingLevelChanged(titleHeadingLevel) {
|
|
419
|
+
const stringTitleElement = this.__getStringTitleElement();
|
|
420
|
+
if (stringTitleElement) {
|
|
421
|
+
this.__setTitleHeadingLevel(stringTitleElement, titleHeadingLevel);
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
/** @private */
|
|
426
|
+
__setTitleHeadingLevel(stringTitleElement, titleHeadingLevel) {
|
|
427
|
+
stringTitleElement.setAttribute('aria-level', titleHeadingLevel || 2);
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
/** @private */
|
|
431
|
+
__getStringTitleElement() {
|
|
432
|
+
return this.querySelector('[slot="title"][card-string-title]');
|
|
325
433
|
}
|
|
326
434
|
|
|
327
435
|
/**
|
|
@@ -6,12 +6,13 @@ import { addGlobalThemeStyles, css, registerStyles } from '@vaadin/vaadin-themab
|
|
|
6
6
|
|
|
7
7
|
const cardProps = css`
|
|
8
8
|
html {
|
|
9
|
-
--vaadin-card-background: var(--lumo-
|
|
9
|
+
--vaadin-card-background: var(--lumo-contrast-5pct);
|
|
10
10
|
--vaadin-card-border-radius: var(--lumo-border-radius-l);
|
|
11
11
|
--vaadin-card-border-width: 0;
|
|
12
12
|
--vaadin-card-border-color: var(--lumo-contrast-20pct);
|
|
13
13
|
--vaadin-card-padding: var(--lumo-space-m);
|
|
14
14
|
--vaadin-card-gap: var(--lumo-space-m);
|
|
15
|
+
--vaadin-card-shadow: none;
|
|
15
16
|
}
|
|
16
17
|
`;
|
|
17
18
|
|
|
@@ -21,7 +22,7 @@ const card = css`
|
|
|
21
22
|
:host {
|
|
22
23
|
background: var(--vaadin-card-background);
|
|
23
24
|
border-radius: var(--vaadin-card-border-radius);
|
|
24
|
-
box-shadow: var(--vaadin-card-
|
|
25
|
+
box-shadow: var(--vaadin-card-shadow);
|
|
25
26
|
position: relative;
|
|
26
27
|
}
|
|
27
28
|
|
|
@@ -29,28 +30,27 @@ const card = css`
|
|
|
29
30
|
:host::before {
|
|
30
31
|
content: '';
|
|
31
32
|
position: absolute;
|
|
32
|
-
inset: 0;
|
|
33
|
-
|
|
34
|
-
border-radius: inherit;
|
|
33
|
+
inset: var(--_card-border-inset, 0);
|
|
34
|
+
border-radius: var(--_card-border-pseudo-radius, inherit);
|
|
35
35
|
border: var(--vaadin-card-border, var(--vaadin-card-border-width) solid var(--vaadin-card-border-color));
|
|
36
|
+
pointer-events: none;
|
|
36
37
|
}
|
|
37
38
|
|
|
38
39
|
:host([theme~='outlined']) {
|
|
39
40
|
--vaadin-card-border-width: 1px;
|
|
40
|
-
--vaadin-card-background:
|
|
41
|
+
--vaadin-card-background: var(--lumo-base-color);
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
:host([theme~='elevated']) {
|
|
44
|
-
--vaadin-card-background: var(--lumo-tint-
|
|
45
|
-
--vaadin-card-
|
|
46
|
-
|
|
47
|
-
--
|
|
45
|
+
--vaadin-card-background: linear-gradient(var(--lumo-tint-5pct), var(--lumo-tint-5pct)) var(--lumo-base-color);
|
|
46
|
+
--vaadin-card-shadow: var(--lumo-box-shadow-xs);
|
|
47
|
+
--vaadin-card-border-width: 1px;
|
|
48
|
+
--_card-border-inset: calc(-1 * var(--vaadin-card-border-width));
|
|
49
|
+
--_card-border-pseudo-radius: calc(var(--vaadin-card-border-radius) + var(--vaadin-card-border-width));
|
|
48
50
|
}
|
|
49
51
|
|
|
50
|
-
:host([theme~='elevated'][theme~='outlined']) {
|
|
51
|
-
|
|
52
|
-
inset 0 -1px 0 0 var(--lumo-shade-10pct),
|
|
53
|
-
var(--vaadin-card-box-shadow);
|
|
52
|
+
:host([theme~='elevated']:not([theme~='outlined'])) {
|
|
53
|
+
--vaadin-card-border-color: var(--lumo-contrast-10pct);
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
:host(:where([theme~='stretch-media'])) ::slotted([slot='media']:is(img, video, svg, vaadin-icon)) {
|
package/web-types.json
CHANGED
|
@@ -1,15 +1,37 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/card",
|
|
4
|
-
"version": "24.8.0-
|
|
4
|
+
"version": "24.8.0-alpha20",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
8
8
|
"elements": [
|
|
9
9
|
{
|
|
10
10
|
"name": "vaadin-card",
|
|
11
|
-
"description": "`<vaadin-card>` is a versatile container for grouping related content and actions.\nIt presents information in a structured and visually appealing manner, with\ncustomization options to fit various design requirements
|
|
11
|
+
"description": "`<vaadin-card>` is a versatile container for grouping related content and actions.\nIt presents information in a structured and visually appealing manner, with\ncustomization options to fit various design requirements. The default ARIA role is `region`.\n\n```html\n<vaadin-card role=\"region\" theme=\"outlined cover-media\">\n <img slot=\"media\" width=\"200\" src=\"...\" alt=\"\">\n <div slot=\"title\">Lapland</div>\n <div slot=\"subtitle\">The Exotic North</div>\n <div>Lapland is the northern-most region of Finland and an active outdoor destination.</div>\n <vaadin-button slot=\"footer\">Book Vacation</vaadin-button>\n</vaadin-card>\n```\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n----------|-------------\n`media` | The container for the media element (e.g., image, video, icon). Shown above of before the card content.\n`header` | The container for title and subtitle - or for custom header content - and header prefix and suffix elements.\n`content` | The container for the card content (usually text content).\n`footer` | The container for footer elements. This part is always at the bottom of the card.\n\nThe following custom properties are available for styling:\n\nCustom property | Description | Default\n----------------|-------------|-------------\n`--vaadin-card-padding` | The space between the card edge and its content. Needs to a unified value for all edges, i.e., a single length value. | `1em`\n`--vaadin-card-gap` | The space between content elements within the card. | `1em`\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
12
12
|
"attributes": [
|
|
13
|
+
{
|
|
14
|
+
"name": "card-title",
|
|
15
|
+
"description": "The title of the card. When set, any custom slotted title is removed and this string-based title is used instead. If this title is used, an `aria-labelledby` attribute that points to the generated title element is set.",
|
|
16
|
+
"value": {
|
|
17
|
+
"type": [
|
|
18
|
+
"string",
|
|
19
|
+
"null",
|
|
20
|
+
"undefined"
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"name": "title-heading-level",
|
|
26
|
+
"description": "Sets the heading level (`aria-level`) for the string-based title. If not set, the level defaults to 2. Setting values outside the range [1, 6] can cause accessibility issues.",
|
|
27
|
+
"value": {
|
|
28
|
+
"type": [
|
|
29
|
+
"number",
|
|
30
|
+
"null",
|
|
31
|
+
"undefined"
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
},
|
|
13
35
|
{
|
|
14
36
|
"name": "theme",
|
|
15
37
|
"description": "The theme variants to apply to the component.",
|
|
@@ -23,7 +45,30 @@
|
|
|
23
45
|
}
|
|
24
46
|
],
|
|
25
47
|
"js": {
|
|
26
|
-
"properties": [
|
|
48
|
+
"properties": [
|
|
49
|
+
{
|
|
50
|
+
"name": "cardTitle",
|
|
51
|
+
"description": "The title of the card. When set, any custom slotted title is removed and this string-based title is used instead. If this title is used, an `aria-labelledby` attribute that points to the generated title element is set.",
|
|
52
|
+
"value": {
|
|
53
|
+
"type": [
|
|
54
|
+
"string",
|
|
55
|
+
"null",
|
|
56
|
+
"undefined"
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"name": "titleHeadingLevel",
|
|
62
|
+
"description": "Sets the heading level (`aria-level`) for the string-based title. If not set, the level defaults to 2. Setting values outside the range [1, 6] can cause accessibility issues.",
|
|
63
|
+
"value": {
|
|
64
|
+
"type": [
|
|
65
|
+
"number",
|
|
66
|
+
"null",
|
|
67
|
+
"undefined"
|
|
68
|
+
]
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
],
|
|
27
72
|
"events": []
|
|
28
73
|
}
|
|
29
74
|
}
|
package/web-types.lit.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/card",
|
|
4
|
-
"version": "24.8.0-
|
|
4
|
+
"version": "24.8.0-alpha20",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"framework": "lit",
|
|
7
7
|
"framework-config": {
|
|
@@ -16,9 +16,24 @@
|
|
|
16
16
|
"elements": [
|
|
17
17
|
{
|
|
18
18
|
"name": "vaadin-card",
|
|
19
|
-
"description": "`<vaadin-card>` is a versatile container for grouping related content and actions.\nIt presents information in a structured and visually appealing manner, with\ncustomization options to fit various design requirements
|
|
19
|
+
"description": "`<vaadin-card>` is a versatile container for grouping related content and actions.\nIt presents information in a structured and visually appealing manner, with\ncustomization options to fit various design requirements. The default ARIA role is `region`.\n\n```html\n<vaadin-card role=\"region\" theme=\"outlined cover-media\">\n <img slot=\"media\" width=\"200\" src=\"...\" alt=\"\">\n <div slot=\"title\">Lapland</div>\n <div slot=\"subtitle\">The Exotic North</div>\n <div>Lapland is the northern-most region of Finland and an active outdoor destination.</div>\n <vaadin-button slot=\"footer\">Book Vacation</vaadin-button>\n</vaadin-card>\n```\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n----------|-------------\n`media` | The container for the media element (e.g., image, video, icon). Shown above of before the card content.\n`header` | The container for title and subtitle - or for custom header content - and header prefix and suffix elements.\n`content` | The container for the card content (usually text content).\n`footer` | The container for footer elements. This part is always at the bottom of the card.\n\nThe following custom properties are available for styling:\n\nCustom property | Description | Default\n----------------|-------------|-------------\n`--vaadin-card-padding` | The space between the card edge and its content. Needs to a unified value for all edges, i.e., a single length value. | `1em`\n`--vaadin-card-gap` | The space between content elements within the card. | `1em`\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
20
20
|
"extension": true,
|
|
21
|
-
"attributes": [
|
|
21
|
+
"attributes": [
|
|
22
|
+
{
|
|
23
|
+
"name": ".cardTitle",
|
|
24
|
+
"description": "The title of the card. When set, any custom slotted title is removed and this string-based title is used instead. If this title is used, an `aria-labelledby` attribute that points to the generated title element is set.",
|
|
25
|
+
"value": {
|
|
26
|
+
"kind": "expression"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"name": ".titleHeadingLevel",
|
|
31
|
+
"description": "Sets the heading level (`aria-level`) for the string-based title. If not set, the level defaults to 2. Setting values outside the range [1, 6] can cause accessibility issues.",
|
|
32
|
+
"value": {
|
|
33
|
+
"kind": "expression"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
]
|
|
22
37
|
}
|
|
23
38
|
]
|
|
24
39
|
}
|