-
Notifications
You must be signed in to change notification settings - Fork 26
fix: adding more notes #390
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
base: next
Are you sure you want to change the base?
Changes from 4 commits
4047d6a
2fde40f
738a28c
0b6821b
28291fd
704150d
9680b7a
84901d1
2befb50
fdfa9f4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,27 +21,34 @@ import '@phase2/outline-container'; | |
| bottom-margin="spacing-8" | ||
| > | ||
| ## Description | ||
| Lit components receive input and store their state as JavaScript class fields or properties. | ||
| Outline components receive input and store their state as JavaScript class fields(normally called attributes) or properties. | ||
|
|
||
| [Reactive properties](https://lit.dev/docs/components/properties/) are properties that can trigger the reactive update cycle when changed, re-rendering the component, and optionally be read or written to attributes. | ||
|
|
||
| ## Documentation Status | ||
| <outline-alert status="warning" size="large"> | ||
| <span slot="header">Status: Needs Work/In Progress</span> | ||
| <outline-alert status="success" size="large"> | ||
| <span slot="header">Status: Complete / Update to data May 2023</span> | ||
| <p> | ||
| This documentation is in need of additional work, or is currently in progress. | ||
| </p> | ||
| </outline-alert> | ||
| </outline-container> | ||
|
|
||
| ### Property usage basics | ||
|
|
||
| - Properties should be commented using [JSDoc](https://github.com/jsdoc/jsdoc). | ||
| - Each property should provide a comment including a description of the attribute functionality or purpose. | ||
| - Pass to `type` the appropriate [converter](https://lit.dev/docs/components/properties/#conversion-type) (`String`, `Boolean`, etc.). | ||
| - Pass to `attribute` an attribute name in kebab-case. | ||
| - Attribute names must not collide with HTML standard ones `title`, `href`, etc. | ||
| - This means it is best to name properties more like `link-title`, `link-href`, etc. | ||
| - Lit [documentation]() | ||
glitchgirl marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ### Slots versus properties | ||
| - When do I use a property? | ||
| - Properties are used for non-content features that impact the state of the component. For example, active versus inactive states. | ||
glitchgirl marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - The component shouldn't change its own public properties, except in response to user input. For example, you could set a property to change background color, but the component itself shouldn't change it's own color. | ||
|
||
| - Slots are used for content, such as HTML markup, text, icons, or images. | ||
|
||
| - There are cases in which adding content as a property will make sense, for example using a title to control the state of the component. Use this cautiously, as it can cause issues with a11y tools and automation. | ||
|
||
|
|
||
| ### Property with default value | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.