dragontheory / D7460N-with-db

Your data your way. Fast, easy, and secure.
https://d7460n-app-with-resizer.pages.dev/
2 stars 1 forks source link

"Self Aware" Spec #36

Open dragontheory opened 2 years ago

dragontheory commented 2 years ago

The D7460N app should be "self aware" of the data in it.

The boolean logic of open/close/show/hide is not governed directly by buttons. Buttons only post/get data. The boolean logic is governed by whether the target HTML element has data or not.

For example;

Panels, accordions, and menus are prestaged and hidden by default. display: none

When data is :observe'd within a panel, accordion, or menu, a class or data- attribute is added, removed, or changed in <body>.

Pre written CSS rules change the panel, accordion, or menu's display: none; to display: grid;.

Buttons no longer open/close/show/hide things directly. Buttons only post/get data.

A little more effort up front but ultimately will results in half the logic/code to write.

This allows for the "separation of concerns (data and UI)" spec.