DeprecatedComponent · since 0.1.0
Warning: This part was replaced
Use c-form-field__label in new code. c-label keeps working until 1.0.
Pick this part
Existing markup only
- Never in new code. Existing
c-labelmarkup keeps working until 1.0.
Pick another part for
- Labelling any form control: use
c-form-fieldwithc-form-field__label.
Build it
- Build
c-form-field__labelinstead: this part only exists so older pages keep working. - Replace
class="c-label"in existing markup when you next touch it.mcss-lite validateflags every use with[deprecated].
Show markup 4 lines
<div class="c-form-field">
<label class="c-form-field__label" for="name">Name</label>
<input class="c-input" id="name">
</div>
Check your build
Each piece that doesn't fit was run through mcss-lite validate when this page was built. The output below is real.
Fits
Use the form-field label.
Show markup 4 lines
<div class="c-form-field">
<label class="c-form-field__label" for="name">Name</label>
<input class="c-input" id="name">
</div>
validate: 0 issues
Doesn't fit
Don't use the deprecated block.
<label class="c-label" for="name2">Name</label>
validate
- warning "c-label" is deprecated. Use "c-form-field__label".
[deprecated]
Spec sheet
Apply to <label>
| Token | Value (light / dark) |
|---|---|
--color-text-muted | #343a40 / #cfdae5 |