Lit-element: [docs] Review Templates page for technical accuracy

Created on 11 Dec 2018  路  5Comments  路  Source: Polymer/lit-element

Review the content at https://lit-element.polymer-project.org/guide/templates for technical accuracy only.

Markdown source: https://github.com/Polymer/lit-element/blob/master/docs/_guide/templates.md

  • [ ] remove static from getters in composition example
  • [ ] fix named slots code samples
  • [ ] .alert-warning for gotchas
docs Medium

Most helpful comment

In Compose a template from other templates section, the code snippet doesn't seem to work. I think you want the getters without static keyword.

All 5 comments

In Compose a template from other templates section, the code snippet doesn't seem to work. I think you want the getters without static keyword.

Example code under Use named slots don't look right

image

"Use name, not id, to select slots."

That's seems more like a warning than actual documentation, since id on <slot> doesn't do anything special. Maybe use .alert-warning for gotcha things?

Hi.

In Compose a template from other templates section

static get headerTemplate
It still does not work. Is the docs misleading?

static get headerTemplate -> get headerTemplate

There's an issue with the "Design a performant template" section, around the dom-manip example and the description that the DOM manipulation is inefficient. It's actually not, but it would be overwritten by the template and in many cases direct DOM manipulation could break the template by changing part placeholder nodes.

Was this page helpful?
0 / 5 - 0 ratings