forked from dotnet/aspnetcore
-
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.
Overall better HTML semantics by changing the structure of the layout in markup. Visually the rendering is the same as .NET 7. A new Header.razor component was added to accommodate the new layout. Collapsible navigation was rewritten to use a small bit of inline JavaScript instead of the improvised checkbox approach. The menu has proper aria-* attributes and sets focus to the first link when opened, per WCAG guidelines. Removed :focus override, this is bad practice for a11y. Bootstrap 5.3 / themes Updated to Bootstrap 5.3 and embraced Bootstrap throughout the sample layout. This eliminated ~100 lines of unnecessary CSS code and simplified the HTML too. Now MainLayout.razor.css only contains error ui CSS code. Enabled theming via Bootstrap 5.3's CSS variables (aka Custom Properties). This allows runtime theme changes and future proofs the code for Bootstrap vnext. Automatic light/dark mode detected and applied via user preferences. This is a no-code solution enabled by CSS variables. Developers can remove this feature by uncommenting a single line of code in App.razor Made use of inline svg icons. This enables light/dark themes to control icon color. Added --bl-* (opt-in) CSS variables to control the theme of the NavBar component. This allows devs to easily ditch the gradient if they want to customize the template. Code improvements Reduced complexity of CSS code throughout, app.css is much smaller and cleaner. Used updated semantics for mediaqueries. Avoided CSS variables where code could be generated in SampleContent == false templates. Add/Removed blazor-error-ui CSS code based on template interactivity. The markup was removed in the prior version, but not the CSS. Fixes issue: dotnet#50927
- Loading branch information
1 parent
86770ce
commit e5efd62
Showing
40 changed files
with
270 additions
and
292 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
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
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
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
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
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
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
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
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
8 changes: 8 additions & 0 deletions
8
...ProjectTemplates/content/BlazorWeb-CSharp/BlazorWeb-CSharp/Components/Layout/Header.razor
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,8 @@ | ||
<header class="navbar navbar-expand flex-wrap justify-content-between bg-body-tertiary p-0 shadow-sm"> | ||
<a class="navbar-brand ps-3" href="">BlazorWeb-CSharp</a> | ||
<ul class="navbar-nav"> | ||
<li class="nav-item"> | ||
<a class="nav-link" href="https://learn.microsoft.com/aspnet/core/" target="_blank">About</a> | ||
</li> | ||
</ul> | ||
</header> |
20 changes: 20 additions & 0 deletions
20
...ectTemplates/content/BlazorWeb-CSharp/BlazorWeb-CSharp/Components/Layout/Header.razor.css
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,20 @@ | ||
.navbar-brand { | ||
height: 3.5rem; | ||
font-size: 1.1rem; | ||
width: 100%; | ||
display: flex; | ||
align-items: center; | ||
margin: 0; | ||
background-color: var(--bl-blazor-brand-color1); | ||
} | ||
|
||
.navbar-brand, .navbar-brand:hover, .navbar-brand:visited { | ||
color: var(--bl-blazor-brand-contrast-color); | ||
} | ||
|
||
@media (width >= 641px) { | ||
.navbar-brand { | ||
width: 250px; | ||
margin-right: 1rem; | ||
} | ||
} |
22 changes: 10 additions & 12 deletions
22
...ectTemplates/content/BlazorWeb-CSharp/BlazorWeb-CSharp/Components/Layout/MainLayout.razor
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
Oops, something went wrong.