Skip to content

Commit

Permalink
Remove usa-alert__paragraph
Browse files Browse the repository at this point in the history
(1) the width does not match the width of a paragraph in prose anyways
(2) there's already a utility to achieve this effect
  • Loading branch information
aduth committed Apr 3, 2023
1 parent b49031f commit 2501d85
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 28 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
- Image URLs in stylesheets are no longer processed by `asset-path-if-exists`. For Rails integrations, consider using [the `$theme-image-path` Sass variable](https://designsystem.digital.gov/documentation/settings/#general-settings) in combination with [Sprockets `resolve_assets_in_css_urls` option](https://github.com/rails/sprockets-rails#initializer-options).
- The deprecated `$image-path` Sass variable setting has been removed. Use `$theme-image-path` instead.
- The deprecated `alerts/success-badge.svg` image has been removed. Use `alerts/success.svg` instead.
- Removed `usa-alert__paragraph` alert helper class. Use [`measure-3` measure utility](https://designsystem.digital.gov/utilities/paragraph-styles/#max-width) instead.

### Improvements

Expand Down
22 changes: 0 additions & 22 deletions docs/_components/alerts.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ lead: >
subnav:
- text: Types of Alerts
href: "#types-of-alerts"
- text: Limiting Alert Width
href: "#limiting-alert-width"
---

{% include helpers/base-component.html component="alert" stylesheet="alerts" %}
Expand Down Expand Up @@ -75,23 +73,3 @@ Visit the [USWDS Alerts component](https://designsystem.digital.gov/components/a
</div>
{% endcapture %}
{% include helpers/code-example.html code=example %}

## Limiting Alert Width

If desired for aesthetics, the background coloring for alerts can be constrained to the width of a paragraph by appending the `usa-alert__paragraph` class to the `usa-alert` container.

<div class="usa-alert usa-alert--other usa-alert__paragraph">
<div class="usa-alert__body">
<p class="usa-alert__text">This “Other”-styled alert is constrained to the width of a paragraph. It works well when an alert is displayed in the context of a larger document, with paragraphs of text before or after it.</p>
</div>
</div>

Without the `usa-alert__paragraph` class, alert messages can look a little silly when used with paragraph text:

<div class="usa-alert usa-alert--other">
<div class="usa-alert__body">
<p class="usa-alert__text">This “Other”-styled alert is full width. It can look a little silly when combined with paragraph-width text.</p>
</div>
</div>

This is a following paragraph, to demostrate the width of the above alert message more clearly.
6 changes: 0 additions & 6 deletions src/scss/components/_alerts.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,3 @@ $alerts: 'success', 'warning', 'error', 'info', 'emergency';
.usa-alert--other {
background-color: color('primary-lighter');
}

// Temporarily supporting this class until USWDS formally supports this again
// or has an alternate recommendation.
.usa-alert__paragraph {
max-width: 66ch;
}

0 comments on commit 2501d85

Please sign in to comment.