Skip to content

Split utilities stylesheet to standalone file#10946

Merged
aduth merged 2 commits intomainfrom
aduth-split-utilities-stylesheet
Jul 17, 2024
Merged

Split utilities stylesheet to standalone file#10946
aduth merged 2 commits intomainfrom
aduth-split-utilities-stylesheet

Conversation

@aduth
Copy link
Contributor

@aduth aduth commented Jul 16, 2024

🛠 Summary of changes

Splits utilities out of application.css to its own standalone stylesheet utilities.css.

Why?

  • Predictability. There have been a number of issues ([1] [2]) related to the load order of stylesheets, and particularly utility classes and the relative ordering of the design system styles and our application-specific styles. This new implementation ensures that the general priority ordering of utilities > application styles > design system styles takes effect.
  • Performance. While there's not expected to be a net reduction in overall page size, splitting the stylesheets into smaller chunks allows parallelized HTTP/2 downloads to finish page load sooner than a single monolithic stylesheet. The current sign-in page asset sizes are primed for this split, where as of today https://secure.login.gov application is the largest first-party asset at 22.4kb (brotli'd), with the second-largest being 15.7kb (brotli'd). These changes bring the largest asset more into equilibrium, with application.css at 10.7kb (brotli'd) and utilities.css at 8.1kb (brotli'd).

📜 Testing Plan

Verify no regressions in the display of components affected by stylesheets, particularly around precedence of application styles vs. design system styles, and vs. utility classes. Refer to [1] [2] referenced above for examples of edge-cases previously encountered.

changelog: Internal, Performance, Split utilities stylesheet to standalone file
Co-authored-by: Mitchell Henke <mitchell.henke@gsa.gov>
@aduth aduth merged commit 9ab3079 into main Jul 17, 2024
@aduth aduth deleted the aduth-split-utilities-stylesheet branch July 17, 2024 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants