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

USWDS - Sandbox: Prep sandbox environment for web components #134

Open
mejiaj opened this issue Apr 26, 2024 · 1 comment
Open

USWDS - Sandbox: Prep sandbox environment for web components #134

mejiaj opened this issue Apr 26, 2024 · 1 comment
Assignees

Comments

@mejiaj
Copy link
Contributor

mejiaj commented Apr 26, 2024

Modify 11ty environment to support web components.

@heymatthenry
Copy link
Contributor

I spun up a little sample page in the sandbox on Pages that shows a few flavors of web components running in the sandbox. Arguably the coolest one is the simplified usa-link (source):

You can see what it looks like in this screenshot 💅🏻 image

Some things to observe about this version of usa-link:

  • It's rendered statically at build time
  • Styles are scoped to the component (and those style include css custome property versions of our design tokens). You can see those styles in the screenshot in the focus outline.

I definitely don't want to suggest that webc is the way we should be doing web components, but it's a way, and it works in eleventy with minimal additional overhead.

There are a couple of other web components on the page, and they're examples of:

  • how a vanilla (non-webc) web component can be run as client side JS from the assets directory; and
  • how CDN-hosted web components mostly ✨just work✨ .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

2 participants