feat: add theme mode support with AppThemeMode enum and AppThemeState service
- Introduced AppThemeMode enum to define theme options: System, Light, Dark. - Updated AppSettingsDocument to include ThemeMode property. - Created AppThemeState service to manage current theme mode and handle changes. - Integrated theme mode handling in CouchbaseLiteAppSettingsService for persistence. - Added JavaScript for theme management in the frontend, supporting system preference detection. - Enhanced CSS with theme variables for consistent styling across light and dark modes. - Updated Playwright tests to ensure sidebar functionality and responsiveness.
This commit is contained in:
parent
b45eac8055
commit
158906fa28
19 changed files with 889 additions and 82 deletions
12
Program.cs
12
Program.cs
|
|
@ -19,6 +19,17 @@ using WorkTracker.Services.WorkDays;
|
|||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
var runningInContainer = string.Equals(
|
||||
Environment.GetEnvironmentVariable("DOTNET_RUNNING_IN_CONTAINER"),
|
||||
"true",
|
||||
StringComparison.OrdinalIgnoreCase)
|
||||
|| File.Exists("/.dockerenv");
|
||||
|
||||
if (!runningInContainer)
|
||||
{
|
||||
builder.WebHost.UseStaticWebAssets();
|
||||
}
|
||||
|
||||
builder.Logging.ClearProviders();
|
||||
builder.Host.UseNLog();
|
||||
|
||||
|
|
@ -60,6 +71,7 @@ builder.Services.Configure<SingleUserOptions>(builder.Configuration.GetSection(S
|
|||
|
||||
builder.Services.AddSingleton<CouchbaseLiteDatabaseProvider>();
|
||||
builder.Services.AddScoped<IAppSettingsService, CouchbaseLiteAppSettingsService>();
|
||||
builder.Services.AddScoped<AppThemeState>();
|
||||
builder.Services.AddSingleton<IAuthService, CouchbaseLiteAuthService>();
|
||||
builder.Services.AddSingleton<IItalianFestivitySource, ItalianFestivitySource>();
|
||||
builder.Services.AddScoped<IWorkDayService, CouchbaseLiteWorkDayService>();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue