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

[Declarative Shadow DOM Style Sharing] Unclear how this works icw bundling #896

Closed
jpzwarte opened this issue Oct 18, 2024 · 4 comments
Closed

Comments

@jpzwarte
Copy link

So i like the proposed ability. However, i'm unclear how the proposal impacts development vs production.

In development you most likely have a folder with:

  • my-custom-element.js
  • my-custom-element.css

And you would have import styles from './my-custom-element.css' with { type: 'css' }; in my-custom-element.js. So this is a relative path.

How do you get from this relative path to an absolute path as shown in the specifier attribute in the proposal? Do we need new tooling where the custom element is "compiled" to HTML that uses <template shadowrootmode="open"> and convert the relative paths to absolute paths?

@sorvell
Copy link

sorvell commented Oct 18, 2024

I think the idea would be that whatever tooling you'd be using to emit my-custom-element.js shadowRoot declaratively would also process and emit the styling in the proposed format.

@jpzwarte
Copy link
Author

Would that approach exclude using this proposal with buildless setups? Or a mix between buildless & bundled?

@sorvell
Copy link

sorvell commented Oct 18, 2024

Don’t think so, it’s just up to you to deal with urls at that point… see #890

@jpzwarte
Copy link
Author

Closing this and picking up the discussion in #890

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

No branches or pull requests

2 participants