Skip to content

Commit

Permalink
Update theme colors across all projects #8276
Browse files Browse the repository at this point in the history
  • Loading branch information
mhrastegari committed Aug 10, 2024
1 parent 2a34130 commit 83b9249
Show file tree
Hide file tree
Showing 13 changed files with 26 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ BitTheme.init({
if (newTheme === 'dark') {
document.body.classList.add('bit-theme-dark');
document.body.classList.remove('bit-theme-light');
document.querySelector("meta[name=theme-color]")!.setAttribute('content','#0d1117');
document.querySelector("meta[name=theme-color]")!.setAttribute('content','#010409');
} else {
document.body.classList.add('bit-theme-light');
document.body.classList.remove('bit-theme-dark');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,13 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:b="clr-namespace:Microsoft.AspNetCore.Components.WebView.Maui;assembly=Microsoft.AspNetCore.Components.WebView.Maui"
xmlns:client="clr-namespace:Bit.BlazorUI.Demo.Client.Core;assembly=Bit.BlazorUI.Demo.Client.Core"
BackgroundColor="{AppThemeBinding Light={OnPlatform Android=#0D2960,
Default=#ffffff},
Dark={OnPlatform Android=#0D2960,
Default=#000000}}">
BackgroundColor="{AppThemeBinding Light=#ffffff,
Dark=#010409}">

<b:BlazorWebView
x:Name="blazorWebView"
BackgroundColor="{AppThemeBinding Light={OnPlatform Android=#0D2960,
Default=#ffffff},
Dark={OnPlatform Android=#0D2960,
Default=#000000}}"
BackgroundColor="{AppThemeBinding Light=#ffffff,
Dark=#010409}"
HostPage="wwwroot/index.html">
<b:BlazorWebView.RootComponents>
<b:RootComponent ComponentType="{x:Type client:Routes}" Selector="#app-container" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,10 @@ private static void SetupBlazorWebView()
}
}
#elif ANDROID
webView.SetBackgroundColor(Android.Graphics.Color.Transparent);
if (AppInfo.Current.RequestedTheme == AppTheme.Dark)
{
webView.SetBackgroundColor(Android.Graphics.Color.ParseColor("#010409"));
}

webView.OverScrollMode = Android.Views.OverScrollMode.Never;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public async Task ApplyTheme(bool isDark)
window!.DecorView!.SystemUiFlags &= ~Android.Views.SystemUiFlags.LightStatusBar;
}

window.SetStatusBarColor(isDark ? Android.Graphics.Color.ParseColor("#0D1117") : Android.Graphics.Color.White);
window.SetStatusBarColor(isDark ? Android.Graphics.Color.ParseColor("#010409") : Android.Graphics.Color.White);
#elif IOS
var statusBarStyle = isDark ? UIKit.UIStatusBarStyle.LightContent : UIKit.UIStatusBarStyle.DarkContent;
await Device.InvokeOnMainThreadAsync(() =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
gtag('config', 'G-G1ET5L69QF');
</script>
<!-- Google tag -->
<div id="app-container" class="bit-css-clr-bg-primary bit-css-clr-fg-primary">
<div id="app-container" class="bit-css-clr-bg-pri bit-css-clr-fg-pri">
<div class="bit-lds-wrapper">
<div class="bit-lds-grid">
<div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"theme_color": "#2EA3FF",
"related_applications": [],
"name": "bit BlazorUI Demo",
"background_color": "#0D1117",
"background_color": "#010409",
"short_name": "bit BlazorUI Demo",
"prefer_related_applications": false,
"display_override": [ "window-controls-overlay" ],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ BitTheme.init({
if (newTheme === 'dark') {
document.body.classList.add('theme-dark');
document.body.classList.remove('theme-light');
document.querySelector("meta[name=theme-color]")!.setAttribute('content', '#0d1117');
document.querySelector("meta[name=theme-color]")!.setAttribute('content', '#010409');
} else {
document.body.classList.add('theme-light');
document.body.classList.remove('theme-dark');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,13 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:b="clr-namespace:Microsoft.AspNetCore.Components.WebView.Maui;assembly=Microsoft.AspNetCore.Components.WebView.Maui"
xmlns:core="clr-namespace:Boilerplate.Client.Core;assembly=Boilerplate.Client.Core"
BackgroundColor="{AppThemeBinding Light={OnPlatform Android=#0D2960,
Default=#ffffff},
Dark={OnPlatform Android=#0D2960,
Default=#000000}}">
BackgroundColor="{AppThemeBinding Light=#ffffff,
Dark=#010409}">

<b:BlazorWebView
x:Name="blazorWebView"
BackgroundColor="{AppThemeBinding Light={OnPlatform Android=#0D2960,
Default=#ffffff},
Dark={OnPlatform Android=#0D2960,
Default=#000000}}"
BackgroundColor="{AppThemeBinding Light=#ffffff,
Dark=#010409}"
HostPage="wwwroot/index.html">
<b:BlazorWebView.RootComponents>
<b:RootComponent ComponentType="{x:Type core:Routes}" Selector="#app-container" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,10 @@ private static void SetupBlazorWebView()
}
}
#elif Android
webView.SetBackgroundColor(Android.Graphics.Color.Transparent);
if (AppInfo.Current.RequestedTheme == AppTheme.Dark)
{
webView.SetBackgroundColor(Android.Graphics.Color.ParseColor("#010409"));
}

webView.OverScrollMode = Android.Views.OverScrollMode.Never;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public async Task ApplyTheme(bool isDark)
window!.DecorView!.SystemUiFlags &= ~Android.Views.SystemUiFlags.LightStatusBar;
}

window.SetStatusBarColor(isDark ? Android.Graphics.Color.ParseColor("#0D1117") : Android.Graphics.Color.White);
window.SetStatusBarColor(isDark ? Android.Graphics.Color.ParseColor("#010409") : Android.Graphics.Color.White);
#elif IOS
var statusBarStyle = isDark ? UIKit.UIStatusBarStyle.LightContent : UIKit.UIStatusBarStyle.DarkContent;
await Device.InvokeOnMainThreadAsync(() =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@
<!--#endif-->

<style>
body {
background-color: #0D2960;
}

.bit-lds-grid div {
background-color: #123456;
}
Expand Down Expand Up @@ -131,8 +127,8 @@
</style>
</head>

<body class="bit-blazor-hybrid">
<div id="app-container" class="bit-css-clr-bg-primary bit-css-clr-fg-primary">
<body class="bit-css-clr-bg-pri bit-css-clr-fg-pri bit-blazor-hybrid">
<div id="app-container">
<div class="bit-lds-wrapper">
<div class="bit-lds-grid">
<div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<link href="images/icons/bit-icon-512.png" rel="apple-touch-icon" sizes="512x512" />
<link href="manifest.json" rel="manifest" />
</head>
<body class="bit-css-clr-bg-primary bit-css-clr-fg-primary bit-blazor-web">
<body class="bit-css-clr-bg-pri bit-css-clr-fg-pri bit-blazor-web">
<link href="_content/Bit.BlazorUI/styles/bit.blazorui.css" rel="stylesheet" />
<link href="_content/Bit.BlazorUI.Icons/styles/bit.blazorui.icons.css" rel="stylesheet" />
<link href="_content/Bit.BlazorUI.Assets/styles/bit.blazorui.assets.css" rel="stylesheet" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"theme_color": "#2EA3FF",
"related_applications": [],
"name": "bit Boilerplate",
"background_color": "#0D1117",
"background_color": "#010409",
"short_name": "bit Boilerplate",
"prefer_related_applications": false,
"display_override": [ "window-controls-overlay" ],
Expand Down

0 comments on commit 83b9249

Please sign in to comment.