Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
render() {
const todo = this.todo;
const classCompleted = todo.completed ? ' completed' : '';
const inputToggle = todo.completed
? html`<input class="toggle" type="checkbox" checked>`
: html`<input class="toggle" type="checkbox">`;
const classEditing = this._editing ? ' editing' : '';
return html`
${style}
<div data-id$="${todo.id}" class$="${'item' +
classCompleted +
classEditing}">
<div class="view">
${inputToggle}
<label>${todo.title}</label>
<button class="destroy"></button>
</div>
<input class="edit" type="text" />
</div>
`;
}
}
...
const style = html`
<style>
host: {
display: block;
}
.item {
position: relative;
font-size: 24px;
border-bottom: 1px solid #ededed;
}
...
</style>
`;
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment