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

Selectively import USWDS packages #422

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

ethangardner
Copy link
Contributor

Use packages instead of big uswds import. This helps cut down on the amount of unused CSS we're shipping.

Copy link

github-actions bot commented Jan 1, 2025

Terraform plan for tts-10x-atj-dev

Plan: 0 to add, 2 to change, 0 to destroy.
Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
!~  update in-place

Terraform will perform the following actions:

  # cloudfoundry_app.tts-10x-atj-dev-server-doj_tts-10x-atj-dev-server-doj-app_380DB029 will be updated in-place
!~  resource "cloudfoundry_app" "tts-10x-atj-dev-server-doj_tts-10x-atj-dev-server-doj-app_380DB029" {
!~      docker_image                    = "ghcr.io/gsa-tts/forms/server-doj:b355f84dd5bd7cf8779360db7b238b6b5185856c" -> "ghcr.io/gsa-tts/forms/server-doj:a1ff3c217f2c575efe7d27b7a64d0a96c5200ecf"
        id                              = "8a9fc8b6-af5e-45a2-abb6-2c24ecbcdfaa"
        name                            = "tts-10x-atj-dev-server-doj-app"
#        (17 unchanged attributes hidden)

#        (3 unchanged blocks hidden)
    }

  # cloudfoundry_app.tts-10x-atj-dev-server-kansas_tts-10x-atj-dev-server-kansas-app_337A9CF1 will be updated in-place
!~  resource "cloudfoundry_app" "tts-10x-atj-dev-server-kansas_tts-10x-atj-dev-server-kansas-app_337A9CF1" {
!~      docker_image                    = "ghcr.io/gsa-tts/forms/server-kansas:b355f84dd5bd7cf8779360db7b238b6b5185856c" -> "ghcr.io/gsa-tts/forms/server-kansas:a1ff3c217f2c575efe7d27b7a64d0a96c5200ecf"
        id                              = "e885e531-11b7-4906-9cc3-0ddf483868f5"
        name                            = "tts-10x-atj-dev-server-kansas-app"
#        (17 unchanged attributes hidden)

#        (3 unchanged blocks hidden)
    }

Plan: 0 to add, 2 to change, 0 to destroy.

📝 Plan generated in Post Terraform plan to PR comment #520

@ethangardner ethangardner linked an issue Jan 2, 2025 that may be closed by this pull request
Copy link
Contributor

@danielnaab danielnaab left a comment

Choose a reason for hiding this comment

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

Tracking what we use across multiple packages might be kind of hard, over the longer term. On the other hand, some of this modularization was maybe a bit premature, given that we don't have use cases for embedding in other sites, yet.

So this seems like a good improvement, but we should perhaps think about how we can encapsulate the styles for better reuse. Perhaps if we end up using the USWDS web component patterns, that will address encapsulation concerns?

@ethangardner
Copy link
Contributor Author

@danielnaab - another way to do this would be to use purgecss in the build step to clean up any unused styles and run it against the built Astro site. That way, it would use a tool to automate the removal of unused styles, and we wouldn't have to track it manually. Do you like that any better? It's easy enough to implement.

The USWDS web component package is still in the very early days, and when I talked to the USWDS team they did mention that they were going to be supporting concurrent versions (web component and vanilla JS/CSS) for a while. Also, they are trying to stick to as much light DOM as they can with the web component build, so it wouldn't encapsulate the styles.

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.

Clean up unused styles from USWDS
2 participants