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

Can't turn body into custom element via is="..." #409

Closed
JanMiksovsky opened this issue Jan 28, 2014 · 4 comments
Closed

Can't turn body into custom element via is="..." #409

JanMiksovsky opened this issue Jan 28, 2014 · 4 comments

Comments

@JanMiksovsky
Copy link

I'd like to be able to create page templates that extend the <body> element and are applied via is="...", but seem unable to do so.

See repro case: http://jsbin.com/UnURIwIT/2/edit

If I change the element to extend="div", then apply this to a div inside the body, it works. But it'd be nice to be able to modify the body itself, since semantically, I view a page template as really being the page body, not being content inside the body.

@sorvell
Copy link
Contributor

sorvell commented Jan 28, 2014

That's fascinating. This works: http://jsbin.com/emITACE/1/edit.

@adamk explained to me that what's happening here is that the
is implicitly creating a body element. That's because
polymer-element is not allowed to exist in the head element. The explicit

causes the parser to call setAttribute('is', 'page-template') on the implicit body element. That doesn't work. Instead, you can put your polymer-element inside the body or in an import and it'll work.

This use case is definitely untrodden.

On Tue, Jan 28, 2014 at 2:59 PM, Jan Miksovsky notifications@github.comwrote:

I'd like to be able to create page templates that extend the element and are applied via is="...", but seem unable to do so.

See repro case: http://jsbin.com/UnURIwIT/2/edit

If I change the element to extend="div", then apply this to a div inside
the body, it works. But it'd be nice to be able to modify the body itself,
since semantically, I view a page template as really being the page
body, not being content inside the body.


Reply to this email directly or view it on GitHubhttps://github.com//issues/409
.

@JanMiksovsky
Copy link
Author

Steve: Thanks for the explanation, and for the helpful workaround!

I think this is a pretty interesting use case. There are a world of page templates out there that could easily be viewed as custom body elements. Being able to extend="body" is just as interesting as extending any other type of visible HTML element like button, etc.

@zoechi
Copy link

zoechi commented Jan 30, 2014

+1

@tomalec
Copy link
Contributor

tomalec commented Feb 19, 2014

@JanMiksovsky: Take a look at #421 - I was able to placed custom body element definition outside of <body> body ;) It works pretty fine in Canary. However, in stable Chrome and FF it breaks when you put something into element's template (but, still, works fine if you play inside <script>)

@sorvell sorvell closed this as completed Aug 11, 2014
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

4 participants