You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Sets the component's color scheme to one of CoreUI's themed colors, ensuring the text color contrast adheres to the WCAG 4.5:1 contrast ratio standard for accessibility.
* Sets the component's color scheme to one of CoreUI's themed colors, ensuring the text color contrast adheres to the WCAG 4.5:1 contrast ratio standard for accessibility.
Copy file name to clipboardExpand all lines: packages/docs/content/components/badge.mdx
+14-2
Original file line number
Diff line number
Diff line change
@@ -99,10 +99,22 @@ Add any of the below-mentioned `color` props to modify the presentation of a rea
99
99
<CBadge color="danger">danger</CBadge>
100
100
<CBadge color="warning">warning</CBadge>
101
101
<CBadge color="info">info</CBadge>
102
-
<CBadge color="light">light</CBadge>
102
+
<CBadge textBgColor="light">light</CBadge>
103
103
<CBadge color="dark">dark</CBadge>
104
104
```
105
105
106
+
You can also apply contextual variations with the `textBgColor` property, which automatically sets the text color to ensure compliance with the WCAG 4.5:1 contrast ratio standard for enhanced accessibility.
107
+
108
+
```jsx preview
109
+
<CBadge textBgColor="primary">primary</CBadge>
110
+
<CBadge textBgColor="success">success</CBadge>
111
+
<CBadge textBgColor="danger">danger</CBadge>
112
+
<CBadge textBgColor="warning">warning</CBadge>
113
+
<CBadge textBgColor="info">info</CBadge>
114
+
<CBadge textBgColor="light">light</CBadge>
115
+
<CBadge textBgColor="dark">dark</CBadge>
116
+
```
117
+
106
118
## Pill badges
107
119
108
120
Apply the `shape="rounded-pill"` prop to make badges rounded.
@@ -113,7 +125,7 @@ Apply the `shape="rounded-pill"` prop to make badges rounded.
Copy file name to clipboardExpand all lines: packages/docs/content/components/card.mdx
+61
Original file line number
Diff line number
Diff line change
@@ -446,6 +446,67 @@ Cards include various options for customizing their backgrounds, borders, and co
446
446
447
447
Use `color` property to change the appearance of a card.
448
448
449
+
<Example>
450
+
<>
451
+
{[
452
+
{ color: 'primary' },
453
+
{ color: 'secondary' },
454
+
{ color: 'success' },
455
+
{ color: 'danger' },
456
+
{ color: 'warning' },
457
+
{ color: 'info' },
458
+
{ color: 'light' },
459
+
{ color: 'dark' },
460
+
].map((item, index) => (
461
+
<CCard
462
+
textBgColor={item.color}
463
+
className="mb-3"
464
+
style={{ maxWidth: '18rem' }}
465
+
key={index}
466
+
>
467
+
<CCardHeader>Header</CCardHeader>
468
+
<CCardBody>
469
+
<CCardTitle>{item.color} card title</CCardTitle>
470
+
<CCardText> Some quick example text to build on the card title and make up the bulk of the card's content.</CCardText>
471
+
</CCardBody>
472
+
</CCard>
473
+
))}
474
+
</>
475
+
</Example>
476
+
477
+
You can also apply contextual variations with the `textBgColor` property, which automatically sets the text color to ensure compliance with the WCAG 4.5:1 contrast ratio standard for enhanced accessibility.
478
+
479
+
480
+
```jsx
481
+
<>
482
+
{[
483
+
{ color:'primary' },
484
+
{ color:'secondary' },
485
+
{ color:'success' },
486
+
{ color:'danger' },
487
+
{ color:'warning' },
488
+
{ color:'info' },
489
+
{ color:'light' },
490
+
{ color:'dark' },
491
+
].map((item, index) => (
492
+
<CCard
493
+
textBgColor={item.color}
494
+
className="mb-3"
495
+
style={{ maxWidth:'18rem' }}
496
+
key={index}
497
+
>
498
+
<CCardHeader>Header</CCardHeader>
499
+
<CCardBody>
500
+
<CCardTitle>{item.color} card title</CCardTitle>
501
+
<CCardText>
502
+
Some quick example text to build on the card title and make up the bulk of the card's
0 commit comments