-
Notifications
You must be signed in to change notification settings - Fork 92
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
Context without shadow root #384
Comments
A card component could provide a 'color-theme' context to it's children, but also have it's own shadow DOM |
@bennypowers The import { createContext, component, html } from 'haunted';
const ThemeContext = createContext();
customElements.defined('theme-context-consumer', ThemeContext.Consumer);
// ...
const tmpl = html`
<theme-context-consumer .render=${v => html`
<span class="somespan">${v}</span>
`}></theme-context-consumer>
` then |
The Context's Consumer component does not need to have a ShadowRoot because it would be very hard to style elements inside it. (part) fixes matthewp#384
The Context's Consumer component does not need to have a ShadowRoot because it would be very hard to style elements inside it. (part) fixes matthewp#384
When creating a Context it is useful to opt out of using shadow DOM for the Consumer and Provider components.
To allow that
createContext
could pass thru the second argument ofcomponent
.Note: Shadow DOM is kind of useless for the
Provider
component. It makes more sense for theConsumer
.The text was updated successfully, but these errors were encountered: