Skip to content

USWDS - Utilities: Update inaccurate comments#5859

Merged
thisisdano merged 8 commits into
developfrom
al-util-doc-examples-addons
Apr 26, 2024
Merged

USWDS - Utilities: Update inaccurate comments#5859
thisisdano merged 8 commits into
developfrom
al-util-doc-examples-addons

Conversation

@amyleadem

@amyleadem amyleadem commented Apr 10, 2024

Copy link
Copy Markdown
Contributor

Summary

Updated the code comments on utility Sass partials. These comments now reflect the correct utility class names and values.

Important

This PR builds on the changes added by @aduth in PR #5700. Thank you @aduth!

Breaking change

This is not a breaking change. This update only affects code comments.

Related issue

Closes #5860

Related pull requests

This PR builds on the changes from @aduth in PR #5700.

Preview link

N/A

Problem statement

The code comments on the files in the packages/uswds-utilities/src/styles/rules/ directory are outdated and inaccurate. These code comments should be updated so that developers can use the code comments as reference (especially for utilities not documented on our website).

Solution

This PR updates outdate utility class references to match uswds 3.0 naming conventions.

Testing and review

  1. Confirm that all files in the packages/uswds-utilities/src/styles/rules/ have comments that reflect current USWDS naming structures
  2. Confirm comments are formatted consistently

@amyleadem amyleadem changed the title USWDS - Utilities: Update comments USWDS - Utilities: Update inaccurate comments Apr 10, 2024
@amyleadem amyleadem marked this pull request as ready for review April 10, 2024 21:37
@amyleadem amyleadem requested review from mahoneycm and mejiaj April 11, 2024 18:32

@mejiaj mejiaj left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making these fixes. I was able to test comments are accurate and up-to-date.

Can we fix the closing } in the code examples?

Comment thread packages/uswds-utilities/src/styles/rules/add-aspect.scss Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tip

Not alphabetical order, but it's output in uswds.css.

/* uswds.css */
.add-list-reset{
  margin-bottom:0;
  margin-top:0;
  padding-left:0;
  list-style:none;
}

Comment thread packages/uswds-utilities/src/styles/rules/background-color.scss Outdated
Comment thread packages/uswds-utilities/src/styles/rules/border-color.scss Outdated
Comment thread packages/uswds-utilities/src/styles/rules/border-radius.scss Outdated
Comment thread packages/uswds-utilities/src/styles/rules/border.scss Outdated
Comment thread packages/uswds-utilities/src/styles/rules/border.scss Outdated
----------------------------------------
usage:
.overflow-[modifier]
.overflow-[modifier]*-[key]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the value of the *?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it indicates that the modifier is optional. At least, that is my assumption based on the other comments with this format. I read it as the class can can be written as .overflow-hidden or .overflow-y-hidden.

@mahoneycm mahoneycm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking great, thank you for combing through these and updating.

Besides James' new line comment, I noticed a space missing for one value. Minuscule change but might as well while we're here 😄

Comment thread packages/uswds-utilities/src/styles/rules/opacity.scss Outdated
@amyleadem amyleadem requested review from mahoneycm and mejiaj April 12, 2024 15:53
@amyleadem

Copy link
Copy Markdown
Contributor Author

@mejiaj and @mahoneycm Thanks for those comments. I've moved the closing braces in the comments to a new line to meet standards and added the missing space to the opacity comment. Please let me know if I missed anything!

@mahoneycm mahoneycm requested a review from thisisdano April 12, 2024 19:24

@thisisdano thisisdano left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @aduth and @amyleadem! A somewhat thankless but important task

@thisisdano

Copy link
Copy Markdown
Contributor

But now it's thankless no longer :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

USWDS - Bug: Inaccurate utility code comments

5 participants