Skip to content

USWDS - Utilities: Fix inaccuracies in utility code comments#5700

Closed
aduth wants to merge 1 commit into
uswds:developfrom
aduth:aduth-util-doc-examples
Closed

USWDS - Utilities: Fix inaccuracies in utility code comments#5700
aduth wants to merge 1 commit into
uswds:developfrom
aduth:aduth-util-doc-examples

Conversation

@aduth

@aduth aduth commented Jan 5, 2024

Copy link
Copy Markdown
Contributor

Summary

Internal code comments for utility classes now accurately reflect output CSS classes.

Related issue

Closes #5860

Problem statement

As a developer interested in optimizing the output size of bundles, I would like to eliminate utility classes not in use by configuring the $output-these-utilities theme setting. This is already difficult enough as-is since there's not an easy reference of utility name to the associated output CSS classes, but it's made worse by inaccuracies within code documentation for the utility class implementations.

Edit: In fairness, there is a list within the v3.0 migration guide, but it's not easy to find, and my instinct was to trust the source comments as a reference.

Solution

The changes here attempt to correct inaccuracies based on incorrect "usage" class name patterns, as well as removing invalid example keys for classes which don't exist.

Testing and review

Verify that the usage patterns and examples accurately reflect the expected outputs for that utility class.

These changes only affect code comments, so there should be no expected impact on the actual output of these utilities.

@mejiaj mejiaj added Status: Triage Needs: Confirmation Need to confirm that this is an issue labels Apr 4, 2024
@amyleadem amyleadem removed the Needs: Confirmation Need to confirm that this is an issue label Apr 10, 2024
@amyleadem

Copy link
Copy Markdown
Contributor

Thanks for this submission, @aduth! I am confirming that many of our comments in the packages/uswds-utilities/src/styles/rules/ directory have outdated comments, and I can see how these would be confusing for any developers that use our code comments as reference.

I have opened issue #5860 for tracking, and also found a few more changes that I've added to PR #5859.

@amyleadem

Copy link
Copy Markdown
Contributor

Thanks again for this fix @aduth. I am going to close out this PR in favor of #5859, which was branched off of this work. Please let us know if you have any questions.

@amyleadem amyleadem closed this Apr 11, 2024
@aduth aduth deleted the aduth-util-doc-examples branch May 7, 2024 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

USWDS - Bug: Inaccurate utility code comments

3 participants