Skip to content

Commit 01c1483

Browse files
authored
refactor(ui5-card): add new CSS Shadow parts (#8057)
Fixes #7962
1 parent 351e570 commit 01c1483

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

packages/main/src/Card.hbs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
<div
22
class="{{classes.root}}"
33
role="region"
4-
aria-label="{{_getAriaLabel}}">
4+
aria-label="{{_getAriaLabel}}"
5+
part="root">
56
{{#if _hasHeader}}
67
<div class="ui5-card-header-root">
78
<slot name="header"></slot>
89
</div>
910
{{/if}}
10-
<div role="group" aria-label="{{_ariaCardContentLabel}}">
11+
<div role="group" aria-label="{{_ariaCardContentLabel}}" part="content">
1112
<slot></slot>
1213
</div>
1314
</div>

packages/main/src/Card.ts

+9
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,15 @@ import cardCss from "./generated/themes/Card.css.js";
2828
*
2929
* Note: We recommend the usage of <code>ui5-card-header</code> for the header slot, so advantage can be taken for keyboard handling, styling and accessibility.
3030
*
31+
* <h3>CSS Shadow Parts</h3>
32+
*
33+
* <ui5-link target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/CSS/::part">CSS Shadow Parts</ui5-link> allow developers to style elements inside the Shadow DOM.
34+
* <br>
35+
* The <code>ui5-card</code> exposes the following CSS Shadow Parts:
36+
* <ul>
37+
* <li>root - Used to style the root DOM element of the card component</li>
38+
* <li>content - Used to style the content of the card</li>
39+
* </ul>
3140
* <h3>ES6 Module Import</h3>
3241
*
3342
* <code>import "@ui5/webcomponents/dist/Card";</code>

0 commit comments

Comments
 (0)