anki/ts/components
RumovZ f2173fddb0
Live theme changes (#1497)
* Allow theme change at runtime and add hook

* Save or restore default palette on theme change

* Update aqt widget styles on theme change

* styling fixes

- drop _light_palette, as default_palette serves the same purpose
- save default platform theme, and restore it when switching away
from nightmode
- update macOS light/dark mode on theme switch
- fix unreadable menus on Windows

* update night-mode classes on theme change

This is the easy part - CSS styling that uses standard_css or our
css variables should update automatically. The main remaining issue
is JS code that sets colors based on the theme at the time it's run -
eg the graph code, and the editor.

* switch night mode value on toggle

* expose current theme via a store; switch graphs to use it

https://github.com/ankitects/anki/issues/1471#issuecomment-972402492

* start using currentTheme in editor/components

This fixes basic editing - there are still components that need updating.

* add simple xcodeproj for code completion

* add helper to get currently-active system theme on macOS

* fix setCurrentTheme not being immediately available

* live update tag color

* style().name() doesn't work on Qt5

* automatic theme switching on Windows/Mac

* currentTheme -> pageTheme

* Replace `nightModeKey` with `pageTheme`

Co-authored-by: Damien Elmes <gpg@ankiweb.net>
2021-11-25 07:17:41 +10:00
..
Absolute.svelte Translate Editor entirely to Svelte (#1403) 2021-10-18 22:01:15 +10:00
Badge.svelte Translate Editor entirely to Svelte (#1403) 2021-10-18 22:01:15 +10:00
BUILD.bazel Introduce our own Container, Row, and Col components (#1495) 2021-11-17 13:49:52 +10:00
ButtonDropdown.svelte fix deprecation warning in latest svelte-preprocess 2021-10-26 08:43:02 +10:00
ButtonGroup.svelte Introduce our own Container, Row, and Col components (#1495) 2021-11-17 13:49:52 +10:00
ButtonGroupItem.svelte Fix DeckOptions toolbar having wrong margins and no flex-grow (#1464) 2021-10-28 19:37:52 +10:00
buttons.ts Fix Float buttons in rtl 2021-09-06 21:15:37 +10:00
ButtonToolbar.svelte Live theme changes (#1497) 2021-11-25 07:17:41 +10:00
Col.svelte Introduce our own Container, Row, and Col components (#1495) 2021-11-17 13:49:52 +10:00
ColorPicker.svelte fix deprecation warning in latest svelte-preprocess 2021-10-26 08:43:02 +10:00
Container.svelte Introduce our own Container, Row, and Col components (#1495) 2021-11-17 13:49:52 +10:00
context-keys.ts Live theme changes (#1497) 2021-11-25 07:17:41 +10:00
Detachable.svelte fix deprecation warning in latest svelte-preprocess 2021-10-26 08:43:02 +10:00
dropdown.ts handle changed aria-expanded typing 2021-09-29 12:20:27 +10:00
DropdownDivider.svelte WIP: Use our components in deckoptions sticky bar 2021-05-18 16:32:29 +02:00
DropdownItem.svelte Live theme changes (#1497) 2021-11-25 07:17:41 +10:00
DropdownMenu.svelte fix deprecation warning in latest svelte-preprocess 2021-10-26 08:43:02 +10:00
helpers.ts Use trailingComma: all setting in .prettierrc (#1435) 2021-10-19 09:06:00 +10:00
IconButton.svelte Live theme changes (#1497) 2021-11-25 07:17:41 +10:00
IconConstrain.svelte Translate Editor entirely to Svelte (#1403) 2021-10-18 22:01:15 +10:00
identifier.ts Use trailingComma: all setting in .prettierrc (#1435) 2021-10-19 09:06:00 +10:00
Item.svelte Fix DeckOptions toolbar having wrong margins and no flex-grow (#1464) 2021-10-28 19:37:52 +10:00
LabelButton.svelte Live theme changes (#1497) 2021-11-25 07:17:41 +10:00
registration.ts Use trailingComma: all setting in .prettierrc (#1435) 2021-10-19 09:06:00 +10:00
Row.svelte Introduce our own Container, Row, and Col components (#1495) 2021-11-17 13:49:52 +10:00
Section.svelte fix deprecation warning in latest svelte-preprocess 2021-10-26 08:43:02 +10:00
SelectButton.svelte Live theme changes (#1497) 2021-11-25 07:17:41 +10:00
SelectOption.svelte Several CSS fixes - Editor Cleanup (#1470) 2021-10-31 08:29:22 +10:00
Shortcut.svelte fix deprecation warning in latest svelte-preprocess 2021-10-26 08:43:02 +10:00
Spacer.svelte Space out Sticky Bottom with Spacer component 2021-09-09 15:37:58 +02:00
StickyContainer.svelte Change Notetype UI Rework (#1499) 2021-11-24 12:09:55 +10:00
tsconfig.json update to latest rules_nodejs & switch to ts_project 2021-10-01 12:52:53 +10:00
types.ts Introduce our own Container, Row, and Col components (#1495) 2021-11-17 13:49:52 +10:00
WithContext.svelte fix deprecation warning in latest svelte-preprocess 2021-10-26 08:43:02 +10:00
WithDropdown.svelte fix deprecation warning in latest svelte-preprocess 2021-10-26 08:43:02 +10:00
WithShortcut.svelte fix deprecation warning in latest svelte-preprocess 2021-10-26 08:43:02 +10:00
WithState.svelte Reverse-engineer surrounding with execCommand (#1377) 2021-11-18 19:18:39 +10:00
WithTooltip.svelte Editor Field Descriptions (#1476) 2021-11-06 09:42:48 +10:00