Skip to content

Commit 7b7cbbf

Browse files
committed
Add UI theming and styles documentation: detail shared variables, dark theme application, and dialog/toast usage
1 parent e672698 commit 7b7cbbf

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

code-notes.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,13 @@ Read precedence and writes:
131131
- For per-site selector reset, popup uses saveCustomSelectors(site, null).
132132
- For global selector reset (if any caller uses it): resetAdvancedSelectors is supported and will clear all or one site accordingly.
133133

134+
## UI Theming and Styles
135+
136+
- Shared vars: ['common-ui-elements/common-style.css'](common-ui-elements/common-style.css) defines root tokens (colors, hover, transitions, shadows, checkbox size). Used by popup and welcome.
137+
- Dark theme: ['common-ui-elements/dark-theme.css'](common-ui-elements/dark-theme.css) applies on body.dark-theme; adjusts tokens and components (buttons, inputs, sections, links, toasts, dialogs).
138+
- Dialogs: use .dialog with variants .dialog-confirmation and .dialog-error (see ['popup.html'](popup.html:284)).
139+
- Toasts: base .toast plus type classes toast-success/error/info from ['popup-page-scripts/popup-page-visuals.js'](popup-page-scripts/popup-page-visuals.js:19). In dark mode, neutral fallback applies only without a type class.
140+
134141
## Future Adoption (Optional)
135142

136143
- ui.popup.firstOpen/collapsibles/lastOpenedSection are available for a future pass to persist popup section states.
@@ -140,13 +147,14 @@ Read precedence and writes:
140147
## Testing Notes
141148

142149
Recommended checks:
143-
- Theme toggle reads/writes both ui.theme and legacy darkTheme.
144-
- Cross-Chat module settings and stored prompt round-trip; legacy keys mirrored.
145-
- Floating panel per-host settings round-trip with legacy mirroring; list and reset functions operate correctly.
146-
- Custom selectors get/save/reset work; legacy customSelectors mirrored.
147-
- Profiles remain fully functional and unaffected.
150+
- Theme toggle, cross-chat, floating panel, custom selectors, and profiles behave as documented.
151+
- UI theming:
152+
- .dialog and variants render correctly in light/dark.
153+
- Toasts show base + correct type classes; dark fallback applies when no type.
148154

149155
## File References
150156

151157
- Service worker: ['config.js'](config.js)
152-
- Centralized state (non-profile): ['modules/state-store.js'](modules/state-store.js)
158+
- State: ['modules/state-store.js'](modules/state-store.js)
159+
- Styles: ['common-ui-elements/common-style.css'](common-ui-elements/common-style.css), ['common-ui-elements/dark-theme.css'](common-ui-elements/dark-theme.css)
160+
- HTML: ['popup.html'](popup.html), ['welcome.html'](welcome.html)

0 commit comments

Comments
 (0)