forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add basic support for experimental theme switching (elastic#199748)
## Summary This PR adds basic support for theme switching to test experimental themes internally. It defines a new `theme:name` setting which is read-only (and thus hidden) by default, and needs `uiSettings.experimental.themeSwitcherEnabled: true` config setting to become visible. The implementation and the way the theme switcher feature is enabled will likely change in the upcoming weeks when we iron out the details, but the way it works right now is sufficient for testing and that's what the immediate goal is. Please note this PR includes mostly setup work, and no additional themes have been added here. To make reviewing slightly easier, these will be added separately. The feature and settings should be undocumented for the time being and disabled by default. --- As you might notice, there's a new setting added despite already having `theme:version`. We decided to introduce a new setting instead of resurrecting an existing one for better naming and flexibility and to reduce the risk of breaking things that might still use the old setting value (hardcoded to `v8` at the moment). The current plan is to remove `theme:version` in 9.0. The theme_loader got refactored to only bundle active themes coming from `KBN_OPTIMIZER_THEMES` (defaulting to `v8light` and `v8dark`) instead of `ALL_THEMES` that would significantly increase bundle sizes even when the experimental themes were not enabled. Considering there's a SASS to CSS-in-JS migration happening right now, we don't need to worry about Kibana bundles growing in size when a new theme is officially added. ### Checklist Delete any items that are not applicable to this PR. - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios ### For maintainers - [ ] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels) - [ ] This will appear in the **Release Notes** and follow the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --------- Co-authored-by: kibanamachine <[email protected]> Co-authored-by: Clint Andrew Hall <[email protected]> Co-authored-by: Rudolf Meijering <[email protected]> Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: Tiago Costa <[email protected]>
- Loading branch information
1 parent
98a46f9
commit bc915d0
Showing
80 changed files
with
597 additions
and
289 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
load("@build_bazel_rules_nodejs//:index.bzl", "js_library") | ||
|
||
SRCS = glob( | ||
[ | ||
"**/*.ts", | ||
"**/*.tsx", | ||
], | ||
exclude = [ | ||
"**/test_helpers.ts", | ||
"**/*.config.js", | ||
"**/*.mock.*", | ||
"**/*.test.*", | ||
"**/*.stories.*", | ||
"**/__snapshots__/**", | ||
"**/integration_tests/**", | ||
"**/mocks/**", | ||
"**/scripts/**", | ||
"**/storybook/**", | ||
"**/test_fixtures/**", | ||
"**/test_helpers/**", | ||
], | ||
) | ||
|
||
DEPS = [ | ||
"@npm//react", | ||
"@npm//tslib", | ||
] | ||
|
||
js_library( | ||
name = "core-base-common", | ||
package_name = "@kbn/core-base-common", | ||
srcs = ["package.json"] + SRCS, | ||
deps = DEPS, | ||
visibility = ["//visibility:public"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
...rendering/core-rendering-server-internal/src/__snapshots__/rendering_service.test.ts.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.