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/components/badge.md
+26-4
Original file line number
Diff line number
Diff line change
@@ -145,7 +145,7 @@ Add any of the below-mentioned `color` props to modify the presentation of a bad
145
145
<CBadgecolor="danger">danger</CBadge>
146
146
<CBadgecolor="warning">warning</CBadge>
147
147
<CBadgecolor="info">info</CBadge>
148
-
<CBadgecolor="light">light</CBadge>
148
+
<CBadgetextBgColor="light">light</CBadge>
149
149
<CBadgecolor="dark">dark</CBadge>
150
150
:::
151
151
```vue
@@ -154,10 +154,32 @@ Add any of the below-mentioned `color` props to modify the presentation of a bad
154
154
<CBadge color="danger">danger</CBadge>
155
155
<CBadge color="warning">warning</CBadge>
156
156
<CBadge color="info">info</CBadge>
157
-
<CBadge color="light">light</CBadge>
157
+
<CBadge textBgColor="light">light</CBadge>
158
158
<CBadge color="dark">dark</CBadge>
159
159
```
160
160
161
+
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.
162
+
163
+
::: demo
164
+
<CBadgetextBgColor="primary">primary</CBadge>
165
+
<CBadgetextBgColor="success">success</CBadge>
166
+
<CBadgetextBgColor="danger">danger</CBadge>
167
+
<CBadgetextBgColor="warning">warning</CBadge>
168
+
<CBadgetextBgColor="info">info</CBadge>
169
+
<CBadgetextBgColor="light">light</CBadge>
170
+
<CBadgetextBgColor="dark">dark</CBadge>
171
+
:::
172
+
```vue
173
+
<CBadge textBgColor="primary">primary</CBadge>
174
+
<CBadge textBgColor="success">success</CBadge>
175
+
<CBadge textBgColor="danger">danger</CBadge>
176
+
<CBadge textBgColor="warning">warning</CBadge>
177
+
<CBadge textBgColor="info">info</CBadge>
178
+
<CBadge textBgColor="light">light</CBadge>
179
+
<CBadge textBgColor="dark">dark</CBadge>
180
+
```
181
+
182
+
161
183
## Pill badges
162
184
163
185
Apply the `shape="rounded-pill"` prop to make badges rounded.
@@ -168,7 +190,7 @@ Apply the `shape="rounded-pill"` prop to make badges rounded.
Copy file name to clipboardExpand all lines: packages/docs/components/card.md
+43
Original file line number
Diff line number
Diff line change
@@ -780,6 +780,49 @@ Use `color` property to change the appearance of a card.
780
780
</template>
781
781
```
782
782
783
+
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.
<CCardText>Some quick example text to build on the card title and make up the bulk of the card's content.</CCardText>
821
+
</CCardBody>
822
+
</CCard>
823
+
</template>
824
+
```
825
+
783
826
<Calloutcolor="info"title="Conveying meaning to assistive technologies">
784
827
Using color to add meaning only provides a visual indication, which will not be conveyed to users of assistive technologies – such as screen readers. Ensure that information denoted by the color is either obvious from the content itself (e.g. the visible text), or is included through alternative means, such as additional text hidden with the <code>.visually-hidden</code> class.
0 commit comments