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

createTemplateElement #11

Open
stevenvachon opened this issue Apr 29, 2019 · 4 comments
Open

createTemplateElement #11

stevenvachon opened this issue Apr 29, 2019 · 4 comments

Comments

@stevenvachon
Copy link

const createTemplateElement = htmlString => {
    const element = document.createElement("template");
    element.innerHTML = htmlString;
    return element;
};
import {createTemplateElement as html} from 'webcomponent';

const template = html`
    <style>
        :host {
            display: block;
        }
    </style>
    <slot></slot>
`;

Notice the HTML syntax highlighting (available in Atom and GitHub, among others) on the template literal.

@tdumitrescu
Copy link
Member

Thanks, this is a nice idea. Did you open it as an Issue rather than a Pull Request in order to get feedback first?

@stevenvachon
Copy link
Author

This feature request is within a created issue, not a pull request. I've released this idea as a package that this project can depend on.

@tdumitrescu
Copy link
Member

OK, well if there's already a separate package for it then it seems like there's not much point in proxying it through this library too?

@stevenvachon
Copy link
Author

I think it's still very useful. This library is more of a toolbox than a tool.

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