Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove a-legend class | Move legends inside fieldsets #2009

Merged
merged 2 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 41 additions & 48 deletions docs/pages/fieldsets.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,12 @@ variation_groups:
- variations:
- variation_code_snippet: >-
<form class="o-form">

<legend class="a-legend">

Basic legend
<small class="a-label__helper a-label__helper--block">Use block helper text for instructions</small>
</legend>
<div class="o-form__group">
<fieldset class="o-form__fieldset">
<legend class="h4">
Basic legend
<small class="a-label__helper a-label__helper--block">Use block helper text for instructions</small>
</legend>
<div class="m-form-field m-form-field--checkbox">
<input class="a-checkbox" type="checkbox" id="test_checkbox_1" name="test_checkbox">
<label class="a-label" for="test_checkbox_1">Inline label</label>
Expand All @@ -42,14 +40,12 @@ variation_groups:
variation_name: Fieldset with checkboxes
- variation_code_snippet: >-
<form class="o-form">

<legend class="a-legend">

Basic legend
<small class="a-label__helper a-label__helper--block">Use block helper text for instructions</small>
</legend>
<div class="o-form__group">
<fieldset class="o-form__fieldset">
<legend class="h4">
Basic legend
<small class="a-label__helper a-label__helper--block">Use block helper text for instructions</small>
</legend>
<div class="m-form-field m-form-field--radio">
<input class="a-radio" type="radio" id="test_radio_1" name="test_radio">
<label class="a-label" for="test_radio_1">Inline label</label>
Expand All @@ -70,14 +66,12 @@ variation_groups:
- variation_name: Large target fieldset with checkboxes
variation_code_snippet: >-
<form class="o-form">

<legend class="a-legend">

Basic legend
<small class="a-label__helper a-label__helper--block">Use block helper text for instructions</small>
</legend>
<div class="o-form__group">
<fieldset class="o-form__fieldset">
<legend class="h4">
Basic legend
<small class="a-label__helper a-label__helper--block">Use block helper text for instructions</small>
</legend>
<div class="m-form-field
m-form-field--checkbox
m-form-field--lg-target">
Expand Down Expand Up @@ -109,40 +103,39 @@ variation_groups:
variation_code_snippet: >-
<fieldset class="o-form__fieldset">

<legend class="a-legend">
<legend class="h4">
Basic legend
<small class="a-label__helper a-label__helper--block">Use block helper text for instructions</small>
</legend>

Basic legend
<small class="a-label__helper a-label__helper--block">Use block helper text for instructions</small>
</legend>

<div class="m-form-field
m-form-field--radio m-form-field--lg-target">
<input class="a-radio" id="is_helpful_1" type="radio" name="is_helpful" value="1">
<label class="a-label" for="is_helpful_1">Inline label
</label>
</div>
<div class="m-form-field
m-form-field--radio m-form-field--lg-target">
<input class="a-radio" id="is_helpful_1" type="radio" name="is_helpful" value="1">
<label class="a-label" for="is_helpful_1">Inline label
</label>
</div>

<div class="m-form-field
m-form-field--radio m-form-field--lg-target">
<input class="a-radio" id="is_helpful_2" type="radio" name="is_helpful" value="0">
<label class="a-label" for="is_helpful_2">Inline label
</label>
</div>
<div class="m-form-field
m-form-field--radio m-form-field--lg-target">
<input class="a-radio" id="is_helpful_2" type="radio" name="is_helpful" value="0">
<label class="a-label" for="is_helpful_2">Inline label
</label>
</div>

<div class="m-form-field
m-form-field--radio m-form-field--lg-target">
<input class="a-radio" id="is_helpful_3" type="radio" name="is_helpful" value="0">
<label class="a-label" for="is_helpful_3">Inline label
</label>
</div>
<div class="m-form-field
m-form-field--radio m-form-field--lg-target">
<input class="a-radio" id="is_helpful_3" type="radio" name="is_helpful" value="0">
<label class="a-label" for="is_helpful_3">Inline label
</label>
</div>

<div class="m-form-field
m-form-field--radio m-form-field--lg-target">
<input class="a-radio" id="is_helpful_4" type="radio" name="is_helpful" value="0">
<label class="a-label" for="is_helpful_4">Inline label
</label>
</div>
</fieldset>
<div class="m-form-field
m-form-field--radio m-form-field--lg-target">
<input class="a-radio" id="is_helpful_4" type="radio" name="is_helpful" value="0">
<label class="a-label" for="is_helpful_4">Inline label
</label>
</div>
</fieldset>
use_cases: ''
guidelines: ''
eyebrow: Components
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/filterable-list-control-panels.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ variation_groups:
content-l__col-2-3">
<div class="o-form__group">
<fieldset class="o-form__fieldset">
<legend class="a-legend">
<legend class="h4">
Date range
</legend>
<div class="content-l">
Expand Down
32 changes: 16 additions & 16 deletions docs/pages/labels.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,24 @@ variation_groups:
variation_specs: ''
- variation_code_snippet: >-
<fieldset class="o-form__fieldset">
<legend class="a-legend">Basic legend
</legend>
<legend class="h4">
Basic legend
</legend>

<div class="m-form-field
m-form-field--radio m-form-field--lg-target">
<input class="a-radio" id="is_helpful_1" type="radio" name="is_helpful" value="1">
<label class="a-label" for="is_helpful_1">Inline label
</label>
</div>
<div class="m-form-field
m-form-field--radio m-form-field--lg-target">
<input class="a-radio" id="is_helpful_1" type="radio" name="is_helpful" value="1">
<label class="a-label" for="is_helpful_1">Inline label
</label>
</div>

<div class="m-form-field
m-form-field--radio m-form-field--lg-target">
<input class="a-radio" id="is_helpful_2" type="radio" name="is_helpful" value="0">
<label class="a-label" for="is_helpful_2">Inline label
</label>
</div>

</fieldset>
<div class="m-form-field
m-form-field--radio m-form-field--lg-target">
<input class="a-radio" id="is_helpful_2" type="radio" name="is_helpful" value="0">
<label class="a-label" for="is_helpful_2">Inline label
</label>
</div>
</fieldset>
variation_description: The legend serves as the heading for a
[fieldset](https://cfpb.github.io/design-system/components/fieldsets).
variation_name: Basic legend
Expand Down
10 changes: 0 additions & 10 deletions packages/cfpb-forms/src/atoms/legend.less

This file was deleted.

10 changes: 0 additions & 10 deletions packages/cfpb-forms/src/atoms/legend.scss

This file was deleted.

1 change: 0 additions & 1 deletion packages/cfpb-forms/src/cfpb-forms.less
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@

@import (less) 'atoms/form-alert.less';
@import (less) 'atoms/label.less';
@import (less) 'atoms/legend.less';
@import (less) 'atoms/range.less';
@import (less) 'atoms/select.less';
@import (less) 'atoms/text-input.less';
Expand Down
1 change: 0 additions & 1 deletion packages/cfpb-forms/src/cfpb-forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ $select-height: 35px;

@import 'atoms/form-alert';
@import 'atoms/label';
@import 'atoms/legend';
@import 'atoms/range';
@import 'atoms/select';
@import 'atoms/text-input';
Expand Down
4 changes: 2 additions & 2 deletions packages/cfpb-forms/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,12 @@ Color variables referenced in comments are from [@cfpb/cfpb-core's brand-colors.

## Legends

<legend class="a-legend">
<legend class="h4">
A basic legend
</legend>

```html
<legend class="a-legend">A basic legend</legend>
<legend class="h4">A basic legend</legend>
```

## Labels
Expand Down