ui: Adds localStorage to <html class=""> mapping for user controlled theming (#9496)

This commit is contained in:
John Cowen 2021-01-05 17:40:28 +00:00 committed by GitHub
parent 3140c0a343
commit c1c7776118
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,11 +1,23 @@
<HeadLayout />
{{page-title 'Consul' separator=' - '}}
{{#if (env 'CONSUL_ACLS_ENABLED')}}
{{document-attrs class="has-acls"}}
{{/if}}
{{#if (env 'CONSUL_NSPACES_ENABLED')}}
{{document-attrs class="has-nspaces"}}
{{/if}}
<DataSource
@src="settings://consul:theme"
as |source|>
{{#each-in source.data as |key value|}}
{{#if (and value (contains key (array "color-scheme" "contrast")))}}
{{document-attrs class=(concat 'prefers-' key '-' value)}}
{{/if}}
{{/each-in}}
</DataSource>
{{#if (not-eq router.currentRouteName 'application')}}
<HashicorpConsul
id="wrapper"