Skip to content

bruegmann/webawesome-blazor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Web Awesome Blazor library

The WebAwesome.AspNetCore.* family of packages provides a set of wrappers for the Web Components by Web Awesome for building Blazor applications.

The code is heavily inspired by Fluent UI Blazor. Docs and docs generation is from Blue Blazor.

Getting Started

Create project

It's recommended to use the official template Blazor Web App to create a new project using Visual Studio or CLI. Make sure, no sample content will be added.

Installation

dotnet add package WebAwesome.AspNetCore.Components

Nuget

Import

Add the following to your _Imports.razor file:

@using WebAwesome.AspNetCore.Components

Register services

Not yet required, but might be changed in the future.

Stylesheet

Web Awesome Blazor comes with its own theme "blue", which is based on the styles of Blue Web. You can embed it like this:

<link
  rel="stylesheet"
  href="_content/WebAwesome.AspNetCore.Components/themes/blue.css"
/>

In .NET 9 or later you can do it like this:

<link rel="stylesheet" href="@Assets["_content/WebAwesome.AspNetCore.Components/themes/blue.css"]">

The library also contains the whole "dist-cdn" directory from the NPM package under "wwwroot/webawesome". So you can embed a theme like this:

<link
  rel="stylesheet"
  href="_content/WebAwesome.AspNetCore.Components/webawesome/styles/themes/default.css"
/>

In .NET 9 or later you can do it like this:

<link rel="stylesheet" href="@Assets["_content/WebAwesome.AspNetCore.Components/webawesome/styles/themes/default.css"]">

Color mode based on system preferences

I implemented a solution, which automatically sets or unsets .wa-dark to the document element (<html>) based media query (prefers-color-scheme: dark). To enable it, just set class .wa-system to the <html> element.

About

Wrappers around Web Components by Web Awesome for Blazor

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published