-
Notifications
You must be signed in to change notification settings - Fork 319
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
Simplify Readme #515
Simplify Readme #515
Conversation
* removes inline docs and points to web site docs * refines examples
README.md
Outdated
@@ -1,289 +1,83 @@ | |||
# LitElement | |||
A simple base class for creating fast, lightweight web components. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"...with lit-html"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
README.md
Outdated
|
||
Full documentation is available at [lit-element.polymer-project.org](https://lit-element.polymer-project.org). | ||
|
||
Docs source is in the `docs` folder. To build the site youself, see the instructions in [docs/README.md](docs/README.md). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should move this into CONTRIBUTING.md for both projects
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
README.md
Outdated
super(); | ||
this.mood = 'happy'; | ||
} | ||
// Provide styling for the element. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe too many comments...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed.
README.md
Outdated
<script type="module"> | ||
import {LitElement, html} from 'lit-element'; | ||
```ts | ||
import {LitElement, html, css} from 'lit-element'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import customElement and property
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added.
README.md
Outdated
this.mood = 'happy'; | ||
} | ||
// Provide styling for the element. | ||
static styles = css`.mood { color: green; }`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd add a newline after `
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
README.md
Outdated
this.mood = 'happy'; | ||
} | ||
// Provide styling for the element. | ||
static styles = css`.mood { color: green; }`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use an id as a selector to show of that that works in shadow dom? also class and property both named "mood" is maybe confusing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simplified
|
||
} | ||
customElements.define('my-element', MyElement); | ||
```bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From inside your project folder, run:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor suggestion.
README.md
Outdated
## Bigger Example | ||
```html | ||
<my-element mood="awesome"></my-element> | ||
``` | ||
|
||
Note, this example uses decorators to create properties. Decorators are a proposed | ||
standard currently available in [TypeScript](https://www.typescriptlang.org/) or [Babel](https://babeljs.io/docs/en/babel-plugin-proposal-decorators). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add to this paragraph:
LitElement
also supports a vanilla JavaScript method of declaring reactive properties.
(maybe with a link to the docs section for that?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Fixes #514