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

Enable Shadow DOM through HTML #465

Closed
EisenbergEffect opened this issue Mar 10, 2019 · 4 comments
Closed

Enable Shadow DOM through HTML #465

EisenbergEffect opened this issue Mar 10, 2019 · 4 comments
Assignees

Comments

@EisenbergEffect
Copy link
Contributor

🙋 Feature Request

HTML Only elements should be able to declare that they use shadow dom.

🤔 Expected Behavior

Developers should be able to declare shadow dom use through HTML, not just JavaScript.

😯 Current Behavior

Shadow DOM can only be enabled through JavaScript.

💁 Possible Solution

See here for vCurrent: See here for the vCurrent behavior: aurelia/templating-resources#368

@EisenbergEffect EisenbergEffect changed the title Enable HTML Only Elements to Use Shadow DOM Enable Shadow DOM through HTML Mar 10, 2019
@EisenbergEffect
Copy link
Contributor Author

@3cp this might be an interesting one to pick up while you are doing the shadow dom convention.

@3cp
Copy link
Member

3cp commented Aug 19, 2019

Sounds good. Following per-file attribute will overwrite the option on bundler plugin.

<template use-shadow-dom>
<template use-shadow-dom="open">
<template use-shadow-dom="closed">

Different from vcurrent, the use-shadow-dom attribute will be stripped off from the html text during preprocessing. Unless you have a reason to retain it for runtime usage.

@3cp
Copy link
Member

3cp commented Aug 19, 2019

Since Aurelia 2 recommends to move import/require to above template tag, while supporting existing use-shadow-dom attribute, should we also recommend following syntax?

<use-shadow-dom mode="closed">
<import from="./foo.css">

<template></template>

The mode="closed" reads better than use-shadow-dom="closed".

Note, the closing </use-shadow-dom> is not required because the whole thing will be preprocessed.

@EisenbergEffect
Copy link
Contributor Author

EisenbergEffect commented Aug 19, 2019

I do like the fact that mode is an explicit attribute, which enables us to support other shadow dom properties in the future. I'd like to hear some other opinions on this though, since historically we've only had the require/import as a special case element and things like this have been put on the template.

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