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

Split utilities stylesheet to standalone file #10946

Merged
merged 2 commits into from
Jul 17, 2024

Conversation

aduth
Copy link
Member

@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
app/views/layouts/component_preview.html.erb Outdated Show resolved Hide resolved
app/views/saml_idp/shared/saml_post_binding.html.erb Outdated Show resolved Hide resolved
@aduth aduth merged commit 9ab3079 into main Jul 17, 2024
2 checks passed
@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