Skip to content

Instantly share code, notes, and snippets.

@pawelel
Created January 7, 2022 22:38
Show Gist options
  • Save pawelel/fc5be7cb339a8b8350ace0e8d3847968 to your computer and use it in GitHub Desktop.
Save pawelel/fc5be7cb339a8b8350ace0e8d3847968 to your computer and use it in GitHub Desktop.
<MudLayout>
<MudAppBar Elevation="2" Dense="true" Style="@($"background:{Colors.Indigo.Darken2};")">
<MudIconButton Icon="@Icons.Material.Filled.Menu" Color="Color.Inherit" Edge="Edge.Start" OnClick="@ToggleDrawer"/>
<MudButtonGroup Color="Color.Primary" Variant="Variant.Filled">
<MudButton Size="Size.Small" Class="ma-0 rounded-pill">ScenarioTest</MudButton>
</MudButtonGroup>
</MudAppBar>
<MudDrawer @bind-Open="@open" Elevation="1" Style="@($"color:{Colors.Cyan.Lighten3}; background:{Colors.LightBlue.Darken3};")">
<MudDrawerHeader>
<MudText Typo="Typo.h5" Style="@($"color:{Colors.LightBlue.Lighten5};")">TestManager</MudText>
</MudDrawerHeader>
<MudNavLink Href="/service" Icon="@Icons.Outlined.List" IconColor="Color.Tertiary" Style="color:var(--mud-palette-tertiary)">serviceList</MudNavLink>
<MudNavLink Href="/service" Icon="@Icons.Outlined.List" IconColor="Color.Tertiary" Style="@($"color:{Colors.LightBlue.Lighten5};")">servicetestList</MudNavLink>
</MudDrawer>
<MudMainContent Class="px-2 pb-2">
<MudContainer Class="mt-5" Fixed="true" MaxWidth="MaxWidth.False" Style="height: 90% ">
</MudContainer>
</MudMainContent>
</MudLayout>
<MudThemeProvider Theme="currentTheme" />
<MudButton OnClick="@((e) => DarkMode())">Toggle Dark/Light Mode</MudButton>
@code{
protected override void OnInitialized()
{
currentTheme = defaultTheme;
}
void DarkMode()
{
if (currentTheme == defaultTheme)
{
currentTheme = darkTheme;
}
else
{
currentTheme = defaultTheme;
}
}
MudTheme currentTheme = new MudTheme();
MudTheme defaultTheme = new MudTheme()
{
Palette = new Palette()
{
Black = "#272c34"
}
};
MudTheme darkTheme = new MudTheme()
{
Palette = new Palette()
{
Black = "#000",
White = "#000",
Primary = "#000",
PrimaryContrastText = "#000",
Secondary = "#000",
SecondaryContrastText = "#000",
Tertiary = "#000",
TertiaryContrastText = "#000",
Info = "#000",
InfoContrastText = "#000",
Success = "#000",
SuccessContrastText = "#000",
Warning = "#000",
WarningContrastText = "#000",
Error = "#000",
ErrorContrastText = "#000",
Dark = "#000",
DarkContrastText = "#000",
TextPrimary = "#000",
TextSecondary = "#000",
TextDisabled = "#000",
ActionDefault = "#000",
ActionDisabled = "#000",
ActionDisabledBackground = "#000",
Background = "#000",
BackgroundGrey = "#000",
Surface = "#000",
DrawerBackground = "#000",
DrawerText = "#000",
DrawerIcon = "#000",
AppbarBackground = "#000",
AppbarText = "#000",
LinesDefault = "#000",
LinesInputs = "#000",
TableLines = "#000",
TableStriped = "#000",
TableHover = "#000",
Divider = "#000",
DividerLight = "#000"
}
};
bool open = false;
void ToggleDrawer()
{
open = !open;
}
}
<!-- <style>
.mud-nav-link-text {
color: var(--mud-palette-tertiary) !important;
}
</style> -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment