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

USWDS - Bug: Alert padding settings not working (theme-alert-padding-x) #5252

Open
2 tasks done
aduth opened this issue Apr 24, 2023 · 2 comments
Open
2 tasks done

USWDS - Bug: Alert padding settings not working (theme-alert-padding-x) #5252

aduth opened this issue Apr 24, 2023 · 2 comments
Labels
Needs: Confirmation We need to confirm that this is an issue Package: Alert Role: Dev Development/engineering skills needed Type: Bug A problem in the code

Comments

@aduth
Copy link
Contributor

aduth commented Apr 24, 2023

Describe the bug

The theme setting $theme-alert-padding-x does not have the expected effect of controlling the rendered padding styles of an alert.

Steps to reproduce the bug

mkdir tmp-uswds-bug
cd tmp-uswds-bug
npm init -y
npm i @uswds/uswds @18f/identity-build-sass
echo "@use 'uswds-core' with (\$theme-alert-padding-x: 4); @forward 'uswds';" > styles.css.scss
npm exec @18f/identity-build-sass -- --load-path=node_modules/@uswds/uswds/packages styles.css.scss
echo "<link rel=stylesheet href=styles.css><div class=measure-5><div class=usa-alert><div class=usa-alert__body><p class=usa-alert__text>Example</p></div></div></div>" > index.html
open index.html

Observe that the alert body's right padding is only 1rem.

Expected Behavior

The alert is rendered with 4 units (2rem) of horizontal padding, as configured with the example stylesheet's $theme-alert-padding-x.

Related code

No response

Screenshots

Screen Shot 2023-04-24 at 4 21 06 PM

System setup

  • USWDS Version: 3.4.1

Additional context

This may have regressed as of #4922, where previously the alert styles incorporated the settings, but no longer did after the changes.

Before:

@include u-padding-x($theme-alert-padding-x);

After:

@include u-padding-x($theme-site-margins-mobile-width);

Code of Conduct

@aduth aduth added Needs: Confirmation We need to confirm that this is an issue Status: Triage We're triaging this issue and grooming if necessary Type: Bug A problem in the code labels Apr 24, 2023
@aduth
Copy link
Contributor Author

aduth commented Apr 24, 2023

For additional context, I encountered this when updating to USWDS 3 in our project.

See 18F/identity-design-system#345 for our workaround, plus before/after screenshots ("before" being the default USWDS 3 display with the configured theme setting).

@thisisdano thisisdano added Package: Alert Role: Dev Development/engineering skills needed and removed Status: Triage We're triaging this issue and grooming if necessary labels May 11, 2023
@arkjoseph
Copy link

@thisisdano - the dev team at OGST is experiencing this bug as well. Any status update?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Confirmation We need to confirm that this is an issue Package: Alert Role: Dev Development/engineering skills needed Type: Bug A problem in the code
Projects
Status: Needs refinement
Development

No branches or pull requests

3 participants