mirror of
https://github.com/hunvreus/basecoat.git
synced 2026-11-19 00:18:18 +00:00
Add force init lifecycle option
This commit is contained in:
@@ -48,6 +48,7 @@
|
||||
## JavaScript
|
||||
- JavaScript is behavior only; do not use JS to paper over CSS architecture issues.
|
||||
- Register JS components with `window.basecoat.register()` and make initialization idempotent with `data-*-initialized` flags.
|
||||
- Component init functions must return before attaching listeners or mutating DOM when the root already has its initialized flag.
|
||||
- Keep generated DOM minimal and aligned with documented HTML.
|
||||
- Prefer native browser APIs and events.
|
||||
- Keep scroll management scoped to component containers. Do not use `scrollIntoView()` when it can scroll the page unexpectedly.
|
||||
|
||||
Reference in New Issue
Block a user