├── .gitignore ├── examples ├── standalone_app │ ├── BlazorApp │ │ ├── wwwroot │ │ │ ├── default_values.min.css │ │ │ ├── default_values.scss │ │ │ ├── css │ │ │ │ ├── manual_injection.min.css │ │ │ │ ├── components │ │ │ │ │ └── Pages │ │ │ │ │ │ ├── Counter.razor.min.css │ │ │ │ │ │ ├── Counter.razor.scss │ │ │ │ │ │ └── Counter.razor.css │ │ │ │ ├── manual_injection.scss │ │ │ │ ├── manual_injection.css │ │ │ │ ├── open-iconic │ │ │ │ │ ├── font │ │ │ │ │ │ ├── fonts │ │ │ │ │ │ │ ├── open-iconic.eot │ │ │ │ │ │ │ ├── open-iconic.otf │ │ │ │ │ │ │ ├── open-iconic.ttf │ │ │ │ │ │ │ └── open-iconic.woff │ │ │ │ │ │ └── css │ │ │ │ │ │ │ └── open-iconic-bootstrap.min.css │ │ │ │ │ ├── ICON-LICENSE │ │ │ │ │ ├── README.md │ │ │ │ │ └── FONT-LICENSE │ │ │ │ ├── site.min.css │ │ │ │ └── site.css │ │ │ ├── default_values.css │ │ │ └── favicon.ico │ │ ├── Pages │ │ │ ├── Counter.razor.scss │ │ │ ├── Index.razor │ │ │ ├── Counter.razor │ │ │ ├── Error.razor │ │ │ ├── _Host.cshtml │ │ │ └── FetchData.razor │ │ ├── appsettings.json │ │ ├── appsettings.Development.json │ │ ├── _Imports.razor │ │ ├── Shared │ │ │ ├── MainLayout.razor │ │ │ ├── SurveyPrompt.razor │ │ │ └── NavMenu.razor │ │ ├── Data │ │ │ ├── WeatherForecast.cs │ │ │ └── WeatherForecastService.cs │ │ ├── App.razor │ │ ├── StandaloneApp.csproj │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── Program.cs │ │ └── Startup.cs │ ├── standalone_app.sln │ └── README.md ├── blazor_app_with_component_project │ ├── BlazorApp │ │ ├── wwwroot │ │ │ ├── default_values.min.css │ │ │ ├── default_values.scss │ │ │ ├── default_values.css │ │ │ ├── css │ │ │ │ ├── component_with_style │ │ │ │ │ ├── ComponentWithUserDefinedColor.razor.min.css │ │ │ │ │ ├── ComponentWithUserDefinedColor.razor.scss │ │ │ │ │ └── ComponentWithUserDefinedColor.razor.css │ │ │ │ ├── open-iconic │ │ │ │ │ ├── font │ │ │ │ │ │ ├── fonts │ │ │ │ │ │ │ ├── open-iconic.eot │ │ │ │ │ │ │ ├── open-iconic.otf │ │ │ │ │ │ │ ├── open-iconic.ttf │ │ │ │ │ │ │ └── open-iconic.woff │ │ │ │ │ │ └── css │ │ │ │ │ │ │ └── open-iconic-bootstrap.min.css │ │ │ │ │ ├── ICON-LICENSE │ │ │ │ │ ├── README.md │ │ │ │ │ └── FONT-LICENSE │ │ │ │ ├── site.min.css │ │ │ │ └── site.css │ │ │ └── favicon.ico │ │ ├── Pages │ │ │ ├── Index.razor │ │ │ ├── Counter.razor │ │ │ ├── Error.razor │ │ │ ├── _Host.cshtml │ │ │ └── FetchData.razor │ │ ├── appsettings.json │ │ ├── appsettings.Development.json │ │ ├── Shared │ │ │ ├── MainLayout.razor │ │ │ ├── SurveyPrompt.razor │ │ │ └── NavMenu.razor │ │ ├── Data │ │ │ ├── WeatherForecast.cs │ │ │ └── WeatherForecastService.cs │ │ ├── App.razor │ │ ├── _Imports.razor │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── Program.cs │ │ ├── BlazorApp.csproj │ │ └── Startup.cs │ ├── ComponentWithStyle │ │ ├── wwwroot │ │ │ ├── default_values.scss │ │ │ ├── css │ │ │ │ └── component_with_style │ │ │ │ │ └── ComponentWithUserDefinedColor.razor.scss │ │ │ ├── background.png │ │ │ ├── exampleJsInterop.js │ │ │ └── styles.css │ │ ├── _Imports.razor │ │ ├── ComponentWithUserDefinedColor.razor.scss │ │ ├── ComponentWithUserDefinedColor.razor │ │ ├── ExampleJsInterop.cs │ │ └── ComponentWithStyle.csproj │ ├── blazor_app_with_component_project.sln │ └── README.md └── component_library │ ├── ConsumerApp │ ├── BlazorApp │ │ ├── wwwroot │ │ │ ├── component_library_config.min.css │ │ │ ├── component_library_config.scss │ │ │ ├── component_library │ │ │ │ ├── ComponentWithUserDefinedColor.razor.min.css │ │ │ │ ├── ComponentWithUserDefinedColor.razor.scss │ │ │ │ └── ComponentWithUserDefinedColor.razor.css │ │ │ ├── component_library_config.css │ │ │ ├── favicon.ico │ │ │ └── css │ │ │ │ ├── open-iconic │ │ │ │ ├── font │ │ │ │ │ ├── fonts │ │ │ │ │ │ ├── open-iconic.eot │ │ │ │ │ │ ├── open-iconic.otf │ │ │ │ │ │ ├── open-iconic.ttf │ │ │ │ │ │ └── open-iconic.woff │ │ │ │ │ └── css │ │ │ │ │ │ └── open-iconic-bootstrap.min.css │ │ │ │ ├── ICON-LICENSE │ │ │ │ ├── README.md │ │ │ │ └── FONT-LICENSE │ │ │ │ ├── site.min.css │ │ │ │ └── site.css │ │ ├── Pages │ │ │ ├── Index.razor │ │ │ ├── Counter.razor │ │ │ ├── Error.razor │ │ │ ├── _Host.cshtml │ │ │ └── FetchData.razor │ │ ├── appsettings.json │ │ ├── appsettings.Development.json │ │ ├── Shared │ │ │ ├── MainLayout.razor │ │ │ ├── SurveyPrompt.razor │ │ │ └── NavMenu.razor │ │ ├── Data │ │ │ ├── WeatherForecast.cs │ │ │ └── WeatherForecastService.cs │ │ ├── App.razor │ │ ├── _Imports.razor │ │ ├── ConsumerApp.csproj │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── Program.cs │ │ └── Startup.cs │ └── consumer_app.sln │ ├── ComponentLibrary │ ├── ComponentLibrary │ │ ├── wwwroot │ │ │ ├── component_library_config.scss │ │ │ └── component_library │ │ │ │ └── ComponentWithUserDefinedColor.razor.scss │ │ ├── ComponentWithUserDefinedColor.razor.scss │ │ ├── ComponentWithUserDefinedColor.razor │ │ ├── ComponentLibrary.csproj │ │ └── build │ │ │ └── ComponentLibrary.targets │ └── component_library.sln │ └── README.md ├── LazyStyleSheet ├── IStyleSheetService.cs ├── StyleSheets.razor ├── ServiceExtension.cs ├── LazyStyleSheet.csproj ├── StyleSheetService.cs ├── Stylesheet.cs ├── StyleSheets.razor.cs ├── package.csproj └── build │ └── Excubo.Blazor.LazyStyleSheet.targets ├── Tests_LazyStyleSheet ├── LazyLoadTest.cs └── Tests_LazyStyleSheet.csproj ├── .github └── workflows │ └── deploy-to-nuget.yml ├── LICENSE ├── lazy_style_sheet.sln └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | .editorconfig 2 | .vs 3 | bin 4 | obj 5 | *.csproj.user -------------------------------------------------------------------------------- /examples/standalone_app/BlazorApp/wwwroot/default_values.min.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/standalone_app/BlazorApp/wwwroot/default_values.scss: -------------------------------------------------------------------------------- 1 | $variable:blue; -------------------------------------------------------------------------------- /examples/blazor_app_with_component_project/BlazorApp/wwwroot/default_values.min.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/component_library/ConsumerApp/BlazorApp/wwwroot/component_library_config.min.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/blazor_app_with_component_project/BlazorApp/wwwroot/default_values.scss: -------------------------------------------------------------------------------- 1 | $variable:blue; -------------------------------------------------------------------------------- /examples/standalone_app/BlazorApp/wwwroot/css/manual_injection.min.css: -------------------------------------------------------------------------------- 1 | .italicised{font-style:italic;} -------------------------------------------------------------------------------- /examples/blazor_app_with_component_project/ComponentWithStyle/wwwroot/default_values.scss: -------------------------------------------------------------------------------- 1 | $variable:red; 2 | -------------------------------------------------------------------------------- /examples/component_library/ConsumerApp/BlazorApp/wwwroot/component_library_config.scss: -------------------------------------------------------------------------------- 1 | $variable:green; 2 | -------------------------------------------------------------------------------- /examples/standalone_app/BlazorApp/wwwroot/css/components/Pages/Counter.razor.min.css: -------------------------------------------------------------------------------- 1 | .colored{color:#00f;} -------------------------------------------------------------------------------- /examples/standalone_app/BlazorApp/wwwroot/default_values.css: -------------------------------------------------------------------------------- 1 | 2 | /*# sourceMappingURL=default_values.scss */ -------------------------------------------------------------------------------- /examples/component_library/ComponentLibrary/ComponentLibrary/wwwroot/component_library_config.scss: -------------------------------------------------------------------------------- 1 | $variable:red; 2 | -------------------------------------------------------------------------------- /examples/standalone_app/BlazorApp/wwwroot/css/manual_injection.scss: -------------------------------------------------------------------------------- 1 | .italicised { 2 | font-style: italic 3 | } 4 | -------------------------------------------------------------------------------- /examples/blazor_app_with_component_project/BlazorApp/wwwroot/default_values.css: -------------------------------------------------------------------------------- 1 | 2 | /*# sourceMappingURL=default_values.scss */ -------------------------------------------------------------------------------- /examples/standalone_app/BlazorApp/Pages/Counter.razor.scss: -------------------------------------------------------------------------------- 1 | @import '../../../default_values.scss'; 2 | .colored { 3 | color: $variable 4 | } 5 | -------------------------------------------------------------------------------- /examples/component_library/ConsumerApp/BlazorApp/wwwroot/component_library/ComponentWithUserDefinedColor.razor.min.css: -------------------------------------------------------------------------------- 1 | .component-style{color:#008000;} -------------------------------------------------------------------------------- /examples/blazor_app_with_component_project/BlazorApp/wwwroot/css/component_with_style/ComponentWithUserDefinedColor.razor.min.css: -------------------------------------------------------------------------------- 1 | .component-style{color:#00f;} -------------------------------------------------------------------------------- /examples/blazor_app_with_component_project/ComponentWithStyle/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using Microsoft.AspNetCore.Components.Web 2 | @using Excubo.Blazor.LazyStyleSheet -------------------------------------------------------------------------------- /examples/component_library/ConsumerApp/BlazorApp/wwwroot/component_library_config.css: -------------------------------------------------------------------------------- 1 | 2 | /*# sourceMappingURL=wwwroot\component_library_config.css.map */ -------------------------------------------------------------------------------- /examples/standalone_app/BlazorApp/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/excubo-ag/Blazor.LazyStyleSheet/HEAD/examples/standalone_app/BlazorApp/wwwroot/favicon.ico -------------------------------------------------------------------------------- /examples/standalone_app/BlazorApp/wwwroot/css/components/Pages/Counter.razor.scss: -------------------------------------------------------------------------------- 1 | @import '../../../default_values.scss'; 2 | .colored { 3 | color: $variable 4 | } 5 | -------------------------------------------------------------------------------- /examples/standalone_app/BlazorApp/wwwroot/css/manual_injection.css: -------------------------------------------------------------------------------- 1 | .italicised { 2 | font-style: italic; } 3 | /*# sourceMappingURL=wwwroot\css\manual_injection.css.map */ -------------------------------------------------------------------------------- /examples/blazor_app_with_component_project/ComponentWithStyle/ComponentWithUserDefinedColor.razor.scss: -------------------------------------------------------------------------------- 1 | @import '../../default_values.scss'; 2 | .component-style { 3 | color: $variable 4 | } -------------------------------------------------------------------------------- /examples/standalone_app/BlazorApp/wwwroot/css/components/Pages/Counter.razor.css: -------------------------------------------------------------------------------- 1 | .colored { 2 | color: blue; } 3 | /*# sourceMappingURL=wwwroot\css\components\Pages\Counter.razor.css.map */ -------------------------------------------------------------------------------- /examples/component_library/ComponentLibrary/ComponentLibrary/ComponentWithUserDefinedColor.razor.scss: -------------------------------------------------------------------------------- 1 | @import '../component_library_config.scss'; 2 | .component-style { 3 | color: $variable 4 | } -------------------------------------------------------------------------------- /examples/component_library/ConsumerApp/BlazorApp/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/excubo-ag/Blazor.LazyStyleSheet/HEAD/examples/component_library/ConsumerApp/BlazorApp/wwwroot/favicon.ico -------------------------------------------------------------------------------- /examples/blazor_app_with_component_project/BlazorApp/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/excubo-ag/Blazor.LazyStyleSheet/HEAD/examples/blazor_app_with_component_project/BlazorApp/wwwroot/favicon.ico -------------------------------------------------------------------------------- /examples/component_library/ConsumerApp/BlazorApp/wwwroot/component_library/ComponentWithUserDefinedColor.razor.scss: -------------------------------------------------------------------------------- 1 | @import '../component_library_config.scss'; 2 | .component-style { 3 | color: $variable 4 | } -------------------------------------------------------------------------------- /examples/blazor_app_with_component_project/BlazorApp/wwwroot/css/component_with_style/ComponentWithUserDefinedColor.razor.scss: -------------------------------------------------------------------------------- 1 | @import '../../default_values.scss'; 2 | .component-style { 3 | color: $variable 4 | } -------------------------------------------------------------------------------- /examples/blazor_app_with_component_project/ComponentWithStyle/wwwroot/css/component_with_style/ComponentWithUserDefinedColor.razor.scss: -------------------------------------------------------------------------------- 1 | @import '../../default_values.scss'; 2 | .component-style { 3 | color: $variable 4 | } -------------------------------------------------------------------------------- /examples/component_library/ComponentLibrary/ComponentLibrary/wwwroot/component_library/ComponentWithUserDefinedColor.razor.scss: -------------------------------------------------------------------------------- 1 | @import '../component_library_config.scss'; 2 | .component-style { 3 | color: $variable 4 | } -------------------------------------------------------------------------------- /examples/blazor_app_with_component_project/ComponentWithStyle/wwwroot/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/excubo-ag/Blazor.LazyStyleSheet/HEAD/examples/blazor_app_with_component_project/ComponentWithStyle/wwwroot/background.png -------------------------------------------------------------------------------- /examples/standalone_app/BlazorApp/wwwroot/css/open-iconic/font/fonts/open-iconic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/excubo-ag/Blazor.LazyStyleSheet/HEAD/examples/standalone_app/BlazorApp/wwwroot/css/open-iconic/font/fonts/open-iconic.eot -------------------------------------------------------------------------------- /examples/standalone_app/BlazorApp/wwwroot/css/open-iconic/font/fonts/open-iconic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/excubo-ag/Blazor.LazyStyleSheet/HEAD/examples/standalone_app/BlazorApp/wwwroot/css/open-iconic/font/fonts/open-iconic.otf -------------------------------------------------------------------------------- /examples/standalone_app/BlazorApp/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/excubo-ag/Blazor.LazyStyleSheet/HEAD/examples/standalone_app/BlazorApp/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf -------------------------------------------------------------------------------- /examples/standalone_app/BlazorApp/wwwroot/css/open-iconic/font/fonts/open-iconic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/excubo-ag/Blazor.LazyStyleSheet/HEAD/examples/standalone_app/BlazorApp/wwwroot/css/open-iconic/font/fonts/open-iconic.woff -------------------------------------------------------------------------------- /examples/component_library/ConsumerApp/BlazorApp/wwwroot/component_library/ComponentWithUserDefinedColor.razor.css: -------------------------------------------------------------------------------- 1 | .component-style { 2 | color: green; } 3 | /*# sourceMappingURL=wwwroot\component_library\ComponentWithUserDefinedColor.razor.css.map */ -------------------------------------------------------------------------------- /examples/blazor_app_with_component_project/BlazorApp/Pages/Index.razor: -------------------------------------------------------------------------------- 1 | @page "/" 2 | 3 |

Hello, world!

4 | 5 | Welcome to your new app. 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /examples/component_library/ConsumerApp/BlazorApp/Pages/Index.razor: -------------------------------------------------------------------------------- 1 | @page "/" 2 | 3 |

Hello, world!

4 | 5 | Welcome to your new app. 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /examples/component_library/ConsumerApp/BlazorApp/wwwroot/css/open-iconic/font/fonts/open-iconic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/excubo-ag/Blazor.LazyStyleSheet/HEAD/examples/component_library/ConsumerApp/BlazorApp/wwwroot/css/open-iconic/font/fonts/open-iconic.eot -------------------------------------------------------------------------------- /examples/component_library/ConsumerApp/BlazorApp/wwwroot/css/open-iconic/font/fonts/open-iconic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/excubo-ag/Blazor.LazyStyleSheet/HEAD/examples/component_library/ConsumerApp/BlazorApp/wwwroot/css/open-iconic/font/fonts/open-iconic.otf -------------------------------------------------------------------------------- /examples/component_library/ConsumerApp/BlazorApp/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/excubo-ag/Blazor.LazyStyleSheet/HEAD/examples/component_library/ConsumerApp/BlazorApp/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf -------------------------------------------------------------------------------- /examples/component_library/ConsumerApp/BlazorApp/wwwroot/css/open-iconic/font/fonts/open-iconic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/excubo-ag/Blazor.LazyStyleSheet/HEAD/examples/component_library/ConsumerApp/BlazorApp/wwwroot/css/open-iconic/font/fonts/open-iconic.woff -------------------------------------------------------------------------------- /examples/blazor_app_with_component_project/BlazorApp/wwwroot/css/component_with_style/ComponentWithUserDefinedColor.razor.css: -------------------------------------------------------------------------------- 1 | .component-style { 2 | color: blue; } 3 | /*# sourceMappingURL=wwwroot\css\component_with_style\ComponentWithUserDefinedColor.razor.css.map */ -------------------------------------------------------------------------------- /examples/blazor_app_with_component_project/BlazorApp/wwwroot/css/open-iconic/font/fonts/open-iconic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/excubo-ag/Blazor.LazyStyleSheet/HEAD/examples/blazor_app_with_component_project/BlazorApp/wwwroot/css/open-iconic/font/fonts/open-iconic.eot -------------------------------------------------------------------------------- /examples/blazor_app_with_component_project/BlazorApp/wwwroot/css/open-iconic/font/fonts/open-iconic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/excubo-ag/Blazor.LazyStyleSheet/HEAD/examples/blazor_app_with_component_project/BlazorApp/wwwroot/css/open-iconic/font/fonts/open-iconic.otf -------------------------------------------------------------------------------- /examples/blazor_app_with_component_project/BlazorApp/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/excubo-ag/Blazor.LazyStyleSheet/HEAD/examples/blazor_app_with_component_project/BlazorApp/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf -------------------------------------------------------------------------------- /examples/blazor_app_with_component_project/BlazorApp/wwwroot/css/open-iconic/font/fonts/open-iconic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/excubo-ag/Blazor.LazyStyleSheet/HEAD/examples/blazor_app_with_component_project/BlazorApp/wwwroot/css/open-iconic/font/fonts/open-iconic.woff -------------------------------------------------------------------------------- /examples/standalone_app/BlazorApp/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /examples/component_library/ConsumerApp/BlazorApp/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /examples/standalone_app/BlazorApp/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "DetailedErrors": true, 3 | "Logging": { 4 | "LogLevel": { 5 | "Default": "Information", 6 | "Microsoft": "Warning", 7 | "Microsoft.Hosting.Lifetime": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/blazor_app_with_component_project/BlazorApp/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /examples/component_library/ConsumerApp/BlazorApp/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "DetailedErrors": true, 3 | "Logging": { 4 | "LogLevel": { 5 | "Default": "Information", 6 | "Microsoft": "Warning", 7 | "Microsoft.Hosting.Lifetime": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/standalone_app/BlazorApp/Pages/Index.razor: -------------------------------------------------------------------------------- 1 | @page "/" 2 | 3 | 4 | 5 |

Hello, world!

6 | 7 | Welcome to your new app. 8 | 9 | 10 | -------------------------------------------------------------------------------- /examples/blazor_app_with_component_project/BlazorApp/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "DetailedErrors": true, 3 | "Logging": { 4 | "LogLevel": { 5 | "Default": "Information", 6 | "Microsoft": "Warning", 7 | "Microsoft.Hosting.Lifetime": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /LazyStyleSheet/IStyleSheetService.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.ObjectModel; 2 | 3 | namespace Excubo.Blazor.LazyStyleSheet 4 | { 5 | public interface IStyleSheetService 6 | { 7 | ObservableCollection RequiredStyleSheets { get; } 8 | void Add(string url); 9 | } 10 | } -------------------------------------------------------------------------------- /examples/component_library/ComponentLibrary/ComponentLibrary/ComponentWithUserDefinedColor.razor: -------------------------------------------------------------------------------- 1 | 2 |
3 | This Blazor component is defined in the ComponentLibrary package. 4 |
5 | -------------------------------------------------------------------------------- /examples/blazor_app_with_component_project/ComponentWithStyle/ComponentWithUserDefinedColor.razor: -------------------------------------------------------------------------------- 1 | 2 |
3 | This Blazor component is defined in the ComponentWithStyle package. 4 |
5 | -------------------------------------------------------------------------------- /examples/blazor_app_with_component_project/ComponentWithStyle/wwwroot/exampleJsInterop.js: -------------------------------------------------------------------------------- 1 | // This file is to show how a library package may provide JavaScript interop features 2 | // wrapped in a .NET API 3 | 4 | window.exampleJsFunctions = { 5 | showPrompt: function (message) { 6 | return prompt(message, 'Type anything here'); 7 | } 8 | }; 9 | -------------------------------------------------------------------------------- /examples/blazor_app_with_component_project/ComponentWithStyle/wwwroot/styles.css: -------------------------------------------------------------------------------- 1 | /* 2 | This file is to show how CSS and other static resources (such as images) can be 3 | used from a library project/package. 4 | */ 5 | 6 | .my-component { 7 | border: 2px dashed red; 8 | padding: 1em; 9 | margin: 1em 0; 10 | background-image: url('background.png'); 11 | } 12 | -------------------------------------------------------------------------------- /examples/standalone_app/BlazorApp/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using Microsoft.AspNetCore.Authorization 3 | @using Microsoft.AspNetCore.Components.Authorization 4 | @using Microsoft.AspNetCore.Components.Forms 5 | @using Microsoft.AspNetCore.Components.Routing 6 | @using Microsoft.AspNetCore.Components.Web 7 | @using Microsoft.JSInterop 8 | @using BlazorApp 9 | @using BlazorApp.Shared -------------------------------------------------------------------------------- /examples/blazor_app_with_component_project/BlazorApp/Pages/Counter.razor: -------------------------------------------------------------------------------- 1 | @page "/counter" 2 | 3 |

Counter

4 | 5 |

Current count: @currentCount

6 | 7 | 8 | 9 | @code { 10 | private int currentCount = 0; 11 | 12 | private void IncrementCount() 13 | { 14 | currentCount++; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /examples/component_library/ConsumerApp/BlazorApp/Pages/Counter.razor: -------------------------------------------------------------------------------- 1 | @page "/counter" 2 | 3 |

Counter

4 | 5 |

Current count: @currentCount

6 | 7 | 8 | 9 | @code { 10 | private int currentCount = 0; 11 | 12 | private void IncrementCount() 13 | { 14 | currentCount++; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /examples/standalone_app/BlazorApp/Shared/MainLayout.razor: -------------------------------------------------------------------------------- 1 | @inherits LayoutComponentBase 2 | 3 | 6 | 7 |
8 |
9 | About 10 |
11 | 12 |
13 | @Body 14 |
15 |
16 | -------------------------------------------------------------------------------- /examples/standalone_app/BlazorApp/Pages/Counter.razor: -------------------------------------------------------------------------------- 1 | @page "/counter" 2 | 3 |

Counter

4 | 5 |

Current count: @currentCount

6 | 7 | 8 | 9 | @code { 10 | private int currentCount = 0; 11 | 12 | private void IncrementCount() 13 | { 14 | currentCount++; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /examples/blazor_app_with_component_project/BlazorApp/Shared/MainLayout.razor: -------------------------------------------------------------------------------- 1 | @inherits LayoutComponentBase 2 | 3 | 6 | 7 |
8 |
9 | About 10 |
11 | 12 |
13 | @Body 14 |
15 |
16 | -------------------------------------------------------------------------------- /examples/component_library/ConsumerApp/BlazorApp/Shared/MainLayout.razor: -------------------------------------------------------------------------------- 1 | @inherits LayoutComponentBase 2 | 3 | 6 | 7 |
8 |
9 | About 10 |
11 | 12 |
13 | @Body 14 |
15 |
16 | -------------------------------------------------------------------------------- /examples/standalone_app/BlazorApp/Data/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace BlazorApp.Data 4 | { 5 | public class WeatherForecast 6 | { 7 | public DateTime Date { get; set; } 8 | 9 | public int TemperatureC { get; set; } 10 | 11 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 12 | 13 | public string Summary { get; set; } 14 | } 15 | } -------------------------------------------------------------------------------- /examples/standalone_app/BlazorApp/App.razor: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |

Sorry, there's nothing at this address.

9 |
10 |
11 |
-------------------------------------------------------------------------------- /examples/component_library/ConsumerApp/BlazorApp/Data/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace BlazorApp.Data 4 | { 5 | public class WeatherForecast 6 | { 7 | public DateTime Date { get; set; } 8 | 9 | public int TemperatureC { get; set; } 10 | 11 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 12 | 13 | public string Summary { get; set; } 14 | } 15 | } -------------------------------------------------------------------------------- /examples/blazor_app_with_component_project/BlazorApp/Data/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace BlazorApp.Data 4 | { 5 | public class WeatherForecast 6 | { 7 | public DateTime Date { get; set; } 8 | 9 | public int TemperatureC { get; set; } 10 | 11 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 12 | 13 | public string Summary { get; set; } 14 | } 15 | } -------------------------------------------------------------------------------- /examples/component_library/ConsumerApp/BlazorApp/App.razor: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |

Sorry, there's nothing at this address.

9 |
10 |
11 |
-------------------------------------------------------------------------------- /examples/component_library/ConsumerApp/BlazorApp/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using Microsoft.AspNetCore.Authorization 3 | @using Microsoft.AspNetCore.Components.Authorization 4 | @using Microsoft.AspNetCore.Components.Forms 5 | @using Microsoft.AspNetCore.Components.Routing 6 | @using Microsoft.AspNetCore.Components.Web 7 | @using Microsoft.JSInterop 8 | @using BlazorApp 9 | @using BlazorApp.Shared 10 | @using ComponentLibrary -------------------------------------------------------------------------------- /examples/blazor_app_with_component_project/BlazorApp/App.razor: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |

Sorry, there's nothing at this address.

9 |
10 |
11 |
-------------------------------------------------------------------------------- /examples/blazor_app_with_component_project/BlazorApp/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using Microsoft.AspNetCore.Authorization 3 | @using Microsoft.AspNetCore.Components.Authorization 4 | @using Microsoft.AspNetCore.Components.Forms 5 | @using Microsoft.AspNetCore.Components.Routing 6 | @using Microsoft.AspNetCore.Components.Web 7 | @using Microsoft.JSInterop 8 | @using BlazorApp 9 | @using BlazorApp.Shared 10 | @using ComponentWithStyle -------------------------------------------------------------------------------- /LazyStyleSheet/StyleSheets.razor: -------------------------------------------------------------------------------- 1 | @inject IStyleSheetService StyleSheetService 2 | 3 | @foreach (var style_sheet in StyleSheetService.RequiredStyleSheets) 4 | { 5 | 6 | } 7 | 8 | @code { 9 | protected override Task OnInitializedAsync() 10 | { 11 | StyleSheetService.RequiredStyleSheets.CollectionChanged += (_, __) => StateHasChanged(); 12 | return base.OnInitializedAsync(); 13 | } 14 | } -------------------------------------------------------------------------------- /examples/blazor_app_with_component_project/ComponentWithStyle/ExampleJsInterop.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.JSInterop; 2 | using System.Threading.Tasks; 3 | 4 | namespace ComponentWithStyle 5 | { 6 | public class ExampleJsInterop 7 | { 8 | public static ValueTask Prompt(IJSRuntime jsRuntime, string message) 9 | { 10 | // Implemented in exampleJsInterop.js 11 | return jsRuntime.InvokeAsync( 12 | "exampleJsFunctions.showPrompt", 13 | message); 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /examples/component_library/ConsumerApp/BlazorApp/ConsumerApp.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | netcoreapp3.1 4 | BlazorApp 5 | false 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /examples/standalone_app/BlazorApp/StandaloneApp.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | netcoreapp3.1 4 | BlazorApp 5 | false 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /examples/standalone_app/BlazorApp/Shared/SurveyPrompt.razor: -------------------------------------------------------------------------------- 1 | 11 | 12 | @code { 13 | // Demonstrates how a parent component can supply parameters 14 | [Parameter] 15 | public string Title { get; set; } 16 | } 17 | -------------------------------------------------------------------------------- /LazyStyleSheet/ServiceExtension.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.DependencyInjection; 2 | using System; 3 | 4 | namespace Excubo.Blazor.LazyStyleSheet 5 | { 6 | public static class ServiceExtension 7 | { 8 | [Obsolete("This can be removed! Adding style sheets just became a whole lot easier. See https://github.com/excubo-ag/Blazor.LazyStyleSheet for more details.")] 9 | public static IServiceCollection AddStyleSheetLazyLoading(this IServiceCollection services) 10 | { 11 | return services 12 | .AddScoped(); 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /examples/component_library/ConsumerApp/BlazorApp/Shared/SurveyPrompt.razor: -------------------------------------------------------------------------------- 1 | 11 | 12 | @code { 13 | // Demonstrates how a parent component can supply parameters 14 | [Parameter] 15 | public string Title { get; set; } 16 | } 17 | -------------------------------------------------------------------------------- /examples/blazor_app_with_component_project/BlazorApp/Shared/SurveyPrompt.razor: -------------------------------------------------------------------------------- 1 | 11 | 12 | @code { 13 | // Demonstrates how a parent component can supply parameters 14 | [Parameter] 15 | public string Title { get; set; } 16 | } 17 | -------------------------------------------------------------------------------- /examples/standalone_app/BlazorApp/Pages/Error.razor: -------------------------------------------------------------------------------- 1 | @page "/error" 2 | 3 | 4 |

Error.

5 |

An error occurred while processing your request.

6 | 7 |

Development Mode

8 |

9 | Swapping to Development environment will display more detailed information about the error that occurred. 10 |

11 |

12 | The Development environment shouldn't be enabled for deployed applications. 13 | It can result in displaying sensitive information from exceptions to end users. 14 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 15 | and restarting the app. 16 |

-------------------------------------------------------------------------------- /examples/component_library/ConsumerApp/BlazorApp/Pages/Error.razor: -------------------------------------------------------------------------------- 1 | @page "/error" 2 | 3 | 4 |

Error.

5 |

An error occurred while processing your request.

6 | 7 |

Development Mode

8 |

9 | Swapping to Development environment will display more detailed information about the error that occurred. 10 |

11 |

12 | The Development environment shouldn't be enabled for deployed applications. 13 | It can result in displaying sensitive information from exceptions to end users. 14 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 15 | and restarting the app. 16 |

-------------------------------------------------------------------------------- /examples/blazor_app_with_component_project/BlazorApp/Pages/Error.razor: -------------------------------------------------------------------------------- 1 | @page "/error" 2 | 3 | 4 |

Error.

5 |

An error occurred while processing your request.

6 | 7 |

Development Mode

8 |

9 | Swapping to Development environment will display more detailed information about the error that occurred. 10 |

11 |

12 | The Development environment shouldn't be enabled for deployed applications. 13 | It can result in displaying sensitive information from exceptions to end users. 14 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 15 | and restarting the app. 16 |

-------------------------------------------------------------------------------- /examples/standalone_app/BlazorApp/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:62545", 7 | "sslPort": 44350 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "BlazorApp": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 22 | "environmentVariables": { 23 | "ASPNETCORE_ENVIRONMENT": "Development" 24 | } 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /examples/component_library/ConsumerApp/BlazorApp/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:62545", 7 | "sslPort": 44350 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "BlazorApp": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 22 | "environmentVariables": { 23 | "ASPNETCORE_ENVIRONMENT": "Development" 24 | } 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /examples/blazor_app_with_component_project/BlazorApp/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:62545", 7 | "sslPort": 44350 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "BlazorApp": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 22 | "environmentVariables": { 23 | "ASPNETCORE_ENVIRONMENT": "Development" 24 | } 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /LazyStyleSheet/LazyStyleSheet.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp3.1;netstandard2.0;netstandard2.1 5 | 3.0 6 | Excubo.Blazor.LazyStyleSheet 7 | Excubo.Blazor.LazyStyleSheet 8 | latest 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /LazyStyleSheet/StyleSheetService.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Components; 2 | using Microsoft.JSInterop; 3 | using System.Collections.ObjectModel; 4 | using System.Threading.Tasks; 5 | 6 | [assembly: System.Runtime.CompilerServices.InternalsVisibleTo("Excubo.Blazor.Tests_LazyStyleSheet")] 7 | namespace Excubo.Blazor.LazyStyleSheet 8 | { 9 | internal class StyleSheetService : IStyleSheetService 10 | { 11 | public ObservableCollection RequiredStyleSheets { get; } = new ObservableCollection(); 12 | public void Add(string url) 13 | { 14 | lock (RequiredStyleSheets) 15 | { 16 | if (!RequiredStyleSheets.Contains(url)) 17 | { 18 | RequiredStyleSheets.Add(url); 19 | } 20 | } 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /examples/blazor_app_with_component_project/ComponentWithStyle/ComponentWithStyle.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | netstandard2.0 4 | 3.0 5 | css/component_with_style 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /examples/standalone_app/BlazorApp/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore; 2 | using Microsoft.AspNetCore.Hosting; 3 | using Microsoft.Extensions.Configuration; 4 | using Microsoft.Extensions.Hosting; 5 | using Microsoft.Extensions.Logging; 6 | using System; 7 | using System.Collections.Generic; 8 | using System.IO; 9 | using System.Linq; 10 | using System.Threading.Tasks; 11 | 12 | namespace BlazorApp 13 | { 14 | public class Program 15 | { 16 | public static void Main(string[] args) 17 | { 18 | CreateHostBuilder(args).Build().Run(); 19 | } 20 | 21 | public static IHostBuilder CreateHostBuilder(string[] args) => 22 | Host.CreateDefaultBuilder(args) 23 | .ConfigureWebHostDefaults(webBuilder => 24 | { 25 | webBuilder.UseStartup(); 26 | }); 27 | } 28 | } -------------------------------------------------------------------------------- /examples/component_library/ConsumerApp/BlazorApp/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore; 2 | using Microsoft.AspNetCore.Hosting; 3 | using Microsoft.Extensions.Configuration; 4 | using Microsoft.Extensions.Hosting; 5 | using Microsoft.Extensions.Logging; 6 | using System; 7 | using System.Collections.Generic; 8 | using System.IO; 9 | using System.Linq; 10 | using System.Threading.Tasks; 11 | 12 | namespace BlazorApp 13 | { 14 | public class Program 15 | { 16 | public static void Main(string[] args) 17 | { 18 | CreateHostBuilder(args).Build().Run(); 19 | } 20 | 21 | public static IHostBuilder CreateHostBuilder(string[] args) => 22 | Host.CreateDefaultBuilder(args) 23 | .ConfigureWebHostDefaults(webBuilder => 24 | { 25 | webBuilder.UseStartup(); 26 | }); 27 | } 28 | } -------------------------------------------------------------------------------- /examples/blazor_app_with_component_project/BlazorApp/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore; 2 | using Microsoft.AspNetCore.Hosting; 3 | using Microsoft.Extensions.Configuration; 4 | using Microsoft.Extensions.Hosting; 5 | using Microsoft.Extensions.Logging; 6 | using System; 7 | using System.Collections.Generic; 8 | using System.IO; 9 | using System.Linq; 10 | using System.Threading.Tasks; 11 | 12 | namespace BlazorApp 13 | { 14 | public class Program 15 | { 16 | public static void Main(string[] args) 17 | { 18 | CreateHostBuilder(args).Build().Run(); 19 | } 20 | 21 | public static IHostBuilder CreateHostBuilder(string[] args) => 22 | Host.CreateDefaultBuilder(args) 23 | .ConfigureWebHostDefaults(webBuilder => 24 | { 25 | webBuilder.UseStartup(); 26 | }); 27 | } 28 | } -------------------------------------------------------------------------------- /examples/standalone_app/BlazorApp/Data/WeatherForecastService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Threading.Tasks; 4 | 5 | namespace BlazorApp.Data 6 | { 7 | public class WeatherForecastService 8 | { 9 | private static readonly string[] Summaries = new[] 10 | { 11 | "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" 12 | }; 13 | 14 | public Task GetForecastAsync(DateTime startDate) 15 | { 16 | var rng = new Random(); 17 | return Task.FromResult(Enumerable.Range(1, 5).Select(index => new WeatherForecast 18 | { 19 | Date = startDate.AddDays(index), 20 | TemperatureC = rng.Next(-20, 55), 21 | Summary = Summaries[rng.Next(Summaries.Length)] 22 | }).ToArray()); 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /examples/blazor_app_with_component_project/BlazorApp/BlazorApp.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | netcoreapp3.1 4 | false 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /examples/component_library/ConsumerApp/BlazorApp/Data/WeatherForecastService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Threading.Tasks; 4 | 5 | namespace BlazorApp.Data 6 | { 7 | public class WeatherForecastService 8 | { 9 | private static readonly string[] Summaries = new[] 10 | { 11 | "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" 12 | }; 13 | 14 | public Task GetForecastAsync(DateTime startDate) 15 | { 16 | var rng = new Random(); 17 | return Task.FromResult(Enumerable.Range(1, 5).Select(index => new WeatherForecast 18 | { 19 | Date = startDate.AddDays(index), 20 | TemperatureC = rng.Next(-20, 55), 21 | Summary = Summaries[rng.Next(Summaries.Length)] 22 | }).ToArray()); 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /examples/blazor_app_with_component_project/BlazorApp/Data/WeatherForecastService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Threading.Tasks; 4 | 5 | namespace BlazorApp.Data 6 | { 7 | public class WeatherForecastService 8 | { 9 | private static readonly string[] Summaries = new[] 10 | { 11 | "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" 12 | }; 13 | 14 | public Task GetForecastAsync(DateTime startDate) 15 | { 16 | var rng = new Random(); 17 | return Task.FromResult(Enumerable.Range(1, 5).Select(index => new WeatherForecast 18 | { 19 | Date = startDate.AddDays(index), 20 | TemperatureC = rng.Next(-20, 55), 21 | Summary = Summaries[rng.Next(Summaries.Length)] 22 | }).ToArray()); 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /Tests_LazyStyleSheet/LazyLoadTest.cs: -------------------------------------------------------------------------------- 1 | using Bunit; 2 | using Bunit.JSInterop; 3 | using Excubo.Blazor.LazyStyleSheet; 4 | using NUnit.Framework; 5 | using System.Linq; 6 | 7 | namespace Excubo.Blazor.Tests_LazyStyleSheet 8 | { 9 | public class LazyLoadTest : Bunit.TestContext 10 | { 11 | [Test] 12 | public void Test() 13 | { 14 | IRenderedComponent? cut = null; 15 | JSInterop.SetupVoid("eval", (i) => true); 16 | Assert.DoesNotThrow(() => cut = RenderComponent((Name: "Src", Value: "hello.css"))); 17 | CollectionAssert.IsNotEmpty(JSInterop.Invocations); 18 | var verification = JSInterop.VerifyInvoke("eval"); 19 | Assert.IsNotNull(verification); 20 | CollectionAssert.IsNotEmpty(verification.Arguments); 21 | Assert.IsTrue(verification.Arguments.First()!.ToString()!.Contains("hello.css")); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /.github/workflows/deploy-to-nuget.yml: -------------------------------------------------------------------------------- 1 | name: Deploy nupkg 2 | 3 | env: 4 | dotnet_version: 3.1 5 | project_name: "LazyStyleSheet/LazyStyleSheet.csproj" 6 | 7 | on: 8 | push: 9 | branches: [ main ] 10 | 11 | jobs: 12 | build_and_deploy: 13 | if: "contains(github.event.head_commit.message, '[deploy]')" 14 | runs-on: ubuntu-latest 15 | 16 | steps: 17 | - uses: actions/checkout@v4 18 | - name: Setup .NET Core 19 | uses: actions/setup-dotnet@v3 20 | with: 21 | dotnet-version: ${{ env.dotnet_version }} 22 | - name: Install dependencies 23 | run: dotnet restore 24 | - name: Build 25 | run: dotnet build -c Release --no-restore 26 | - name: Test 27 | run: dotnet test -c Release --no-restore 28 | - name: Pack 29 | run: dotnet pack -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg -c Release -o app/packed --no-restore ${{ env.project_name }} 30 | - name: Deploy to nuget 31 | run: dotnet nuget push -s https://api.nuget.org/v3/index.json app/packed/*.nupkg -k ${{ secrets.NUGETKEY }} > push_log || grep "409" push_log 32 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 excubo-ag 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Tests_LazyStyleSheet/Tests_LazyStyleSheet.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | netcoreapp3.1 4 | Excubo.Blazor.Tests_LazyStyleSheet 5 | Excubo.Blazor.Tests_LazyStyleSheet 6 | enable 7 | false 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | all 16 | runtime; build; native; contentfiles; analyzers; buildtransitive 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /examples/standalone_app/BlazorApp/wwwroot/css/open-iconic/ICON-LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Waybury 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /examples/blazor_app_with_component_project/BlazorApp/wwwroot/css/open-iconic/ICON-LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Waybury 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /examples/component_library/ComponentLibrary/ComponentLibrary/ComponentLibrary.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | netstandard2.0 4 | 3.0 5 | true 6 | component_library 7 | false 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /examples/component_library/ConsumerApp/BlazorApp/wwwroot/css/open-iconic/ICON-LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Waybury 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /examples/standalone_app/standalone_app.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.29609.76 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorApp", "BlazorApp\StandaloneApp.csproj", "{62789396-FC44-4B90-942A-A2F4F93C5C73}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {62789396-FC44-4B90-942A-A2F4F93C5C73}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {62789396-FC44-4B90-942A-A2F4F93C5C73}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {62789396-FC44-4B90-942A-A2F4F93C5C73}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {62789396-FC44-4B90-942A-A2F4F93C5C73}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {9D2C7E79-4DED-45B6-8F11-55E2CA67D344} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /examples/component_library/ConsumerApp/consumer_app.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.29609.76 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorApp", "BlazorApp\ConsumerApp.csproj", "{134D8594-9B10-4E5E-B8F3-A365D18FEB24}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {134D8594-9B10-4E5E-B8F3-A365D18FEB24}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {134D8594-9B10-4E5E-B8F3-A365D18FEB24}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {134D8594-9B10-4E5E-B8F3-A365D18FEB24}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {134D8594-9B10-4E5E-B8F3-A365D18FEB24}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {9D2C7E79-4DED-45B6-8F11-55E2CA67D344} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /examples/standalone_app/BlazorApp/Pages/_Host.cshtml: -------------------------------------------------------------------------------- 1 | @page "/" 2 | @namespace BlazorApp.Pages 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | @{ 5 | Layout = null; 6 | } 7 | 8 | 9 | 10 | 11 | 12 | 13 | BlazorApp 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | An error has occurred. This application may no longer respond until reloaded. 26 | 27 | 28 | An unhandled exception has occurred. See browser dev tools for details. 29 | 30 | Reload 31 | 🗙 32 |
33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /LazyStyleSheet/Stylesheet.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Components; 2 | using Microsoft.JSInterop; 3 | using System.Threading.Tasks; 4 | 5 | [assembly: System.Runtime.CompilerServices.InternalsVisibleTo("Excubo.Blazor.Tests_LazyStyleSheet")] 6 | namespace Excubo.Blazor.LazyStyleSheet 7 | { 8 | public class Stylesheet : ComponentBase 9 | { 10 | [Parameter] public string Src { get; set; } 11 | [Inject] IJSRuntime js { get; set; } 12 | private bool render_required = true; 13 | protected override async Task OnAfterRenderAsync(bool firstRender) 14 | { 15 | if (firstRender && Src != null) 16 | { 17 | var condition = $"document.head.querySelector(`[href='{Src}']`) == null"; 18 | var action = $"let s = document.createElement('link'); s.setAttribute('rel', 'stylesheet'); s.setAttribute('href', '{Src}'); document.head.appendChild(s);"; 19 | await js.InvokeVoidAsync("eval", $"if ({condition}) {{ {action} }}"); 20 | render_required = false; 21 | } 22 | await base.OnAfterRenderAsync(firstRender); 23 | } 24 | protected override bool ShouldRender() => render_required; 25 | } 26 | } -------------------------------------------------------------------------------- /examples/blazor_app_with_component_project/BlazorApp/Pages/_Host.cshtml: -------------------------------------------------------------------------------- 1 | @page "/" 2 | @namespace BlazorApp.Pages 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | @{ 5 | Layout = null; 6 | } 7 | 8 | 9 | 10 | 11 | 12 | 13 | BlazorApp 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | An error has occurred. This application may no longer respond until reloaded. 26 | 27 | 28 | An unhandled exception has occurred. See browser dev tools for details. 29 | 30 | Reload 31 | 🗙 32 |
33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /examples/component_library/ConsumerApp/BlazorApp/Pages/_Host.cshtml: -------------------------------------------------------------------------------- 1 | @page "/" 2 | @namespace BlazorApp.Pages 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | @{ 5 | Layout = null; 6 | } 7 | 8 | 9 | 10 | 11 | 12 | 13 | BlazorApp 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | An error has occurred. This application may no longer respond until reloaded. 26 | 27 | 28 | An unhandled exception has occurred. See browser dev tools for details. 29 | 30 | Reload 31 | 🗙 32 |
33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /examples/component_library/ComponentLibrary/component_library.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.29609.76 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComponentLibrary", "ComponentLibrary\ComponentLibrary.csproj", "{034D8594-9B10-4E5E-B8F3-A365D18FEB24}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {034D8594-9B10-4E5E-B8F3-A365D18FEB24}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {034D8594-9B10-4E5E-B8F3-A365D18FEB24}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {034D8594-9B10-4E5E-B8F3-A365D18FEB24}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {034D8594-9B10-4E5E-B8F3-A365D18FEB24}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {9D2C7E79-4DED-45B6-8F11-55E2CA67D344} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /examples/standalone_app/BlazorApp/Pages/FetchData.razor: -------------------------------------------------------------------------------- 1 | @page "/fetchdata" 2 | 3 | @using BlazorApp.Data 4 | @inject WeatherForecastService ForecastService 5 | 6 |

Weather forecast

7 | 8 |

This component demonstrates fetching data from a service.

9 | 10 | @if (forecasts == null) 11 | { 12 |

Loading...

13 | } 14 | else 15 | { 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | @foreach (var forecast in forecasts) 27 | { 28 | 29 | 30 | 31 | 32 | 33 | 34 | } 35 | 36 |
DateTemp. (C)Temp. (F)Summary
@forecast.Date.ToShortDateString()@forecast.TemperatureC@forecast.TemperatureF@forecast.Summary
37 | } 38 | 39 | @code { 40 | private WeatherForecast[] forecasts; 41 | 42 | protected override async Task OnInitializedAsync() 43 | { 44 | forecasts = await ForecastService.GetForecastAsync(DateTime.Now); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /examples/blazor_app_with_component_project/BlazorApp/Pages/FetchData.razor: -------------------------------------------------------------------------------- 1 | @page "/fetchdata" 2 | 3 | @using BlazorApp.Data 4 | @inject WeatherForecastService ForecastService 5 | 6 |

Weather forecast

7 | 8 |

This component demonstrates fetching data from a service.

9 | 10 | @if (forecasts == null) 11 | { 12 |

Loading...

13 | } 14 | else 15 | { 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | @foreach (var forecast in forecasts) 27 | { 28 | 29 | 30 | 31 | 32 | 33 | 34 | } 35 | 36 |
DateTemp. (C)Temp. (F)Summary
@forecast.Date.ToShortDateString()@forecast.TemperatureC@forecast.TemperatureF@forecast.Summary
37 | } 38 | 39 | @code { 40 | private WeatherForecast[] forecasts; 41 | 42 | protected override async Task OnInitializedAsync() 43 | { 44 | forecasts = await ForecastService.GetForecastAsync(DateTime.Now); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /examples/component_library/ConsumerApp/BlazorApp/Pages/FetchData.razor: -------------------------------------------------------------------------------- 1 | @page "/fetchdata" 2 | 3 | @using BlazorApp.Data 4 | @inject WeatherForecastService ForecastService 5 | 6 |

Weather forecast

7 | 8 |

This component demonstrates fetching data from a service.

9 | 10 | @if (forecasts == null) 11 | { 12 |

Loading...

13 | } 14 | else 15 | { 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | @foreach (var forecast in forecasts) 27 | { 28 | 29 | 30 | 31 | 32 | 33 | 34 | } 35 | 36 |
DateTemp. (C)Temp. (F)Summary
@forecast.Date.ToShortDateString()@forecast.TemperatureC@forecast.TemperatureF@forecast.Summary
37 | } 38 | 39 | @code { 40 | private WeatherForecast[] forecasts; 41 | 42 | protected override async Task OnInitializedAsync() 43 | { 44 | forecasts = await ForecastService.GetForecastAsync(DateTime.Now); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /examples/component_library/ComponentLibrary/ComponentLibrary/build/ComponentLibrary.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 13 | 14 | 15 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /examples/standalone_app/BlazorApp/Shared/NavMenu.razor: -------------------------------------------------------------------------------- 1 | 7 | 8 |
9 | 26 |
27 | 28 | @code { 29 | private bool collapseNavMenu = true; 30 | 31 | private string NavMenuCssClass => collapseNavMenu ? "collapse" : null; 32 | 33 | private void ToggleNavMenu() 34 | { 35 | collapseNavMenu = !collapseNavMenu; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /examples/blazor_app_with_component_project/BlazorApp/Shared/NavMenu.razor: -------------------------------------------------------------------------------- 1 | 7 | 8 |
9 | 26 |
27 | 28 | @code { 29 | private bool collapseNavMenu = true; 30 | 31 | private string NavMenuCssClass => collapseNavMenu ? "collapse" : null; 32 | 33 | private void ToggleNavMenu() 34 | { 35 | collapseNavMenu = !collapseNavMenu; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /examples/component_library/ConsumerApp/BlazorApp/Shared/NavMenu.razor: -------------------------------------------------------------------------------- 1 | 7 | 8 |
9 | 26 |
27 | 28 | @code { 29 | private bool collapseNavMenu = true; 30 | 31 | private string NavMenuCssClass => collapseNavMenu ? "collapse" : null; 32 | 33 | private void ToggleNavMenu() 34 | { 35 | collapseNavMenu = !collapseNavMenu; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /LazyStyleSheet/StyleSheets.razor.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Excubo.Blazor.LazyStyleSheet 4 | { 5 | /// 6 | /// Component that writes link-tags for style sheets on demand. 7 | /// 8 | /// 9 | /// To signal that this component should add another style sheet, inject an IStyleSheetService into your component, then call style_sheet_service.Add(url); 10 | /// It is recommended to place this component in the App.razor component. 11 | /// 12 | /// 13 | /// 14 | /// <Router AppAssembly = "@typeof(Program).Assembly"> 15 | /// <Found Context="routeData"> 16 | /// <AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" /> 17 | /// </Found> 18 | /// <NotFound> 19 | /// <LayoutView Layout="@typeof(MainLayout)" > 20 | /// <p> Sorry, there's nothing at this address.</p> 21 | /// </LayoutView> 22 | /// </NotFound> 23 | /// </Router> 24 | /// <StyleSheets/> 25 | /// 26 | /// 27 | [Obsolete("This can be removed! Adding style sheets just became a whole lot easier. See https://github.com/excubo-ag/Blazor.LazyStyleSheet for more details.")] 28 | public partial class StyleSheets 29 | { 30 | } 31 | } -------------------------------------------------------------------------------- /LazyStyleSheet/package.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | LazyStyleSheet for Blazor 5 | Excubo.Blazor.LazyStyleSheet makes it easy to dynamically load style sheets in razor components. This improves page load times and reduces the amount of data transferred over the network. 6 | blazor,css,web 7 | Excubo.Blazor.LazyStyleSheet 8 | 9 | 10 | 11 | Stefan Lörwald 12 | excubo ag 13 | 14 | 15 | 16 | https://github.com/excubo-ag/Blazor.LazyStyleSheet 17 | https://github.com/excubo-ag/Blazor.LazyStyleSheet 18 | git 19 | 20 | 21 | 22 | Excubo.Blazor.LazyStyleSheet 23 | 3.1.21 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | LICENSE 32 | 33 | 34 | 35 | True 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /examples/blazor_app_with_component_project/blazor_app_with_component_project.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.29609.76 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ComponentWithStyle", "ComponentWithStyle\ComponentWithStyle.csproj", "{034D8594-9B10-4E5E-B8F3-A365D18FEB24}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorApp", "BlazorApp\BlazorApp.csproj", "{62789396-FC44-4B90-942A-A2F4F93C5C73}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Any CPU = Debug|Any CPU 13 | Release|Any CPU = Release|Any CPU 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {034D8594-9B10-4E5E-B8F3-A365D18FEB24}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 17 | {034D8594-9B10-4E5E-B8F3-A365D18FEB24}.Debug|Any CPU.Build.0 = Debug|Any CPU 18 | {034D8594-9B10-4E5E-B8F3-A365D18FEB24}.Release|Any CPU.ActiveCfg = Release|Any CPU 19 | {034D8594-9B10-4E5E-B8F3-A365D18FEB24}.Release|Any CPU.Build.0 = Release|Any CPU 20 | {62789396-FC44-4B90-942A-A2F4F93C5C73}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 21 | {62789396-FC44-4B90-942A-A2F4F93C5C73}.Debug|Any CPU.Build.0 = Debug|Any CPU 22 | {62789396-FC44-4B90-942A-A2F4F93C5C73}.Release|Any CPU.ActiveCfg = Release|Any CPU 23 | {62789396-FC44-4B90-942A-A2F4F93C5C73}.Release|Any CPU.Build.0 = Release|Any CPU 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {9D2C7E79-4DED-45B6-8F11-55E2CA67D344} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /examples/standalone_app/BlazorApp/Startup.cs: -------------------------------------------------------------------------------- 1 | using BlazorApp.Data; 2 | using Microsoft.AspNetCore.Builder; 3 | using Microsoft.AspNetCore.Hosting; 4 | using Microsoft.Extensions.Configuration; 5 | using Microsoft.Extensions.DependencyInjection; 6 | using Microsoft.Extensions.Hosting; 7 | 8 | namespace BlazorApp 9 | { 10 | public class Startup 11 | { 12 | public Startup(IConfiguration configuration) 13 | { 14 | Configuration = configuration; 15 | } 16 | 17 | public IConfiguration Configuration { get; } 18 | 19 | // This method gets called by the runtime. Use this method to add services to the container. 20 | // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 21 | public void ConfigureServices(IServiceCollection services) 22 | { 23 | services.AddRazorPages(); 24 | services.AddServerSideBlazor(); 25 | services.AddSingleton(); 26 | } 27 | 28 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 29 | public void Configure(IApplicationBuilder app, IWebHostEnvironment env) 30 | { 31 | if (env.IsDevelopment()) 32 | { 33 | app.UseDeveloperExceptionPage(); 34 | } 35 | else 36 | { 37 | app.UseExceptionHandler("/Error"); 38 | // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. 39 | app.UseHsts(); 40 | } 41 | 42 | app.UseHttpsRedirection(); 43 | app.UseStaticFiles(); 44 | 45 | app.UseRouting(); 46 | 47 | app.UseEndpoints(endpoints => 48 | { 49 | endpoints.MapBlazorHub(); 50 | endpoints.MapFallbackToPage("/_Host"); 51 | }); 52 | } 53 | } 54 | } -------------------------------------------------------------------------------- /examples/component_library/ConsumerApp/BlazorApp/Startup.cs: -------------------------------------------------------------------------------- 1 | using BlazorApp.Data; 2 | using Microsoft.AspNetCore.Builder; 3 | using Microsoft.AspNetCore.Hosting; 4 | using Microsoft.Extensions.Configuration; 5 | using Microsoft.Extensions.DependencyInjection; 6 | using Microsoft.Extensions.Hosting; 7 | 8 | namespace BlazorApp 9 | { 10 | public class Startup 11 | { 12 | public Startup(IConfiguration configuration) 13 | { 14 | Configuration = configuration; 15 | } 16 | 17 | public IConfiguration Configuration { get; } 18 | 19 | // This method gets called by the runtime. Use this method to add services to the container. 20 | // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 21 | public void ConfigureServices(IServiceCollection services) 22 | { 23 | services.AddRazorPages(); 24 | services.AddServerSideBlazor(); 25 | services.AddSingleton(); 26 | } 27 | 28 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 29 | public void Configure(IApplicationBuilder app, IWebHostEnvironment env) 30 | { 31 | if (env.IsDevelopment()) 32 | { 33 | app.UseDeveloperExceptionPage(); 34 | } 35 | else 36 | { 37 | app.UseExceptionHandler("/Error"); 38 | // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. 39 | app.UseHsts(); 40 | } 41 | 42 | app.UseHttpsRedirection(); 43 | app.UseStaticFiles(); 44 | 45 | app.UseRouting(); 46 | 47 | app.UseEndpoints(endpoints => 48 | { 49 | endpoints.MapBlazorHub(); 50 | endpoints.MapFallbackToPage("/_Host"); 51 | }); 52 | } 53 | } 54 | } -------------------------------------------------------------------------------- /examples/blazor_app_with_component_project/BlazorApp/Startup.cs: -------------------------------------------------------------------------------- 1 | using BlazorApp.Data; 2 | using Excubo.Blazor.LazyStyleSheet; 3 | using Microsoft.AspNetCore.Builder; 4 | using Microsoft.AspNetCore.Hosting; 5 | using Microsoft.Extensions.Configuration; 6 | using Microsoft.Extensions.DependencyInjection; 7 | using Microsoft.Extensions.Hosting; 8 | 9 | namespace BlazorApp 10 | { 11 | public class Startup 12 | { 13 | public Startup(IConfiguration configuration) 14 | { 15 | Configuration = configuration; 16 | } 17 | 18 | public IConfiguration Configuration { get; } 19 | 20 | // This method gets called by the runtime. Use this method to add services to the container. 21 | // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 22 | public void ConfigureServices(IServiceCollection services) 23 | { 24 | services.AddRazorPages(); 25 | services.AddServerSideBlazor(); 26 | services.AddSingleton(); 27 | } 28 | 29 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 30 | public void Configure(IApplicationBuilder app, IWebHostEnvironment env) 31 | { 32 | if (env.IsDevelopment()) 33 | { 34 | app.UseDeveloperExceptionPage(); 35 | } 36 | else 37 | { 38 | app.UseExceptionHandler("/Error"); 39 | // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. 40 | app.UseHsts(); 41 | } 42 | 43 | app.UseHttpsRedirection(); 44 | app.UseStaticFiles(); 45 | 46 | app.UseRouting(); 47 | 48 | app.UseEndpoints(endpoints => 49 | { 50 | endpoints.MapBlazorHub(); 51 | endpoints.MapFallbackToPage("/_Host"); 52 | }); 53 | } 54 | } 55 | } -------------------------------------------------------------------------------- /examples/standalone_app/README.md: -------------------------------------------------------------------------------- 1 | # Standalone Blazor App 2 | 3 | This project shows how to use Excubo.Blazor.LazyStyleSheet. It demonstrates both automatic and manual injection. 4 | 5 | See BlazorApp/Pages/Index.razor for manual injection. Make your life easier by using auto-injectic, see BlazorApp/Pages/Counter.razor and BlazorApp/Pages/Counter.razor.scss. 6 | 7 | ## Relevant files 8 | 9 | All the following files have been modified slightly from the plain Blazor sample project. All changes are detailed below. 10 | 11 | 12 | ### BlazorApp/Pages/Index.razor 13 | 14 | ```html 15 | @page "/" 16 | 17 | 18 | 19 |

Hello, world!

20 | 21 | Welcome to your new app. 22 | 23 | 24 | ``` 25 | 26 | - Apply a style to the heading. This style is defined in BlazorApp/wwwroot/css/manual_injection.scss 27 | - Add the stylesheet. Note that we add the minified version of the compiled css, not the scss itself. 28 | 29 | 30 | ### BlazorApp/Pages/Counter.razor 31 | 32 | ```html 33 | @page "/counter" 34 | 35 |

Counter

36 | 37 |

Current count: @currentCount

38 | 39 | 40 | 41 | @code { 42 | private int currentCount = 0; 43 | 44 | private void IncrementCount() 45 | { 46 | currentCount++; 47 | } 48 | } 49 | ``` 50 | 51 | - Added the custom style `colored` to the button, which is defined in BlazorApp/Pages/Counter.razor.scss 52 | 53 | ### BlazorApp/Pages/Counter.razor.scss 54 | 55 | ```css 56 | @import '../../../default_values.scss'; 57 | .colored { 58 | color: $variable 59 | } 60 | ``` 61 | 62 | - Defines the style colored, which takes its value from a file (see /BlazorApp/wwwroot/default_values.scss). 63 | - As this file is put with the razor component, it will be *auto-injected* into the component. 64 | 65 | ### BlazorApp/wwwroot/default_values.scss 66 | 67 | ```css 68 | $variable:blue; 69 | ``` 70 | 71 | - define our custom color `variable` to be `blue`. 72 | 73 | ### BlazorApp/BlazorApp.csproj 74 | 75 | ```xml 76 | 77 | 78 | 79 | netcoreapp3.1 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | ``` 88 | 89 | - We want to have our custom scss files to be compiled: 90 | ```xml 91 | 92 | 93 | 94 | ``` 95 | 96 | 97 | -------------------------------------------------------------------------------- /examples/standalone_app/BlazorApp/wwwroot/css/site.min.css: -------------------------------------------------------------------------------- 1 | @import url('open-iconic/font/css/open-iconic-bootstrap.min.css');html,body{font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;}a,.btn-link{color:#0366d6;}.btn-primary{color:#fff;background-color:#1b6ec2;border-color:#1861ac;}app{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;}.top-row{height:3.5rem;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}.main{-webkit-box-flex:1;-ms-flex:1;flex:1;}.main .top-row{background-color:#f7f7f7;border-bottom:1px solid #d6d5d5;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;}.main .top-row>a,.main .top-row .btn-link{white-space:nowrap;margin-left:1.5rem;}.main .top-row a:first-child{overflow:hidden;-o-text-overflow:ellipsis;text-overflow:ellipsis;}.sidebar{background-image:-webkit-gradient(linear,left top,left bottom,from(#052767),color-stop(70%,#3a0647));background-image:-o-linear-gradient(top,#052767 0%,#3a0647 70%);background-image:linear-gradient(180deg,#052767 0%,#3a0647 70%);}.sidebar .top-row{background-color:rgba(0,0,0,.4);}.sidebar .navbar-brand{font-size:1.1rem;}.sidebar .oi{width:2rem;font-size:1.1rem;vertical-align:text-top;top:-2px;}.sidebar .nav-item{font-size:.9rem;padding-bottom:.5rem;}.sidebar .nav-item:first-of-type{padding-top:1rem;}.sidebar .nav-item:last-of-type{padding-bottom:1rem;}.sidebar .nav-item a{color:#d7d7d7;border-radius:4px;height:3rem;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;line-height:3rem;}.sidebar .nav-item a.active{background-color:rgba(255,255,255,.25);color:#fff;}.sidebar .nav-item a:hover{background-color:rgba(255,255,255,.1);color:#fff;}.content{padding-top:1.1rem;}.navbar-toggler{background-color:rgba(255,255,255,.1);}.valid.modified:not([type=checkbox]){outline:1px solid #26b050;}.invalid{outline:1px solid #f00;}.validation-message{color:#f00;}#blazor-error-ui{background:#ffffe0;bottom:0;-webkit-box-shadow:0 -1px 2px rgba(0,0,0,.2);box-shadow:0 -1px 2px rgba(0,0,0,.2);display:none;left:0;padding:.6rem 1.25rem .7rem 1.25rem;position:fixed;width:100%;z-index:1000;}#blazor-error-ui .dismiss{cursor:pointer;position:absolute;right:.75rem;top:.5rem;}@media(max-width:767.98px){.main .top-row:not(.auth){display:none;}.main .top-row.auth{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;}.main .top-row a,.main .top-row .btn-link{margin-left:0;}}@media(min-width:768px){app{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;}.sidebar{width:250px;height:100vh;position:-webkit-sticky;position:sticky;top:0;}.main .top-row{position:-webkit-sticky;position:sticky;top:0;}.main>div{padding-left:2rem !important;padding-right:1.5rem !important;}.navbar-toggler{display:none;}.sidebar .collapse{display:block;}} -------------------------------------------------------------------------------- /examples/component_library/ConsumerApp/BlazorApp/wwwroot/css/site.min.css: -------------------------------------------------------------------------------- 1 | @import url('open-iconic/font/css/open-iconic-bootstrap.min.css');html,body{font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;}a,.btn-link{color:#0366d6;}.btn-primary{color:#fff;background-color:#1b6ec2;border-color:#1861ac;}app{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;}.top-row{height:3.5rem;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}.main{-webkit-box-flex:1;-ms-flex:1;flex:1;}.main .top-row{background-color:#f7f7f7;border-bottom:1px solid #d6d5d5;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;}.main .top-row>a,.main .top-row .btn-link{white-space:nowrap;margin-left:1.5rem;}.main .top-row a:first-child{overflow:hidden;-o-text-overflow:ellipsis;text-overflow:ellipsis;}.sidebar{background-image:-webkit-gradient(linear,left top,left bottom,from(#052767),color-stop(70%,#3a0647));background-image:-o-linear-gradient(top,#052767 0%,#3a0647 70%);background-image:linear-gradient(180deg,#052767 0%,#3a0647 70%);}.sidebar .top-row{background-color:rgba(0,0,0,.4);}.sidebar .navbar-brand{font-size:1.1rem;}.sidebar .oi{width:2rem;font-size:1.1rem;vertical-align:text-top;top:-2px;}.sidebar .nav-item{font-size:.9rem;padding-bottom:.5rem;}.sidebar .nav-item:first-of-type{padding-top:1rem;}.sidebar .nav-item:last-of-type{padding-bottom:1rem;}.sidebar .nav-item a{color:#d7d7d7;border-radius:4px;height:3rem;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;line-height:3rem;}.sidebar .nav-item a.active{background-color:rgba(255,255,255,.25);color:#fff;}.sidebar .nav-item a:hover{background-color:rgba(255,255,255,.1);color:#fff;}.content{padding-top:1.1rem;}.navbar-toggler{background-color:rgba(255,255,255,.1);}.valid.modified:not([type=checkbox]){outline:1px solid #26b050;}.invalid{outline:1px solid #f00;}.validation-message{color:#f00;}#blazor-error-ui{background:#ffffe0;bottom:0;-webkit-box-shadow:0 -1px 2px rgba(0,0,0,.2);box-shadow:0 -1px 2px rgba(0,0,0,.2);display:none;left:0;padding:.6rem 1.25rem .7rem 1.25rem;position:fixed;width:100%;z-index:1000;}#blazor-error-ui .dismiss{cursor:pointer;position:absolute;right:.75rem;top:.5rem;}@media(max-width:767.98px){.main .top-row:not(.auth){display:none;}.main .top-row.auth{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;}.main .top-row a,.main .top-row .btn-link{margin-left:0;}}@media(min-width:768px){app{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;}.sidebar{width:250px;height:100vh;position:-webkit-sticky;position:sticky;top:0;}.main .top-row{position:-webkit-sticky;position:sticky;top:0;}.main>div{padding-left:2rem !important;padding-right:1.5rem !important;}.navbar-toggler{display:none;}.sidebar .collapse{display:block;}} -------------------------------------------------------------------------------- /examples/blazor_app_with_component_project/BlazorApp/wwwroot/css/site.min.css: -------------------------------------------------------------------------------- 1 | @import url('open-iconic/font/css/open-iconic-bootstrap.min.css');html,body{font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;}a,.btn-link{color:#0366d6;}.btn-primary{color:#fff;background-color:#1b6ec2;border-color:#1861ac;}app{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;}.top-row{height:3.5rem;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}.main{-webkit-box-flex:1;-ms-flex:1;flex:1;}.main .top-row{background-color:#f7f7f7;border-bottom:1px solid #d6d5d5;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;}.main .top-row>a,.main .top-row .btn-link{white-space:nowrap;margin-left:1.5rem;}.main .top-row a:first-child{overflow:hidden;-o-text-overflow:ellipsis;text-overflow:ellipsis;}.sidebar{background-image:-webkit-gradient(linear,left top,left bottom,from(#052767),color-stop(70%,#3a0647));background-image:-o-linear-gradient(top,#052767 0%,#3a0647 70%);background-image:linear-gradient(180deg,#052767 0%,#3a0647 70%);}.sidebar .top-row{background-color:rgba(0,0,0,.4);}.sidebar .navbar-brand{font-size:1.1rem;}.sidebar .oi{width:2rem;font-size:1.1rem;vertical-align:text-top;top:-2px;}.sidebar .nav-item{font-size:.9rem;padding-bottom:.5rem;}.sidebar .nav-item:first-of-type{padding-top:1rem;}.sidebar .nav-item:last-of-type{padding-bottom:1rem;}.sidebar .nav-item a{color:#d7d7d7;border-radius:4px;height:3rem;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;line-height:3rem;}.sidebar .nav-item a.active{background-color:rgba(255,255,255,.25);color:#fff;}.sidebar .nav-item a:hover{background-color:rgba(255,255,255,.1);color:#fff;}.content{padding-top:1.1rem;}.navbar-toggler{background-color:rgba(255,255,255,.1);}.valid.modified:not([type=checkbox]){outline:1px solid #26b050;}.invalid{outline:1px solid #f00;}.validation-message{color:#f00;}#blazor-error-ui{background:#ffffe0;bottom:0;-webkit-box-shadow:0 -1px 2px rgba(0,0,0,.2);box-shadow:0 -1px 2px rgba(0,0,0,.2);display:none;left:0;padding:.6rem 1.25rem .7rem 1.25rem;position:fixed;width:100%;z-index:1000;}#blazor-error-ui .dismiss{cursor:pointer;position:absolute;right:.75rem;top:.5rem;}@media(max-width:767.98px){.main .top-row:not(.auth){display:none;}.main .top-row.auth{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;}.main .top-row a,.main .top-row .btn-link{margin-left:0;}}@media(min-width:768px){app{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;}.sidebar{width:250px;height:100vh;position:-webkit-sticky;position:sticky;top:0;}.main .top-row{position:-webkit-sticky;position:sticky;top:0;}.main>div{padding-left:2rem !important;padding-right:1.5rem !important;}.navbar-toggler{display:none;}.sidebar .collapse{display:block;}} -------------------------------------------------------------------------------- /examples/standalone_app/BlazorApp/wwwroot/css/open-iconic/README.md: -------------------------------------------------------------------------------- 1 | [Open Iconic v1.1.1](http://useiconic.com/open) 2 | =========== 3 | 4 | ### Open Iconic is the open source sibling of [Iconic](http://useiconic.com). It is a hyper-legible collection of 223 icons with a tiny footprint—ready to use with Bootstrap and Foundation. [View the collection](http://useiconic.com/open#icons) 5 | 6 | 7 | 8 | ## What's in Open Iconic? 9 | 10 | * 223 icons designed to be legible down to 8 pixels 11 | * Super-light SVG files - 61.8 for the entire set 12 | * SVG sprite—the modern replacement for icon fonts 13 | * Webfont (EOT, OTF, SVG, TTF, WOFF), PNG and WebP formats 14 | * Webfont stylesheets (including versions for Bootstrap and Foundation) in CSS, LESS, SCSS and Stylus formats 15 | * PNG and WebP raster images in 8px, 16px, 24px, 32px, 48px and 64px. 16 | 17 | 18 | ## Getting Started 19 | 20 | #### For code samples and everything else you need to get started with Open Iconic, check out our [Icons](http://useiconic.com/open#icons) and [Reference](http://useiconic.com/open#reference) sections. 21 | 22 | ### General Usage 23 | 24 | #### Using Open Iconic's SVGs 25 | 26 | We like SVGs and we think they're the way to display icons on the web. Since Open Iconic are just basic SVGs, we suggest you display them like you would any other image (don't forget the `alt` attribute). 27 | 28 | ``` 29 | icon name 30 | ``` 31 | 32 | #### Using Open Iconic's SVG Sprite 33 | 34 | Open Iconic also comes in a SVG sprite which allows you to display all the icons in the set with a single request. It's like an icon font, without being a hack. 35 | 36 | Adding an icon from an SVG sprite is a little different than what you're used to, but it's still a piece of cake. *Tip: To make your icons easily style able, we suggest adding a general class to the* `` *tag and a unique class name for each different icon in the* `` *tag.* 37 | 38 | ``` 39 | 40 | 41 | 42 | ``` 43 | 44 | Sizing icons only needs basic CSS. All the icons are in a square format, so just set the `` tag with equal width and height dimensions. 45 | 46 | ``` 47 | .icon { 48 | width: 16px; 49 | height: 16px; 50 | } 51 | ``` 52 | 53 | Coloring icons is even easier. All you need to do is set the `fill` rule on the `` tag. 54 | 55 | ``` 56 | .icon-account-login { 57 | fill: #f00; 58 | } 59 | ``` 60 | 61 | To learn more about SVG Sprites, read [Chris Coyier's guide](http://css-tricks.com/svg-sprites-use-better-icon-fonts/). 62 | 63 | #### Using Open Iconic's Icon Font... 64 | 65 | 66 | ##### …with Bootstrap 67 | 68 | You can find our Bootstrap stylesheets in `font/css/open-iconic-bootstrap.{css, less, scss, styl}` 69 | 70 | 71 | ``` 72 | 73 | ``` 74 | 75 | 76 | ``` 77 | 78 | ``` 79 | 80 | ##### …with Foundation 81 | 82 | You can find our Foundation stylesheets in `font/css/open-iconic-foundation.{css, less, scss, styl}` 83 | 84 | ``` 85 | 86 | ``` 87 | 88 | 89 | ``` 90 | 91 | ``` 92 | 93 | ##### …on its own 94 | 95 | You can find our default stylesheets in `font/css/open-iconic.{css, less, scss, styl}` 96 | 97 | ``` 98 | 99 | ``` 100 | 101 | ``` 102 | 103 | ``` 104 | 105 | 106 | ## License 107 | 108 | ### Icons 109 | 110 | All code (including SVG markup) is under the [MIT License](http://opensource.org/licenses/MIT). 111 | 112 | ### Fonts 113 | 114 | All fonts are under the [SIL Licensed](http://scripts.sil.org/cms/scripts/page.php?item_id=OFL_web). 115 | -------------------------------------------------------------------------------- /examples/component_library/ConsumerApp/BlazorApp/wwwroot/css/open-iconic/README.md: -------------------------------------------------------------------------------- 1 | [Open Iconic v1.1.1](http://useiconic.com/open) 2 | =========== 3 | 4 | ### Open Iconic is the open source sibling of [Iconic](http://useiconic.com). It is a hyper-legible collection of 223 icons with a tiny footprint—ready to use with Bootstrap and Foundation. [View the collection](http://useiconic.com/open#icons) 5 | 6 | 7 | 8 | ## What's in Open Iconic? 9 | 10 | * 223 icons designed to be legible down to 8 pixels 11 | * Super-light SVG files - 61.8 for the entire set 12 | * SVG sprite—the modern replacement for icon fonts 13 | * Webfont (EOT, OTF, SVG, TTF, WOFF), PNG and WebP formats 14 | * Webfont stylesheets (including versions for Bootstrap and Foundation) in CSS, LESS, SCSS and Stylus formats 15 | * PNG and WebP raster images in 8px, 16px, 24px, 32px, 48px and 64px. 16 | 17 | 18 | ## Getting Started 19 | 20 | #### For code samples and everything else you need to get started with Open Iconic, check out our [Icons](http://useiconic.com/open#icons) and [Reference](http://useiconic.com/open#reference) sections. 21 | 22 | ### General Usage 23 | 24 | #### Using Open Iconic's SVGs 25 | 26 | We like SVGs and we think they're the way to display icons on the web. Since Open Iconic are just basic SVGs, we suggest you display them like you would any other image (don't forget the `alt` attribute). 27 | 28 | ``` 29 | icon name 30 | ``` 31 | 32 | #### Using Open Iconic's SVG Sprite 33 | 34 | Open Iconic also comes in a SVG sprite which allows you to display all the icons in the set with a single request. It's like an icon font, without being a hack. 35 | 36 | Adding an icon from an SVG sprite is a little different than what you're used to, but it's still a piece of cake. *Tip: To make your icons easily style able, we suggest adding a general class to the* `` *tag and a unique class name for each different icon in the* `` *tag.* 37 | 38 | ``` 39 | 40 | 41 | 42 | ``` 43 | 44 | Sizing icons only needs basic CSS. All the icons are in a square format, so just set the `` tag with equal width and height dimensions. 45 | 46 | ``` 47 | .icon { 48 | width: 16px; 49 | height: 16px; 50 | } 51 | ``` 52 | 53 | Coloring icons is even easier. All you need to do is set the `fill` rule on the `` tag. 54 | 55 | ``` 56 | .icon-account-login { 57 | fill: #f00; 58 | } 59 | ``` 60 | 61 | To learn more about SVG Sprites, read [Chris Coyier's guide](http://css-tricks.com/svg-sprites-use-better-icon-fonts/). 62 | 63 | #### Using Open Iconic's Icon Font... 64 | 65 | 66 | ##### …with Bootstrap 67 | 68 | You can find our Bootstrap stylesheets in `font/css/open-iconic-bootstrap.{css, less, scss, styl}` 69 | 70 | 71 | ``` 72 | 73 | ``` 74 | 75 | 76 | ``` 77 | 78 | ``` 79 | 80 | ##### …with Foundation 81 | 82 | You can find our Foundation stylesheets in `font/css/open-iconic-foundation.{css, less, scss, styl}` 83 | 84 | ``` 85 | 86 | ``` 87 | 88 | 89 | ``` 90 | 91 | ``` 92 | 93 | ##### …on its own 94 | 95 | You can find our default stylesheets in `font/css/open-iconic.{css, less, scss, styl}` 96 | 97 | ``` 98 | 99 | ``` 100 | 101 | ``` 102 | 103 | ``` 104 | 105 | 106 | ## License 107 | 108 | ### Icons 109 | 110 | All code (including SVG markup) is under the [MIT License](http://opensource.org/licenses/MIT). 111 | 112 | ### Fonts 113 | 114 | All fonts are under the [SIL Licensed](http://scripts.sil.org/cms/scripts/page.php?item_id=OFL_web). 115 | -------------------------------------------------------------------------------- /examples/blazor_app_with_component_project/BlazorApp/wwwroot/css/open-iconic/README.md: -------------------------------------------------------------------------------- 1 | [Open Iconic v1.1.1](http://useiconic.com/open) 2 | =========== 3 | 4 | ### Open Iconic is the open source sibling of [Iconic](http://useiconic.com). It is a hyper-legible collection of 223 icons with a tiny footprint—ready to use with Bootstrap and Foundation. [View the collection](http://useiconic.com/open#icons) 5 | 6 | 7 | 8 | ## What's in Open Iconic? 9 | 10 | * 223 icons designed to be legible down to 8 pixels 11 | * Super-light SVG files - 61.8 for the entire set 12 | * SVG sprite—the modern replacement for icon fonts 13 | * Webfont (EOT, OTF, SVG, TTF, WOFF), PNG and WebP formats 14 | * Webfont stylesheets (including versions for Bootstrap and Foundation) in CSS, LESS, SCSS and Stylus formats 15 | * PNG and WebP raster images in 8px, 16px, 24px, 32px, 48px and 64px. 16 | 17 | 18 | ## Getting Started 19 | 20 | #### For code samples and everything else you need to get started with Open Iconic, check out our [Icons](http://useiconic.com/open#icons) and [Reference](http://useiconic.com/open#reference) sections. 21 | 22 | ### General Usage 23 | 24 | #### Using Open Iconic's SVGs 25 | 26 | We like SVGs and we think they're the way to display icons on the web. Since Open Iconic are just basic SVGs, we suggest you display them like you would any other image (don't forget the `alt` attribute). 27 | 28 | ``` 29 | icon name 30 | ``` 31 | 32 | #### Using Open Iconic's SVG Sprite 33 | 34 | Open Iconic also comes in a SVG sprite which allows you to display all the icons in the set with a single request. It's like an icon font, without being a hack. 35 | 36 | Adding an icon from an SVG sprite is a little different than what you're used to, but it's still a piece of cake. *Tip: To make your icons easily style able, we suggest adding a general class to the* `` *tag and a unique class name for each different icon in the* `` *tag.* 37 | 38 | ``` 39 | 40 | 41 | 42 | ``` 43 | 44 | Sizing icons only needs basic CSS. All the icons are in a square format, so just set the `` tag with equal width and height dimensions. 45 | 46 | ``` 47 | .icon { 48 | width: 16px; 49 | height: 16px; 50 | } 51 | ``` 52 | 53 | Coloring icons is even easier. All you need to do is set the `fill` rule on the `` tag. 54 | 55 | ``` 56 | .icon-account-login { 57 | fill: #f00; 58 | } 59 | ``` 60 | 61 | To learn more about SVG Sprites, read [Chris Coyier's guide](http://css-tricks.com/svg-sprites-use-better-icon-fonts/). 62 | 63 | #### Using Open Iconic's Icon Font... 64 | 65 | 66 | ##### …with Bootstrap 67 | 68 | You can find our Bootstrap stylesheets in `font/css/open-iconic-bootstrap.{css, less, scss, styl}` 69 | 70 | 71 | ``` 72 | 73 | ``` 74 | 75 | 76 | ``` 77 | 78 | ``` 79 | 80 | ##### …with Foundation 81 | 82 | You can find our Foundation stylesheets in `font/css/open-iconic-foundation.{css, less, scss, styl}` 83 | 84 | ``` 85 | 86 | ``` 87 | 88 | 89 | ``` 90 | 91 | ``` 92 | 93 | ##### …on its own 94 | 95 | You can find our default stylesheets in `font/css/open-iconic.{css, less, scss, styl}` 96 | 97 | ``` 98 | 99 | ``` 100 | 101 | ``` 102 | 103 | ``` 104 | 105 | 106 | ## License 107 | 108 | ### Icons 109 | 110 | All code (including SVG markup) is under the [MIT License](http://opensource.org/licenses/MIT). 111 | 112 | ### Fonts 113 | 114 | All fonts are under the [SIL Licensed](http://scripts.sil.org/cms/scripts/page.php?item_id=OFL_web). 115 | -------------------------------------------------------------------------------- /examples/standalone_app/BlazorApp/wwwroot/css/open-iconic/FONT-LICENSE: -------------------------------------------------------------------------------- 1 | SIL OPEN FONT LICENSE Version 1.1 2 | 3 | Copyright (c) 2014 Waybury 4 | 5 | PREAMBLE 6 | The goals of the Open Font License (OFL) are to stimulate worldwide 7 | development of collaborative font projects, to support the font creation 8 | efforts of academic and linguistic communities, and to provide a free and 9 | open framework in which fonts may be shared and improved in partnership 10 | with others. 11 | 12 | The OFL allows the licensed fonts to be used, studied, modified and 13 | redistributed freely as long as they are not sold by themselves. The 14 | fonts, including any derivative works, can be bundled, embedded, 15 | redistributed and/or sold with any software provided that any reserved 16 | names are not used by derivative works. The fonts and derivatives, 17 | however, cannot be released under any other type of license. The 18 | requirement for fonts to remain under this license does not apply 19 | to any document created using the fonts or their derivatives. 20 | 21 | DEFINITIONS 22 | "Font Software" refers to the set of files released by the Copyright 23 | Holder(s) under this license and clearly marked as such. This may 24 | include source files, build scripts and documentation. 25 | 26 | "Reserved Font Name" refers to any names specified as such after the 27 | copyright statement(s). 28 | 29 | "Original Version" refers to the collection of Font Software components as 30 | distributed by the Copyright Holder(s). 31 | 32 | "Modified Version" refers to any derivative made by adding to, deleting, 33 | or substituting -- in part or in whole -- any of the components of the 34 | Original Version, by changing formats or by porting the Font Software to a 35 | new environment. 36 | 37 | "Author" refers to any designer, engineer, programmer, technical 38 | writer or other person who contributed to the Font Software. 39 | 40 | PERMISSION & CONDITIONS 41 | Permission is hereby granted, free of charge, to any person obtaining 42 | a copy of the Font Software, to use, study, copy, merge, embed, modify, 43 | redistribute, and sell modified and unmodified copies of the Font 44 | Software, subject to the following conditions: 45 | 46 | 1) Neither the Font Software nor any of its individual components, 47 | in Original or Modified Versions, may be sold by itself. 48 | 49 | 2) Original or Modified Versions of the Font Software may be bundled, 50 | redistributed and/or sold with any software, provided that each copy 51 | contains the above copyright notice and this license. These can be 52 | included either as stand-alone text files, human-readable headers or 53 | in the appropriate machine-readable metadata fields within text or 54 | binary files as long as those fields can be easily viewed by the user. 55 | 56 | 3) No Modified Version of the Font Software may use the Reserved Font 57 | Name(s) unless explicit written permission is granted by the corresponding 58 | Copyright Holder. This restriction only applies to the primary font name as 59 | presented to the users. 60 | 61 | 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font 62 | Software shall not be used to promote, endorse or advertise any 63 | Modified Version, except to acknowledge the contribution(s) of the 64 | Copyright Holder(s) and the Author(s) or with their explicit written 65 | permission. 66 | 67 | 5) The Font Software, modified or unmodified, in part or in whole, 68 | must be distributed entirely under this license, and must not be 69 | distributed under any other license. The requirement for fonts to 70 | remain under this license does not apply to any document created 71 | using the Font Software. 72 | 73 | TERMINATION 74 | This license becomes null and void if any of the above conditions are 75 | not met. 76 | 77 | DISCLAIMER 78 | THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 79 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF 80 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT 81 | OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE 82 | COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 83 | INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL 84 | DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 85 | FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM 86 | OTHER DEALINGS IN THE FONT SOFTWARE. 87 | -------------------------------------------------------------------------------- /examples/component_library/ConsumerApp/BlazorApp/wwwroot/css/open-iconic/FONT-LICENSE: -------------------------------------------------------------------------------- 1 | SIL OPEN FONT LICENSE Version 1.1 2 | 3 | Copyright (c) 2014 Waybury 4 | 5 | PREAMBLE 6 | The goals of the Open Font License (OFL) are to stimulate worldwide 7 | development of collaborative font projects, to support the font creation 8 | efforts of academic and linguistic communities, and to provide a free and 9 | open framework in which fonts may be shared and improved in partnership 10 | with others. 11 | 12 | The OFL allows the licensed fonts to be used, studied, modified and 13 | redistributed freely as long as they are not sold by themselves. The 14 | fonts, including any derivative works, can be bundled, embedded, 15 | redistributed and/or sold with any software provided that any reserved 16 | names are not used by derivative works. The fonts and derivatives, 17 | however, cannot be released under any other type of license. The 18 | requirement for fonts to remain under this license does not apply 19 | to any document created using the fonts or their derivatives. 20 | 21 | DEFINITIONS 22 | "Font Software" refers to the set of files released by the Copyright 23 | Holder(s) under this license and clearly marked as such. This may 24 | include source files, build scripts and documentation. 25 | 26 | "Reserved Font Name" refers to any names specified as such after the 27 | copyright statement(s). 28 | 29 | "Original Version" refers to the collection of Font Software components as 30 | distributed by the Copyright Holder(s). 31 | 32 | "Modified Version" refers to any derivative made by adding to, deleting, 33 | or substituting -- in part or in whole -- any of the components of the 34 | Original Version, by changing formats or by porting the Font Software to a 35 | new environment. 36 | 37 | "Author" refers to any designer, engineer, programmer, technical 38 | writer or other person who contributed to the Font Software. 39 | 40 | PERMISSION & CONDITIONS 41 | Permission is hereby granted, free of charge, to any person obtaining 42 | a copy of the Font Software, to use, study, copy, merge, embed, modify, 43 | redistribute, and sell modified and unmodified copies of the Font 44 | Software, subject to the following conditions: 45 | 46 | 1) Neither the Font Software nor any of its individual components, 47 | in Original or Modified Versions, may be sold by itself. 48 | 49 | 2) Original or Modified Versions of the Font Software may be bundled, 50 | redistributed and/or sold with any software, provided that each copy 51 | contains the above copyright notice and this license. These can be 52 | included either as stand-alone text files, human-readable headers or 53 | in the appropriate machine-readable metadata fields within text or 54 | binary files as long as those fields can be easily viewed by the user. 55 | 56 | 3) No Modified Version of the Font Software may use the Reserved Font 57 | Name(s) unless explicit written permission is granted by the corresponding 58 | Copyright Holder. This restriction only applies to the primary font name as 59 | presented to the users. 60 | 61 | 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font 62 | Software shall not be used to promote, endorse or advertise any 63 | Modified Version, except to acknowledge the contribution(s) of the 64 | Copyright Holder(s) and the Author(s) or with their explicit written 65 | permission. 66 | 67 | 5) The Font Software, modified or unmodified, in part or in whole, 68 | must be distributed entirely under this license, and must not be 69 | distributed under any other license. The requirement for fonts to 70 | remain under this license does not apply to any document created 71 | using the Font Software. 72 | 73 | TERMINATION 74 | This license becomes null and void if any of the above conditions are 75 | not met. 76 | 77 | DISCLAIMER 78 | THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 79 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF 80 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT 81 | OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE 82 | COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 83 | INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL 84 | DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 85 | FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM 86 | OTHER DEALINGS IN THE FONT SOFTWARE. 87 | -------------------------------------------------------------------------------- /examples/blazor_app_with_component_project/BlazorApp/wwwroot/css/open-iconic/FONT-LICENSE: -------------------------------------------------------------------------------- 1 | SIL OPEN FONT LICENSE Version 1.1 2 | 3 | Copyright (c) 2014 Waybury 4 | 5 | PREAMBLE 6 | The goals of the Open Font License (OFL) are to stimulate worldwide 7 | development of collaborative font projects, to support the font creation 8 | efforts of academic and linguistic communities, and to provide a free and 9 | open framework in which fonts may be shared and improved in partnership 10 | with others. 11 | 12 | The OFL allows the licensed fonts to be used, studied, modified and 13 | redistributed freely as long as they are not sold by themselves. The 14 | fonts, including any derivative works, can be bundled, embedded, 15 | redistributed and/or sold with any software provided that any reserved 16 | names are not used by derivative works. The fonts and derivatives, 17 | however, cannot be released under any other type of license. The 18 | requirement for fonts to remain under this license does not apply 19 | to any document created using the fonts or their derivatives. 20 | 21 | DEFINITIONS 22 | "Font Software" refers to the set of files released by the Copyright 23 | Holder(s) under this license and clearly marked as such. This may 24 | include source files, build scripts and documentation. 25 | 26 | "Reserved Font Name" refers to any names specified as such after the 27 | copyright statement(s). 28 | 29 | "Original Version" refers to the collection of Font Software components as 30 | distributed by the Copyright Holder(s). 31 | 32 | "Modified Version" refers to any derivative made by adding to, deleting, 33 | or substituting -- in part or in whole -- any of the components of the 34 | Original Version, by changing formats or by porting the Font Software to a 35 | new environment. 36 | 37 | "Author" refers to any designer, engineer, programmer, technical 38 | writer or other person who contributed to the Font Software. 39 | 40 | PERMISSION & CONDITIONS 41 | Permission is hereby granted, free of charge, to any person obtaining 42 | a copy of the Font Software, to use, study, copy, merge, embed, modify, 43 | redistribute, and sell modified and unmodified copies of the Font 44 | Software, subject to the following conditions: 45 | 46 | 1) Neither the Font Software nor any of its individual components, 47 | in Original or Modified Versions, may be sold by itself. 48 | 49 | 2) Original or Modified Versions of the Font Software may be bundled, 50 | redistributed and/or sold with any software, provided that each copy 51 | contains the above copyright notice and this license. These can be 52 | included either as stand-alone text files, human-readable headers or 53 | in the appropriate machine-readable metadata fields within text or 54 | binary files as long as those fields can be easily viewed by the user. 55 | 56 | 3) No Modified Version of the Font Software may use the Reserved Font 57 | Name(s) unless explicit written permission is granted by the corresponding 58 | Copyright Holder. This restriction only applies to the primary font name as 59 | presented to the users. 60 | 61 | 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font 62 | Software shall not be used to promote, endorse or advertise any 63 | Modified Version, except to acknowledge the contribution(s) of the 64 | Copyright Holder(s) and the Author(s) or with their explicit written 65 | permission. 66 | 67 | 5) The Font Software, modified or unmodified, in part or in whole, 68 | must be distributed entirely under this license, and must not be 69 | distributed under any other license. The requirement for fonts to 70 | remain under this license does not apply to any document created 71 | using the Font Software. 72 | 73 | TERMINATION 74 | This license becomes null and void if any of the above conditions are 75 | not met. 76 | 77 | DISCLAIMER 78 | THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 79 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF 80 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT 81 | OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE 82 | COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 83 | INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL 84 | DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 85 | FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM 86 | OTHER DEALINGS IN THE FONT SOFTWARE. 87 | -------------------------------------------------------------------------------- /examples/blazor_app_with_component_project/README.md: -------------------------------------------------------------------------------- 1 | # Blazor App with Component Project 2 | 3 | This example handles the use case for a blazor app with some components in a different project. The custom colors for deployment are defined in the BlazorApp. 4 | 5 | ## Relevant files 6 | 7 | All the following files have been modified slightly from the plain Blazor sample project. All changes are detailed below. 8 | 9 | ### ComponentWithStyle/ComponentWithStyle.csproj 10 | 11 | ```xml 12 | 13 | 14 | 15 | netstandard2.0 16 | 3.0 17 | css/component_with_style 18 | false 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | ``` 31 | 32 | - added ``. 33 | - `LazyStyleSheets` is configured to use a non-default output path `css/component_with_style`. 34 | - `LazyStyleSheets` is configured to not use `webcompiler` (because we want to define our own colors in the BlazorApp). 35 | 36 | 37 | ### ComponentWithStyle/ComponentWithUserDefinedColor.razor 38 | 39 | ```html 40 |
41 | This Blazor component is defined in the ComponentWithStyle package. 42 |
43 | ``` 44 | 45 | - we use a custom style called `component-style`. 46 | 47 | 48 | ### ComponentWithStyle/ComponentWithUserDefinedColor.razor.scss 49 | 50 | ```css 51 | @import '../../default_values.scss'; 52 | .component-style { 53 | color: $variable 54 | } 55 | ``` 56 | 57 | - we reference the file `../../default_values.scss` which contains the definition for the custom color stored in `variable`. 58 | - we define the style used in `ComponentWithUserDefinedColor.razor` 59 | - we use a variable instead of a hardcoded value 60 | 61 | ### BlazorApp/_Imports.razor 62 | 63 | ```cs 64 | @using System.Net.Http 65 | @using Microsoft.AspNetCore.Authorization 66 | @using Microsoft.AspNetCore.Components.Authorization 67 | @using Microsoft.AspNetCore.Components.Forms 68 | @using Microsoft.AspNetCore.Components.Routing 69 | @using Microsoft.AspNetCore.Components.Web 70 | @using Microsoft.JSInterop 71 | @using BlazorApp 72 | @using BlazorApp.Shared 73 | @using ComponentWithStyle 74 | ``` 75 | 76 | - added `@using ComponentWithStyle` 77 | 78 | ### BlazorApp/Pages/Index.razor 79 | 80 | ```html 81 | @page "/" 82 | 83 |

Hello, world!

84 | 85 | Welcome to your new app. 86 | 87 | 88 | 89 | 90 | ``` 91 | 92 | - use the `` component in the index page (so that we see it on the first page load). 93 | 94 | 95 | ### BlazorApp/wwwroot/default_values.scss 96 | 97 | ```css 98 | $variable:blue; 99 | ``` 100 | 101 | - define our custom color `variable` to be `blue`. 102 | 103 | ### BlazorApp/BlazorApp.csproj 104 | 105 | ```xml 106 | 107 | 108 | 109 | netcoreapp3.1 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | ``` 129 | 130 | - the BlazorApp has a dependency on project `ComponentWithStyle`: `` 131 | - Since this is a component project, not a component nuget package, we have to copy the files ourselves. That's achieved by the `Target` CopyResources: 132 | ```xml 133 | 134 | 135 | 136 | ``` 137 | - Now that we have the style sheets from the component project and have the variables defined (`BlazorApp/wwwroot/default_values.scss`), we want `webcompiler` to compile those scss files: 138 | ```xml 139 | 140 | 141 | 142 | ``` 143 | 144 | 145 | -------------------------------------------------------------------------------- /examples/standalone_app/BlazorApp/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | @import url('open-iconic/font/css/open-iconic-bootstrap.min.css'); 2 | 3 | html, body { 4 | font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; 5 | } 6 | 7 | a, .btn-link { 8 | color: #0366d6; 9 | } 10 | 11 | .btn-primary { 12 | color: #fff; 13 | background-color: #1b6ec2; 14 | border-color: #1861ac; 15 | } 16 | 17 | app { 18 | position: relative; 19 | display: -webkit-box; 20 | display: -ms-flexbox; 21 | display: flex; 22 | -webkit-box-orient: vertical; 23 | -webkit-box-direction: normal; 24 | -ms-flex-direction: column; 25 | flex-direction: column; 26 | } 27 | 28 | .top-row { 29 | height: 3.5rem; 30 | display: -webkit-box; 31 | display: -ms-flexbox; 32 | display: flex; 33 | -webkit-box-align: center; 34 | -ms-flex-align: center; 35 | align-items: center; 36 | } 37 | 38 | .main { 39 | -webkit-box-flex: 1; 40 | -ms-flex: 1; 41 | flex: 1; 42 | } 43 | 44 | .main .top-row { 45 | background-color: #f7f7f7; 46 | border-bottom: 1px solid #d6d5d5; 47 | -webkit-box-pack: end; 48 | -ms-flex-pack: end; 49 | justify-content: flex-end; 50 | } 51 | 52 | .main .top-row > a, .main .top-row .btn-link { 53 | white-space: nowrap; 54 | margin-left: 1.5rem; 55 | } 56 | 57 | .main .top-row a:first-child { 58 | overflow: hidden; 59 | -o-text-overflow: ellipsis; 60 | text-overflow: ellipsis; 61 | } 62 | 63 | .sidebar { 64 | background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(5, 39, 103)), color-stop(70%, #3a0647)); 65 | background-image: -o-linear-gradient(top, rgb(5, 39, 103) 0%, #3a0647 70%); 66 | background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%); 67 | } 68 | 69 | .sidebar .top-row { 70 | background-color: rgba(0,0,0,0.4); 71 | } 72 | 73 | .sidebar .navbar-brand { 74 | font-size: 1.1rem; 75 | } 76 | 77 | .sidebar .oi { 78 | width: 2rem; 79 | font-size: 1.1rem; 80 | vertical-align: text-top; 81 | top: -2px; 82 | } 83 | 84 | .sidebar .nav-item { 85 | font-size: 0.9rem; 86 | padding-bottom: 0.5rem; 87 | } 88 | 89 | .sidebar .nav-item:first-of-type { 90 | padding-top: 1rem; 91 | } 92 | 93 | .sidebar .nav-item:last-of-type { 94 | padding-bottom: 1rem; 95 | } 96 | 97 | .sidebar .nav-item a { 98 | color: #d7d7d7; 99 | border-radius: 4px; 100 | height: 3rem; 101 | display: -webkit-box; 102 | display: -ms-flexbox; 103 | display: flex; 104 | -webkit-box-align: center; 105 | -ms-flex-align: center; 106 | align-items: center; 107 | line-height: 3rem; 108 | } 109 | 110 | .sidebar .nav-item a.active { 111 | background-color: rgba(255,255,255,0.25); 112 | color: white; 113 | } 114 | 115 | .sidebar .nav-item a:hover { 116 | background-color: rgba(255,255,255,0.1); 117 | color: white; 118 | } 119 | 120 | .content { 121 | padding-top: 1.1rem; 122 | } 123 | 124 | .navbar-toggler { 125 | background-color: rgba(255, 255, 255, 0.1); 126 | } 127 | 128 | .valid.modified:not([type=checkbox]) { 129 | outline: 1px solid #26b050; 130 | } 131 | 132 | .invalid { 133 | outline: 1px solid red; 134 | } 135 | 136 | .validation-message { 137 | color: red; 138 | } 139 | 140 | #blazor-error-ui { 141 | background: lightyellow; 142 | bottom: 0; 143 | -webkit-box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); 144 | box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); 145 | display: none; 146 | left: 0; 147 | padding: 0.6rem 1.25rem 0.7rem 1.25rem; 148 | position: fixed; 149 | width: 100%; 150 | z-index: 1000; 151 | } 152 | 153 | #blazor-error-ui .dismiss { 154 | cursor: pointer; 155 | position: absolute; 156 | right: 0.75rem; 157 | top: 0.5rem; 158 | } 159 | 160 | @media (max-width: 767.98px) { 161 | .main .top-row:not(.auth) { 162 | display: none; 163 | } 164 | 165 | .main .top-row.auth { 166 | -webkit-box-pack: justify; 167 | -ms-flex-pack: justify; 168 | justify-content: space-between; 169 | } 170 | 171 | .main .top-row a, .main .top-row .btn-link { 172 | margin-left: 0; 173 | } 174 | } 175 | 176 | @media (min-width: 768px) { 177 | app { 178 | -webkit-box-orient: horizontal; 179 | -webkit-box-direction: normal; 180 | -ms-flex-direction: row; 181 | flex-direction: row; 182 | } 183 | 184 | .sidebar { 185 | width: 250px; 186 | height: 100vh; 187 | position: -webkit-sticky; 188 | position: sticky; 189 | top: 0; 190 | } 191 | 192 | .main .top-row { 193 | position: -webkit-sticky; 194 | position: sticky; 195 | top: 0; 196 | } 197 | 198 | .main > div { 199 | padding-left: 2rem !important; 200 | padding-right: 1.5rem !important; 201 | } 202 | 203 | .navbar-toggler { 204 | display: none; 205 | } 206 | 207 | .sidebar .collapse { 208 | /* Never collapse the sidebar for wide screens */ 209 | display: block; 210 | } 211 | } 212 | 213 | /*# sourceMappingURL=wwwroot\css\site.css.map */ -------------------------------------------------------------------------------- /examples/component_library/ConsumerApp/BlazorApp/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | @import url('open-iconic/font/css/open-iconic-bootstrap.min.css'); 2 | 3 | html, body { 4 | font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; 5 | } 6 | 7 | a, .btn-link { 8 | color: #0366d6; 9 | } 10 | 11 | .btn-primary { 12 | color: #fff; 13 | background-color: #1b6ec2; 14 | border-color: #1861ac; 15 | } 16 | 17 | app { 18 | position: relative; 19 | display: -webkit-box; 20 | display: -ms-flexbox; 21 | display: flex; 22 | -webkit-box-orient: vertical; 23 | -webkit-box-direction: normal; 24 | -ms-flex-direction: column; 25 | flex-direction: column; 26 | } 27 | 28 | .top-row { 29 | height: 3.5rem; 30 | display: -webkit-box; 31 | display: -ms-flexbox; 32 | display: flex; 33 | -webkit-box-align: center; 34 | -ms-flex-align: center; 35 | align-items: center; 36 | } 37 | 38 | .main { 39 | -webkit-box-flex: 1; 40 | -ms-flex: 1; 41 | flex: 1; 42 | } 43 | 44 | .main .top-row { 45 | background-color: #f7f7f7; 46 | border-bottom: 1px solid #d6d5d5; 47 | -webkit-box-pack: end; 48 | -ms-flex-pack: end; 49 | justify-content: flex-end; 50 | } 51 | 52 | .main .top-row > a, .main .top-row .btn-link { 53 | white-space: nowrap; 54 | margin-left: 1.5rem; 55 | } 56 | 57 | .main .top-row a:first-child { 58 | overflow: hidden; 59 | -o-text-overflow: ellipsis; 60 | text-overflow: ellipsis; 61 | } 62 | 63 | .sidebar { 64 | background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(5, 39, 103)), color-stop(70%, #3a0647)); 65 | background-image: -o-linear-gradient(top, rgb(5, 39, 103) 0%, #3a0647 70%); 66 | background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%); 67 | } 68 | 69 | .sidebar .top-row { 70 | background-color: rgba(0,0,0,0.4); 71 | } 72 | 73 | .sidebar .navbar-brand { 74 | font-size: 1.1rem; 75 | } 76 | 77 | .sidebar .oi { 78 | width: 2rem; 79 | font-size: 1.1rem; 80 | vertical-align: text-top; 81 | top: -2px; 82 | } 83 | 84 | .sidebar .nav-item { 85 | font-size: 0.9rem; 86 | padding-bottom: 0.5rem; 87 | } 88 | 89 | .sidebar .nav-item:first-of-type { 90 | padding-top: 1rem; 91 | } 92 | 93 | .sidebar .nav-item:last-of-type { 94 | padding-bottom: 1rem; 95 | } 96 | 97 | .sidebar .nav-item a { 98 | color: #d7d7d7; 99 | border-radius: 4px; 100 | height: 3rem; 101 | display: -webkit-box; 102 | display: -ms-flexbox; 103 | display: flex; 104 | -webkit-box-align: center; 105 | -ms-flex-align: center; 106 | align-items: center; 107 | line-height: 3rem; 108 | } 109 | 110 | .sidebar .nav-item a.active { 111 | background-color: rgba(255,255,255,0.25); 112 | color: white; 113 | } 114 | 115 | .sidebar .nav-item a:hover { 116 | background-color: rgba(255,255,255,0.1); 117 | color: white; 118 | } 119 | 120 | .content { 121 | padding-top: 1.1rem; 122 | } 123 | 124 | .navbar-toggler { 125 | background-color: rgba(255, 255, 255, 0.1); 126 | } 127 | 128 | .valid.modified:not([type=checkbox]) { 129 | outline: 1px solid #26b050; 130 | } 131 | 132 | .invalid { 133 | outline: 1px solid red; 134 | } 135 | 136 | .validation-message { 137 | color: red; 138 | } 139 | 140 | #blazor-error-ui { 141 | background: lightyellow; 142 | bottom: 0; 143 | -webkit-box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); 144 | box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); 145 | display: none; 146 | left: 0; 147 | padding: 0.6rem 1.25rem 0.7rem 1.25rem; 148 | position: fixed; 149 | width: 100%; 150 | z-index: 1000; 151 | } 152 | 153 | #blazor-error-ui .dismiss { 154 | cursor: pointer; 155 | position: absolute; 156 | right: 0.75rem; 157 | top: 0.5rem; 158 | } 159 | 160 | @media (max-width: 767.98px) { 161 | .main .top-row:not(.auth) { 162 | display: none; 163 | } 164 | 165 | .main .top-row.auth { 166 | -webkit-box-pack: justify; 167 | -ms-flex-pack: justify; 168 | justify-content: space-between; 169 | } 170 | 171 | .main .top-row a, .main .top-row .btn-link { 172 | margin-left: 0; 173 | } 174 | } 175 | 176 | @media (min-width: 768px) { 177 | app { 178 | -webkit-box-orient: horizontal; 179 | -webkit-box-direction: normal; 180 | -ms-flex-direction: row; 181 | flex-direction: row; 182 | } 183 | 184 | .sidebar { 185 | width: 250px; 186 | height: 100vh; 187 | position: -webkit-sticky; 188 | position: sticky; 189 | top: 0; 190 | } 191 | 192 | .main .top-row { 193 | position: -webkit-sticky; 194 | position: sticky; 195 | top: 0; 196 | } 197 | 198 | .main > div { 199 | padding-left: 2rem !important; 200 | padding-right: 1.5rem !important; 201 | } 202 | 203 | .navbar-toggler { 204 | display: none; 205 | } 206 | 207 | .sidebar .collapse { 208 | /* Never collapse the sidebar for wide screens */ 209 | display: block; 210 | } 211 | } 212 | 213 | /*# sourceMappingURL=wwwroot\css\site.css.map */ -------------------------------------------------------------------------------- /examples/blazor_app_with_component_project/BlazorApp/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | @import url('open-iconic/font/css/open-iconic-bootstrap.min.css'); 2 | 3 | html, body { 4 | font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; 5 | } 6 | 7 | a, .btn-link { 8 | color: #0366d6; 9 | } 10 | 11 | .btn-primary { 12 | color: #fff; 13 | background-color: #1b6ec2; 14 | border-color: #1861ac; 15 | } 16 | 17 | app { 18 | position: relative; 19 | display: -webkit-box; 20 | display: -ms-flexbox; 21 | display: flex; 22 | -webkit-box-orient: vertical; 23 | -webkit-box-direction: normal; 24 | -ms-flex-direction: column; 25 | flex-direction: column; 26 | } 27 | 28 | .top-row { 29 | height: 3.5rem; 30 | display: -webkit-box; 31 | display: -ms-flexbox; 32 | display: flex; 33 | -webkit-box-align: center; 34 | -ms-flex-align: center; 35 | align-items: center; 36 | } 37 | 38 | .main { 39 | -webkit-box-flex: 1; 40 | -ms-flex: 1; 41 | flex: 1; 42 | } 43 | 44 | .main .top-row { 45 | background-color: #f7f7f7; 46 | border-bottom: 1px solid #d6d5d5; 47 | -webkit-box-pack: end; 48 | -ms-flex-pack: end; 49 | justify-content: flex-end; 50 | } 51 | 52 | .main .top-row > a, .main .top-row .btn-link { 53 | white-space: nowrap; 54 | margin-left: 1.5rem; 55 | } 56 | 57 | .main .top-row a:first-child { 58 | overflow: hidden; 59 | -o-text-overflow: ellipsis; 60 | text-overflow: ellipsis; 61 | } 62 | 63 | .sidebar { 64 | background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(5, 39, 103)), color-stop(70%, #3a0647)); 65 | background-image: -o-linear-gradient(top, rgb(5, 39, 103) 0%, #3a0647 70%); 66 | background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%); 67 | } 68 | 69 | .sidebar .top-row { 70 | background-color: rgba(0,0,0,0.4); 71 | } 72 | 73 | .sidebar .navbar-brand { 74 | font-size: 1.1rem; 75 | } 76 | 77 | .sidebar .oi { 78 | width: 2rem; 79 | font-size: 1.1rem; 80 | vertical-align: text-top; 81 | top: -2px; 82 | } 83 | 84 | .sidebar .nav-item { 85 | font-size: 0.9rem; 86 | padding-bottom: 0.5rem; 87 | } 88 | 89 | .sidebar .nav-item:first-of-type { 90 | padding-top: 1rem; 91 | } 92 | 93 | .sidebar .nav-item:last-of-type { 94 | padding-bottom: 1rem; 95 | } 96 | 97 | .sidebar .nav-item a { 98 | color: #d7d7d7; 99 | border-radius: 4px; 100 | height: 3rem; 101 | display: -webkit-box; 102 | display: -ms-flexbox; 103 | display: flex; 104 | -webkit-box-align: center; 105 | -ms-flex-align: center; 106 | align-items: center; 107 | line-height: 3rem; 108 | } 109 | 110 | .sidebar .nav-item a.active { 111 | background-color: rgba(255,255,255,0.25); 112 | color: white; 113 | } 114 | 115 | .sidebar .nav-item a:hover { 116 | background-color: rgba(255,255,255,0.1); 117 | color: white; 118 | } 119 | 120 | .content { 121 | padding-top: 1.1rem; 122 | } 123 | 124 | .navbar-toggler { 125 | background-color: rgba(255, 255, 255, 0.1); 126 | } 127 | 128 | .valid.modified:not([type=checkbox]) { 129 | outline: 1px solid #26b050; 130 | } 131 | 132 | .invalid { 133 | outline: 1px solid red; 134 | } 135 | 136 | .validation-message { 137 | color: red; 138 | } 139 | 140 | #blazor-error-ui { 141 | background: lightyellow; 142 | bottom: 0; 143 | -webkit-box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); 144 | box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); 145 | display: none; 146 | left: 0; 147 | padding: 0.6rem 1.25rem 0.7rem 1.25rem; 148 | position: fixed; 149 | width: 100%; 150 | z-index: 1000; 151 | } 152 | 153 | #blazor-error-ui .dismiss { 154 | cursor: pointer; 155 | position: absolute; 156 | right: 0.75rem; 157 | top: 0.5rem; 158 | } 159 | 160 | @media (max-width: 767.98px) { 161 | .main .top-row:not(.auth) { 162 | display: none; 163 | } 164 | 165 | .main .top-row.auth { 166 | -webkit-box-pack: justify; 167 | -ms-flex-pack: justify; 168 | justify-content: space-between; 169 | } 170 | 171 | .main .top-row a, .main .top-row .btn-link { 172 | margin-left: 0; 173 | } 174 | } 175 | 176 | @media (min-width: 768px) { 177 | app { 178 | -webkit-box-orient: horizontal; 179 | -webkit-box-direction: normal; 180 | -ms-flex-direction: row; 181 | flex-direction: row; 182 | } 183 | 184 | .sidebar { 185 | width: 250px; 186 | height: 100vh; 187 | position: -webkit-sticky; 188 | position: sticky; 189 | top: 0; 190 | } 191 | 192 | .main .top-row { 193 | position: -webkit-sticky; 194 | position: sticky; 195 | top: 0; 196 | } 197 | 198 | .main > div { 199 | padding-left: 2rem !important; 200 | padding-right: 1.5rem !important; 201 | } 202 | 203 | .navbar-toggler { 204 | display: none; 205 | } 206 | 207 | .sidebar .collapse { 208 | /* Never collapse the sidebar for wide screens */ 209 | display: block; 210 | } 211 | } 212 | 213 | /*# sourceMappingURL=wwwroot\css\site.css.map */ -------------------------------------------------------------------------------- /lazy_style_sheet.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.29609.76 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "LazyStyleSheet", "LazyStyleSheet", "{5789B53E-E06C-45C7-BF77-70B8BFC02154}" 7 | ProjectSection(SolutionItems) = preProject 8 | README.md = README.md 9 | EndProjectSection 10 | EndProject 11 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LazyStyleSheet", "LazyStyleSheet\LazyStyleSheet.csproj", "{C8AB2357-162F-43CD-83F0-D4055C93FF93}" 12 | EndProject 13 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tests_LazyStyleSheet", "Tests_LazyStyleSheet\Tests_LazyStyleSheet.csproj", "{38CC662C-BBC8-4F95-BAB3-528B6D1F46F2}" 14 | EndProject 15 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Example Projects", "Example Projects", "{8FDD91C1-5AB3-4CAD-86E6-C0AD142EA4EE}" 16 | EndProject 17 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorApp", "examples\blazor_app_with_component_project\BlazorApp\BlazorApp.csproj", "{F0F60DDE-5607-49AD-A394-89B85657B1B5}" 18 | EndProject 19 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComponentWithStyle", "examples\blazor_app_with_component_project\ComponentWithStyle\ComponentWithStyle.csproj", "{F8DC4304-D068-4F39-93FB-B3C69FF01760}" 20 | EndProject 21 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComponentLibrary", "examples\component_library\ComponentLibrary\ComponentLibrary\ComponentLibrary.csproj", "{3193C23B-5575-4E6F-9A34-FB4262C635FA}" 22 | EndProject 23 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ConsumerApp", "examples\component_library\ConsumerApp\BlazorApp\ConsumerApp.csproj", "{962A4977-49A6-4B8B-857C-429E0A5EDBFE}" 24 | EndProject 25 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StandaloneApp", "examples\standalone_app\BlazorApp\StandaloneApp.csproj", "{7622BC6F-0262-49A4-B5D1-CACC6AB887EF}" 26 | EndProject 27 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Standalone", "Standalone", "{7B7993B2-6558-460B-9095-5AB94B8C521F}" 28 | ProjectSection(SolutionItems) = preProject 29 | examples\standalone_app\README.md = examples\standalone_app\README.md 30 | EndProjectSection 31 | EndProject 32 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ComponentLibrary", "ComponentLibrary", "{29A2AB81-706F-4F6B-9202-25C909801777}" 33 | ProjectSection(SolutionItems) = preProject 34 | examples\component_library\README.md = examples\component_library\README.md 35 | EndProjectSection 36 | EndProject 37 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SameProject", "SameProject", "{3CBB6664-E4A8-4230-A19C-EC301A239FCD}" 38 | ProjectSection(SolutionItems) = preProject 39 | examples\blazor_app_with_component_project\README.md = examples\blazor_app_with_component_project\README.md 40 | EndProjectSection 41 | EndProject 42 | Global 43 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 44 | Debug|Any CPU = Debug|Any CPU 45 | Package|Any CPU = Package|Any CPU 46 | Release|Any CPU = Release|Any CPU 47 | EndGlobalSection 48 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 49 | {C8AB2357-162F-43CD-83F0-D4055C93FF93}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 50 | {C8AB2357-162F-43CD-83F0-D4055C93FF93}.Debug|Any CPU.Build.0 = Debug|Any CPU 51 | {C8AB2357-162F-43CD-83F0-D4055C93FF93}.Package|Any CPU.ActiveCfg = Release|Any CPU 52 | {C8AB2357-162F-43CD-83F0-D4055C93FF93}.Package|Any CPU.Build.0 = Release|Any CPU 53 | {C8AB2357-162F-43CD-83F0-D4055C93FF93}.Release|Any CPU.ActiveCfg = Release|Any CPU 54 | {C8AB2357-162F-43CD-83F0-D4055C93FF93}.Release|Any CPU.Build.0 = Release|Any CPU 55 | {38CC662C-BBC8-4F95-BAB3-528B6D1F46F2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 56 | {38CC662C-BBC8-4F95-BAB3-528B6D1F46F2}.Debug|Any CPU.Build.0 = Debug|Any CPU 57 | {38CC662C-BBC8-4F95-BAB3-528B6D1F46F2}.Package|Any CPU.ActiveCfg = Release|Any CPU 58 | {38CC662C-BBC8-4F95-BAB3-528B6D1F46F2}.Package|Any CPU.Build.0 = Release|Any CPU 59 | {38CC662C-BBC8-4F95-BAB3-528B6D1F46F2}.Release|Any CPU.ActiveCfg = Release|Any CPU 60 | {38CC662C-BBC8-4F95-BAB3-528B6D1F46F2}.Release|Any CPU.Build.0 = Release|Any CPU 61 | {F0F60DDE-5607-49AD-A394-89B85657B1B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 62 | {F0F60DDE-5607-49AD-A394-89B85657B1B5}.Package|Any CPU.ActiveCfg = Release|Any CPU 63 | {F0F60DDE-5607-49AD-A394-89B85657B1B5}.Release|Any CPU.ActiveCfg = Release|Any CPU 64 | {F8DC4304-D068-4F39-93FB-B3C69FF01760}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 65 | {F8DC4304-D068-4F39-93FB-B3C69FF01760}.Package|Any CPU.ActiveCfg = Release|Any CPU 66 | {F8DC4304-D068-4F39-93FB-B3C69FF01760}.Release|Any CPU.ActiveCfg = Release|Any CPU 67 | {3193C23B-5575-4E6F-9A34-FB4262C635FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 68 | {3193C23B-5575-4E6F-9A34-FB4262C635FA}.Package|Any CPU.ActiveCfg = Release|Any CPU 69 | {3193C23B-5575-4E6F-9A34-FB4262C635FA}.Release|Any CPU.ActiveCfg = Release|Any CPU 70 | {962A4977-49A6-4B8B-857C-429E0A5EDBFE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 71 | {962A4977-49A6-4B8B-857C-429E0A5EDBFE}.Package|Any CPU.ActiveCfg = Release|Any CPU 72 | {962A4977-49A6-4B8B-857C-429E0A5EDBFE}.Release|Any CPU.ActiveCfg = Release|Any CPU 73 | {7622BC6F-0262-49A4-B5D1-CACC6AB887EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 74 | {7622BC6F-0262-49A4-B5D1-CACC6AB887EF}.Package|Any CPU.ActiveCfg = Release|Any CPU 75 | {7622BC6F-0262-49A4-B5D1-CACC6AB887EF}.Release|Any CPU.ActiveCfg = Release|Any CPU 76 | EndGlobalSection 77 | GlobalSection(SolutionProperties) = preSolution 78 | HideSolutionNode = FALSE 79 | EndGlobalSection 80 | GlobalSection(NestedProjects) = preSolution 81 | {C8AB2357-162F-43CD-83F0-D4055C93FF93} = {5789B53E-E06C-45C7-BF77-70B8BFC02154} 82 | {38CC662C-BBC8-4F95-BAB3-528B6D1F46F2} = {5789B53E-E06C-45C7-BF77-70B8BFC02154} 83 | {8FDD91C1-5AB3-4CAD-86E6-C0AD142EA4EE} = {5789B53E-E06C-45C7-BF77-70B8BFC02154} 84 | {F0F60DDE-5607-49AD-A394-89B85657B1B5} = {3CBB6664-E4A8-4230-A19C-EC301A239FCD} 85 | {F8DC4304-D068-4F39-93FB-B3C69FF01760} = {3CBB6664-E4A8-4230-A19C-EC301A239FCD} 86 | {3193C23B-5575-4E6F-9A34-FB4262C635FA} = {29A2AB81-706F-4F6B-9202-25C909801777} 87 | {962A4977-49A6-4B8B-857C-429E0A5EDBFE} = {29A2AB81-706F-4F6B-9202-25C909801777} 88 | {7622BC6F-0262-49A4-B5D1-CACC6AB887EF} = {7B7993B2-6558-460B-9095-5AB94B8C521F} 89 | {7B7993B2-6558-460B-9095-5AB94B8C521F} = {8FDD91C1-5AB3-4CAD-86E6-C0AD142EA4EE} 90 | {29A2AB81-706F-4F6B-9202-25C909801777} = {8FDD91C1-5AB3-4CAD-86E6-C0AD142EA4EE} 91 | {3CBB6664-E4A8-4230-A19C-EC301A239FCD} = {8FDD91C1-5AB3-4CAD-86E6-C0AD142EA4EE} 92 | EndGlobalSection 93 | GlobalSection(ExtensibilityGlobals) = postSolution 94 | SolutionGuid = {9D2C7E79-4DED-45B6-8F11-55E2CA67D344} 95 | EndGlobalSection 96 | EndGlobal 97 | -------------------------------------------------------------------------------- /examples/component_library/README.md: -------------------------------------------------------------------------------- 1 | # Component Library for use in consumer apps 2 | 3 | This example handles how you can create component libraries that use Excubo.Blazor.LazyStyleSheet where your users can define their custom colors. 4 | This folder includes the component library (which get's published as `nupkg`) and a sample app consuming that component library. 5 | 6 | ## Relevant files in ComponentLibrary 7 | 8 | ### ComponentLibrary/ComponentLibrary/ComponentWithUserDefinedColor.razor 9 | 10 | ```html 11 |
12 | This Blazor component is defined in the ComponentLibrary package. 13 |
14 | ``` 15 | 16 | - we use a custom style called `component-style`. 17 | 18 | 19 | ### ComponentLibrary/ComponentLibrary/ComponentWithUserDefinedColor.razor.scss 20 | 21 | ```css 22 | @import '../component_library_config.scss'; 23 | .component-style { 24 | color: $variable 25 | } 26 | ``` 27 | 28 | - the custom style for the component above. It uses a variable defined in a config file. 29 | 30 | ### ComponentLibrary/ComponentLibrary/wwwroot/component_library_config.scss 31 | 32 | ```css 33 | $variable:red; 34 | ``` 35 | 36 | - the default value that users get when using your component library for the very first time. 37 | 38 | ### ComponentLibrary/ComponentLibrary/build/ComponentLibrary.targets 39 | 40 | ```xml 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 53 | 54 | 55 | 58 | 59 | 60 | ``` 61 | 62 | This file is responsible for copying the scss files into the users application. There, the user will have the possibility to customize everything in `wwwroot\component_library_config.scss`. The `Message` commands are only for illustration. 63 | 64 | 65 | ### ComponentLibrary/ComponentLibrary/ComponentLibrary.csproj 66 | 67 | ```xml 68 | 69 | 70 | 71 | netstandard2.0 72 | 3.0 73 | true 74 | component_library 75 | false 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | ``` 96 | 97 | - added ``. 98 | - `LazyStyleSheets` is configured to use a non-default output path `component_library`. 99 | - `LazyStyleSheets` is configured to not use `webcompiler` (because we want to define our own colors in the consumers' app). 100 | - we include the `build` targets in the nuget package. 101 | 102 | ## What to tell your users 103 | 104 | All of the above is what's necessary in your component library. What's left now is what to tell your users to do with the library 105 | 106 | ### ConsumerApp/BlazorApp/_Imports.razor 107 | 108 | ```cs 109 | @using System.Net.Http 110 | @using Microsoft.AspNetCore.Authorization 111 | @using Microsoft.AspNetCore.Components.Authorization 112 | @using Microsoft.AspNetCore.Components.Forms 113 | @using Microsoft.AspNetCore.Components.Routing 114 | @using Microsoft.AspNetCore.Components.Web 115 | @using Microsoft.JSInterop 116 | @using BlazorApp 117 | @using BlazorApp.Shared 118 | @using ComponentLibrary 119 | ``` 120 | 121 | - added `@using ComponentLibrary` 122 | 123 | ### ConsumerApp/BlazorApp/Pages/Index.razor 124 | 125 | ```html 126 | @page "/" 127 | 128 |

Hello, world!

129 | 130 | Welcome to your new app. 131 | 132 | 133 | 134 | 135 | ``` 136 | 137 | - use the `` component in the index page (so that we see it on the first page load). 138 | 139 | 140 | ### ConsumerApp/BlazorApp/wwwroot/component_library_config.scss 141 | 142 | ```css 143 | $variable:green; 144 | ``` 145 | 146 | - here your user can define their custom color `variable`, e.g. to be `green`. 147 | 148 | ### BlazorApp/BlazorApp.csproj 149 | 150 | ```xml 151 | 152 | 153 | 154 | netcoreapp3.1 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | ``` 167 | 168 | - the BlazorApp has a dependency on the nuget package `ComponentLibrary`: `` 169 | 170 | - Now that we have the style sheets from the component library and have the variables defined (`BlazorApp/wwwroot/component_library_config.scss`), we want `webcompiler` to compile those scss files: 171 | ```xml 172 | 173 | 174 | 175 | ``` 176 | 177 | The user can of course any other pipeline to compile scss files. 178 | 179 | -------------------------------------------------------------------------------- /LazyStyleSheet/build/Excubo.Blazor.LazyStyleSheet.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | wwwroot 7 | css/components 8 | true 9 | false 10 | true 11 | true 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | $([System.String]::Copy($([System.IO.Path]::GetDirectoryName('$(CurrentFile)'))).Replace('\', '/')) 49 | 50 | 51 | /$(TMP__Directory) 52 | 53 | $([System.String]::Copy('$(TMP__DirectoryWithPrefix)').Replace('/','.')) 54 | $([System.IO.Path]::GetFilename('$(CurrentFile)').Substring(0, $([System.IO.Path]::GetFilename('$(CurrentFile)').IndexOf('.razor')))) 55 | $([System.IO.Path]::GetFilenameWithoutExtension('$(CurrentFile)')) 56 | css 57 | min.css 58 | css.gz 59 | min.css.gz 60 | $(LazyStyleSheets_ComponentStyleFolder)$(TMP__DirectoryWithPrefix)/$(TMP__File).$(TMP__Extension) 61 | 62 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /examples/standalone_app/BlazorApp/wwwroot/css/open-iconic/font/css/open-iconic-bootstrap.min.css: -------------------------------------------------------------------------------- 1 | @font-face{font-family:Icons;src:url(../fonts/open-iconic.eot);src:url(../fonts/open-iconic.eot?#iconic-sm) format('embedded-opentype'),url(../fonts/open-iconic.woff) format('woff'),url(../fonts/open-iconic.ttf) format('truetype'),url(../fonts/open-iconic.otf) format('opentype'),url(../fonts/open-iconic.svg#iconic-sm) format('svg');font-weight:400;font-style:normal}.oi{position:relative;top:1px;display:inline-block;speak:none;font-family:Icons;font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.oi:empty:before{width:1em;text-align:center;box-sizing:content-box}.oi.oi-align-center:before{text-align:center}.oi.oi-align-left:before{text-align:left}.oi.oi-align-right:before{text-align:right}.oi.oi-flip-horizontal:before{-webkit-transform:scale(-1,1);-ms-transform:scale(-1,1);transform:scale(-1,1)}.oi.oi-flip-vertical:before{-webkit-transform:scale(1,-1);-ms-transform:scale(-1,1);transform:scale(1,-1)}.oi.oi-flip-horizontal-vertical:before{-webkit-transform:scale(-1,-1);-ms-transform:scale(-1,1);transform:scale(-1,-1)}.oi-account-login:before{content:'\e000'}.oi-account-logout:before{content:'\e001'}.oi-action-redo:before{content:'\e002'}.oi-action-undo:before{content:'\e003'}.oi-align-center:before{content:'\e004'}.oi-align-left:before{content:'\e005'}.oi-align-right:before{content:'\e006'}.oi-aperture:before{content:'\e007'}.oi-arrow-bottom:before{content:'\e008'}.oi-arrow-circle-bottom:before{content:'\e009'}.oi-arrow-circle-left:before{content:'\e00a'}.oi-arrow-circle-right:before{content:'\e00b'}.oi-arrow-circle-top:before{content:'\e00c'}.oi-arrow-left:before{content:'\e00d'}.oi-arrow-right:before{content:'\e00e'}.oi-arrow-thick-bottom:before{content:'\e00f'}.oi-arrow-thick-left:before{content:'\e010'}.oi-arrow-thick-right:before{content:'\e011'}.oi-arrow-thick-top:before{content:'\e012'}.oi-arrow-top:before{content:'\e013'}.oi-audio-spectrum:before{content:'\e014'}.oi-audio:before{content:'\e015'}.oi-badge:before{content:'\e016'}.oi-ban:before{content:'\e017'}.oi-bar-chart:before{content:'\e018'}.oi-basket:before{content:'\e019'}.oi-battery-empty:before{content:'\e01a'}.oi-battery-full:before{content:'\e01b'}.oi-beaker:before{content:'\e01c'}.oi-bell:before{content:'\e01d'}.oi-bluetooth:before{content:'\e01e'}.oi-bold:before{content:'\e01f'}.oi-bolt:before{content:'\e020'}.oi-book:before{content:'\e021'}.oi-bookmark:before{content:'\e022'}.oi-box:before{content:'\e023'}.oi-briefcase:before{content:'\e024'}.oi-british-pound:before{content:'\e025'}.oi-browser:before{content:'\e026'}.oi-brush:before{content:'\e027'}.oi-bug:before{content:'\e028'}.oi-bullhorn:before{content:'\e029'}.oi-calculator:before{content:'\e02a'}.oi-calendar:before{content:'\e02b'}.oi-camera-slr:before{content:'\e02c'}.oi-caret-bottom:before{content:'\e02d'}.oi-caret-left:before{content:'\e02e'}.oi-caret-right:before{content:'\e02f'}.oi-caret-top:before{content:'\e030'}.oi-cart:before{content:'\e031'}.oi-chat:before{content:'\e032'}.oi-check:before{content:'\e033'}.oi-chevron-bottom:before{content:'\e034'}.oi-chevron-left:before{content:'\e035'}.oi-chevron-right:before{content:'\e036'}.oi-chevron-top:before{content:'\e037'}.oi-circle-check:before{content:'\e038'}.oi-circle-x:before{content:'\e039'}.oi-clipboard:before{content:'\e03a'}.oi-clock:before{content:'\e03b'}.oi-cloud-download:before{content:'\e03c'}.oi-cloud-upload:before{content:'\e03d'}.oi-cloud:before{content:'\e03e'}.oi-cloudy:before{content:'\e03f'}.oi-code:before{content:'\e040'}.oi-cog:before{content:'\e041'}.oi-collapse-down:before{content:'\e042'}.oi-collapse-left:before{content:'\e043'}.oi-collapse-right:before{content:'\e044'}.oi-collapse-up:before{content:'\e045'}.oi-command:before{content:'\e046'}.oi-comment-square:before{content:'\e047'}.oi-compass:before{content:'\e048'}.oi-contrast:before{content:'\e049'}.oi-copywriting:before{content:'\e04a'}.oi-credit-card:before{content:'\e04b'}.oi-crop:before{content:'\e04c'}.oi-dashboard:before{content:'\e04d'}.oi-data-transfer-download:before{content:'\e04e'}.oi-data-transfer-upload:before{content:'\e04f'}.oi-delete:before{content:'\e050'}.oi-dial:before{content:'\e051'}.oi-document:before{content:'\e052'}.oi-dollar:before{content:'\e053'}.oi-double-quote-sans-left:before{content:'\e054'}.oi-double-quote-sans-right:before{content:'\e055'}.oi-double-quote-serif-left:before{content:'\e056'}.oi-double-quote-serif-right:before{content:'\e057'}.oi-droplet:before{content:'\e058'}.oi-eject:before{content:'\e059'}.oi-elevator:before{content:'\e05a'}.oi-ellipses:before{content:'\e05b'}.oi-envelope-closed:before{content:'\e05c'}.oi-envelope-open:before{content:'\e05d'}.oi-euro:before{content:'\e05e'}.oi-excerpt:before{content:'\e05f'}.oi-expand-down:before{content:'\e060'}.oi-expand-left:before{content:'\e061'}.oi-expand-right:before{content:'\e062'}.oi-expand-up:before{content:'\e063'}.oi-external-link:before{content:'\e064'}.oi-eye:before{content:'\e065'}.oi-eyedropper:before{content:'\e066'}.oi-file:before{content:'\e067'}.oi-fire:before{content:'\e068'}.oi-flag:before{content:'\e069'}.oi-flash:before{content:'\e06a'}.oi-folder:before{content:'\e06b'}.oi-fork:before{content:'\e06c'}.oi-fullscreen-enter:before{content:'\e06d'}.oi-fullscreen-exit:before{content:'\e06e'}.oi-globe:before{content:'\e06f'}.oi-graph:before{content:'\e070'}.oi-grid-four-up:before{content:'\e071'}.oi-grid-three-up:before{content:'\e072'}.oi-grid-two-up:before{content:'\e073'}.oi-hard-drive:before{content:'\e074'}.oi-header:before{content:'\e075'}.oi-headphones:before{content:'\e076'}.oi-heart:before{content:'\e077'}.oi-home:before{content:'\e078'}.oi-image:before{content:'\e079'}.oi-inbox:before{content:'\e07a'}.oi-infinity:before{content:'\e07b'}.oi-info:before{content:'\e07c'}.oi-italic:before{content:'\e07d'}.oi-justify-center:before{content:'\e07e'}.oi-justify-left:before{content:'\e07f'}.oi-justify-right:before{content:'\e080'}.oi-key:before{content:'\e081'}.oi-laptop:before{content:'\e082'}.oi-layers:before{content:'\e083'}.oi-lightbulb:before{content:'\e084'}.oi-link-broken:before{content:'\e085'}.oi-link-intact:before{content:'\e086'}.oi-list-rich:before{content:'\e087'}.oi-list:before{content:'\e088'}.oi-location:before{content:'\e089'}.oi-lock-locked:before{content:'\e08a'}.oi-lock-unlocked:before{content:'\e08b'}.oi-loop-circular:before{content:'\e08c'}.oi-loop-square:before{content:'\e08d'}.oi-loop:before{content:'\e08e'}.oi-magnifying-glass:before{content:'\e08f'}.oi-map-marker:before{content:'\e090'}.oi-map:before{content:'\e091'}.oi-media-pause:before{content:'\e092'}.oi-media-play:before{content:'\e093'}.oi-media-record:before{content:'\e094'}.oi-media-skip-backward:before{content:'\e095'}.oi-media-skip-forward:before{content:'\e096'}.oi-media-step-backward:before{content:'\e097'}.oi-media-step-forward:before{content:'\e098'}.oi-media-stop:before{content:'\e099'}.oi-medical-cross:before{content:'\e09a'}.oi-menu:before{content:'\e09b'}.oi-microphone:before{content:'\e09c'}.oi-minus:before{content:'\e09d'}.oi-monitor:before{content:'\e09e'}.oi-moon:before{content:'\e09f'}.oi-move:before{content:'\e0a0'}.oi-musical-note:before{content:'\e0a1'}.oi-paperclip:before{content:'\e0a2'}.oi-pencil:before{content:'\e0a3'}.oi-people:before{content:'\e0a4'}.oi-person:before{content:'\e0a5'}.oi-phone:before{content:'\e0a6'}.oi-pie-chart:before{content:'\e0a7'}.oi-pin:before{content:'\e0a8'}.oi-play-circle:before{content:'\e0a9'}.oi-plus:before{content:'\e0aa'}.oi-power-standby:before{content:'\e0ab'}.oi-print:before{content:'\e0ac'}.oi-project:before{content:'\e0ad'}.oi-pulse:before{content:'\e0ae'}.oi-puzzle-piece:before{content:'\e0af'}.oi-question-mark:before{content:'\e0b0'}.oi-rain:before{content:'\e0b1'}.oi-random:before{content:'\e0b2'}.oi-reload:before{content:'\e0b3'}.oi-resize-both:before{content:'\e0b4'}.oi-resize-height:before{content:'\e0b5'}.oi-resize-width:before{content:'\e0b6'}.oi-rss-alt:before{content:'\e0b7'}.oi-rss:before{content:'\e0b8'}.oi-script:before{content:'\e0b9'}.oi-share-boxed:before{content:'\e0ba'}.oi-share:before{content:'\e0bb'}.oi-shield:before{content:'\e0bc'}.oi-signal:before{content:'\e0bd'}.oi-signpost:before{content:'\e0be'}.oi-sort-ascending:before{content:'\e0bf'}.oi-sort-descending:before{content:'\e0c0'}.oi-spreadsheet:before{content:'\e0c1'}.oi-star:before{content:'\e0c2'}.oi-sun:before{content:'\e0c3'}.oi-tablet:before{content:'\e0c4'}.oi-tag:before{content:'\e0c5'}.oi-tags:before{content:'\e0c6'}.oi-target:before{content:'\e0c7'}.oi-task:before{content:'\e0c8'}.oi-terminal:before{content:'\e0c9'}.oi-text:before{content:'\e0ca'}.oi-thumb-down:before{content:'\e0cb'}.oi-thumb-up:before{content:'\e0cc'}.oi-timer:before{content:'\e0cd'}.oi-transfer:before{content:'\e0ce'}.oi-trash:before{content:'\e0cf'}.oi-underline:before{content:'\e0d0'}.oi-vertical-align-bottom:before{content:'\e0d1'}.oi-vertical-align-center:before{content:'\e0d2'}.oi-vertical-align-top:before{content:'\e0d3'}.oi-video:before{content:'\e0d4'}.oi-volume-high:before{content:'\e0d5'}.oi-volume-low:before{content:'\e0d6'}.oi-volume-off:before{content:'\e0d7'}.oi-warning:before{content:'\e0d8'}.oi-wifi:before{content:'\e0d9'}.oi-wrench:before{content:'\e0da'}.oi-x:before{content:'\e0db'}.oi-yen:before{content:'\e0dc'}.oi-zoom-in:before{content:'\e0dd'}.oi-zoom-out:before{content:'\e0de'} -------------------------------------------------------------------------------- /examples/component_library/ConsumerApp/BlazorApp/wwwroot/css/open-iconic/font/css/open-iconic-bootstrap.min.css: -------------------------------------------------------------------------------- 1 | @font-face{font-family:Icons;src:url(../fonts/open-iconic.eot);src:url(../fonts/open-iconic.eot?#iconic-sm) format('embedded-opentype'),url(../fonts/open-iconic.woff) format('woff'),url(../fonts/open-iconic.ttf) format('truetype'),url(../fonts/open-iconic.otf) format('opentype'),url(../fonts/open-iconic.svg#iconic-sm) format('svg');font-weight:400;font-style:normal}.oi{position:relative;top:1px;display:inline-block;speak:none;font-family:Icons;font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.oi:empty:before{width:1em;text-align:center;box-sizing:content-box}.oi.oi-align-center:before{text-align:center}.oi.oi-align-left:before{text-align:left}.oi.oi-align-right:before{text-align:right}.oi.oi-flip-horizontal:before{-webkit-transform:scale(-1,1);-ms-transform:scale(-1,1);transform:scale(-1,1)}.oi.oi-flip-vertical:before{-webkit-transform:scale(1,-1);-ms-transform:scale(-1,1);transform:scale(1,-1)}.oi.oi-flip-horizontal-vertical:before{-webkit-transform:scale(-1,-1);-ms-transform:scale(-1,1);transform:scale(-1,-1)}.oi-account-login:before{content:'\e000'}.oi-account-logout:before{content:'\e001'}.oi-action-redo:before{content:'\e002'}.oi-action-undo:before{content:'\e003'}.oi-align-center:before{content:'\e004'}.oi-align-left:before{content:'\e005'}.oi-align-right:before{content:'\e006'}.oi-aperture:before{content:'\e007'}.oi-arrow-bottom:before{content:'\e008'}.oi-arrow-circle-bottom:before{content:'\e009'}.oi-arrow-circle-left:before{content:'\e00a'}.oi-arrow-circle-right:before{content:'\e00b'}.oi-arrow-circle-top:before{content:'\e00c'}.oi-arrow-left:before{content:'\e00d'}.oi-arrow-right:before{content:'\e00e'}.oi-arrow-thick-bottom:before{content:'\e00f'}.oi-arrow-thick-left:before{content:'\e010'}.oi-arrow-thick-right:before{content:'\e011'}.oi-arrow-thick-top:before{content:'\e012'}.oi-arrow-top:before{content:'\e013'}.oi-audio-spectrum:before{content:'\e014'}.oi-audio:before{content:'\e015'}.oi-badge:before{content:'\e016'}.oi-ban:before{content:'\e017'}.oi-bar-chart:before{content:'\e018'}.oi-basket:before{content:'\e019'}.oi-battery-empty:before{content:'\e01a'}.oi-battery-full:before{content:'\e01b'}.oi-beaker:before{content:'\e01c'}.oi-bell:before{content:'\e01d'}.oi-bluetooth:before{content:'\e01e'}.oi-bold:before{content:'\e01f'}.oi-bolt:before{content:'\e020'}.oi-book:before{content:'\e021'}.oi-bookmark:before{content:'\e022'}.oi-box:before{content:'\e023'}.oi-briefcase:before{content:'\e024'}.oi-british-pound:before{content:'\e025'}.oi-browser:before{content:'\e026'}.oi-brush:before{content:'\e027'}.oi-bug:before{content:'\e028'}.oi-bullhorn:before{content:'\e029'}.oi-calculator:before{content:'\e02a'}.oi-calendar:before{content:'\e02b'}.oi-camera-slr:before{content:'\e02c'}.oi-caret-bottom:before{content:'\e02d'}.oi-caret-left:before{content:'\e02e'}.oi-caret-right:before{content:'\e02f'}.oi-caret-top:before{content:'\e030'}.oi-cart:before{content:'\e031'}.oi-chat:before{content:'\e032'}.oi-check:before{content:'\e033'}.oi-chevron-bottom:before{content:'\e034'}.oi-chevron-left:before{content:'\e035'}.oi-chevron-right:before{content:'\e036'}.oi-chevron-top:before{content:'\e037'}.oi-circle-check:before{content:'\e038'}.oi-circle-x:before{content:'\e039'}.oi-clipboard:before{content:'\e03a'}.oi-clock:before{content:'\e03b'}.oi-cloud-download:before{content:'\e03c'}.oi-cloud-upload:before{content:'\e03d'}.oi-cloud:before{content:'\e03e'}.oi-cloudy:before{content:'\e03f'}.oi-code:before{content:'\e040'}.oi-cog:before{content:'\e041'}.oi-collapse-down:before{content:'\e042'}.oi-collapse-left:before{content:'\e043'}.oi-collapse-right:before{content:'\e044'}.oi-collapse-up:before{content:'\e045'}.oi-command:before{content:'\e046'}.oi-comment-square:before{content:'\e047'}.oi-compass:before{content:'\e048'}.oi-contrast:before{content:'\e049'}.oi-copywriting:before{content:'\e04a'}.oi-credit-card:before{content:'\e04b'}.oi-crop:before{content:'\e04c'}.oi-dashboard:before{content:'\e04d'}.oi-data-transfer-download:before{content:'\e04e'}.oi-data-transfer-upload:before{content:'\e04f'}.oi-delete:before{content:'\e050'}.oi-dial:before{content:'\e051'}.oi-document:before{content:'\e052'}.oi-dollar:before{content:'\e053'}.oi-double-quote-sans-left:before{content:'\e054'}.oi-double-quote-sans-right:before{content:'\e055'}.oi-double-quote-serif-left:before{content:'\e056'}.oi-double-quote-serif-right:before{content:'\e057'}.oi-droplet:before{content:'\e058'}.oi-eject:before{content:'\e059'}.oi-elevator:before{content:'\e05a'}.oi-ellipses:before{content:'\e05b'}.oi-envelope-closed:before{content:'\e05c'}.oi-envelope-open:before{content:'\e05d'}.oi-euro:before{content:'\e05e'}.oi-excerpt:before{content:'\e05f'}.oi-expand-down:before{content:'\e060'}.oi-expand-left:before{content:'\e061'}.oi-expand-right:before{content:'\e062'}.oi-expand-up:before{content:'\e063'}.oi-external-link:before{content:'\e064'}.oi-eye:before{content:'\e065'}.oi-eyedropper:before{content:'\e066'}.oi-file:before{content:'\e067'}.oi-fire:before{content:'\e068'}.oi-flag:before{content:'\e069'}.oi-flash:before{content:'\e06a'}.oi-folder:before{content:'\e06b'}.oi-fork:before{content:'\e06c'}.oi-fullscreen-enter:before{content:'\e06d'}.oi-fullscreen-exit:before{content:'\e06e'}.oi-globe:before{content:'\e06f'}.oi-graph:before{content:'\e070'}.oi-grid-four-up:before{content:'\e071'}.oi-grid-three-up:before{content:'\e072'}.oi-grid-two-up:before{content:'\e073'}.oi-hard-drive:before{content:'\e074'}.oi-header:before{content:'\e075'}.oi-headphones:before{content:'\e076'}.oi-heart:before{content:'\e077'}.oi-home:before{content:'\e078'}.oi-image:before{content:'\e079'}.oi-inbox:before{content:'\e07a'}.oi-infinity:before{content:'\e07b'}.oi-info:before{content:'\e07c'}.oi-italic:before{content:'\e07d'}.oi-justify-center:before{content:'\e07e'}.oi-justify-left:before{content:'\e07f'}.oi-justify-right:before{content:'\e080'}.oi-key:before{content:'\e081'}.oi-laptop:before{content:'\e082'}.oi-layers:before{content:'\e083'}.oi-lightbulb:before{content:'\e084'}.oi-link-broken:before{content:'\e085'}.oi-link-intact:before{content:'\e086'}.oi-list-rich:before{content:'\e087'}.oi-list:before{content:'\e088'}.oi-location:before{content:'\e089'}.oi-lock-locked:before{content:'\e08a'}.oi-lock-unlocked:before{content:'\e08b'}.oi-loop-circular:before{content:'\e08c'}.oi-loop-square:before{content:'\e08d'}.oi-loop:before{content:'\e08e'}.oi-magnifying-glass:before{content:'\e08f'}.oi-map-marker:before{content:'\e090'}.oi-map:before{content:'\e091'}.oi-media-pause:before{content:'\e092'}.oi-media-play:before{content:'\e093'}.oi-media-record:before{content:'\e094'}.oi-media-skip-backward:before{content:'\e095'}.oi-media-skip-forward:before{content:'\e096'}.oi-media-step-backward:before{content:'\e097'}.oi-media-step-forward:before{content:'\e098'}.oi-media-stop:before{content:'\e099'}.oi-medical-cross:before{content:'\e09a'}.oi-menu:before{content:'\e09b'}.oi-microphone:before{content:'\e09c'}.oi-minus:before{content:'\e09d'}.oi-monitor:before{content:'\e09e'}.oi-moon:before{content:'\e09f'}.oi-move:before{content:'\e0a0'}.oi-musical-note:before{content:'\e0a1'}.oi-paperclip:before{content:'\e0a2'}.oi-pencil:before{content:'\e0a3'}.oi-people:before{content:'\e0a4'}.oi-person:before{content:'\e0a5'}.oi-phone:before{content:'\e0a6'}.oi-pie-chart:before{content:'\e0a7'}.oi-pin:before{content:'\e0a8'}.oi-play-circle:before{content:'\e0a9'}.oi-plus:before{content:'\e0aa'}.oi-power-standby:before{content:'\e0ab'}.oi-print:before{content:'\e0ac'}.oi-project:before{content:'\e0ad'}.oi-pulse:before{content:'\e0ae'}.oi-puzzle-piece:before{content:'\e0af'}.oi-question-mark:before{content:'\e0b0'}.oi-rain:before{content:'\e0b1'}.oi-random:before{content:'\e0b2'}.oi-reload:before{content:'\e0b3'}.oi-resize-both:before{content:'\e0b4'}.oi-resize-height:before{content:'\e0b5'}.oi-resize-width:before{content:'\e0b6'}.oi-rss-alt:before{content:'\e0b7'}.oi-rss:before{content:'\e0b8'}.oi-script:before{content:'\e0b9'}.oi-share-boxed:before{content:'\e0ba'}.oi-share:before{content:'\e0bb'}.oi-shield:before{content:'\e0bc'}.oi-signal:before{content:'\e0bd'}.oi-signpost:before{content:'\e0be'}.oi-sort-ascending:before{content:'\e0bf'}.oi-sort-descending:before{content:'\e0c0'}.oi-spreadsheet:before{content:'\e0c1'}.oi-star:before{content:'\e0c2'}.oi-sun:before{content:'\e0c3'}.oi-tablet:before{content:'\e0c4'}.oi-tag:before{content:'\e0c5'}.oi-tags:before{content:'\e0c6'}.oi-target:before{content:'\e0c7'}.oi-task:before{content:'\e0c8'}.oi-terminal:before{content:'\e0c9'}.oi-text:before{content:'\e0ca'}.oi-thumb-down:before{content:'\e0cb'}.oi-thumb-up:before{content:'\e0cc'}.oi-timer:before{content:'\e0cd'}.oi-transfer:before{content:'\e0ce'}.oi-trash:before{content:'\e0cf'}.oi-underline:before{content:'\e0d0'}.oi-vertical-align-bottom:before{content:'\e0d1'}.oi-vertical-align-center:before{content:'\e0d2'}.oi-vertical-align-top:before{content:'\e0d3'}.oi-video:before{content:'\e0d4'}.oi-volume-high:before{content:'\e0d5'}.oi-volume-low:before{content:'\e0d6'}.oi-volume-off:before{content:'\e0d7'}.oi-warning:before{content:'\e0d8'}.oi-wifi:before{content:'\e0d9'}.oi-wrench:before{content:'\e0da'}.oi-x:before{content:'\e0db'}.oi-yen:before{content:'\e0dc'}.oi-zoom-in:before{content:'\e0dd'}.oi-zoom-out:before{content:'\e0de'} -------------------------------------------------------------------------------- /examples/blazor_app_with_component_project/BlazorApp/wwwroot/css/open-iconic/font/css/open-iconic-bootstrap.min.css: -------------------------------------------------------------------------------- 1 | @font-face{font-family:Icons;src:url(../fonts/open-iconic.eot);src:url(../fonts/open-iconic.eot?#iconic-sm) format('embedded-opentype'),url(../fonts/open-iconic.woff) format('woff'),url(../fonts/open-iconic.ttf) format('truetype'),url(../fonts/open-iconic.otf) format('opentype'),url(../fonts/open-iconic.svg#iconic-sm) format('svg');font-weight:400;font-style:normal}.oi{position:relative;top:1px;display:inline-block;speak:none;font-family:Icons;font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.oi:empty:before{width:1em;text-align:center;box-sizing:content-box}.oi.oi-align-center:before{text-align:center}.oi.oi-align-left:before{text-align:left}.oi.oi-align-right:before{text-align:right}.oi.oi-flip-horizontal:before{-webkit-transform:scale(-1,1);-ms-transform:scale(-1,1);transform:scale(-1,1)}.oi.oi-flip-vertical:before{-webkit-transform:scale(1,-1);-ms-transform:scale(-1,1);transform:scale(1,-1)}.oi.oi-flip-horizontal-vertical:before{-webkit-transform:scale(-1,-1);-ms-transform:scale(-1,1);transform:scale(-1,-1)}.oi-account-login:before{content:'\e000'}.oi-account-logout:before{content:'\e001'}.oi-action-redo:before{content:'\e002'}.oi-action-undo:before{content:'\e003'}.oi-align-center:before{content:'\e004'}.oi-align-left:before{content:'\e005'}.oi-align-right:before{content:'\e006'}.oi-aperture:before{content:'\e007'}.oi-arrow-bottom:before{content:'\e008'}.oi-arrow-circle-bottom:before{content:'\e009'}.oi-arrow-circle-left:before{content:'\e00a'}.oi-arrow-circle-right:before{content:'\e00b'}.oi-arrow-circle-top:before{content:'\e00c'}.oi-arrow-left:before{content:'\e00d'}.oi-arrow-right:before{content:'\e00e'}.oi-arrow-thick-bottom:before{content:'\e00f'}.oi-arrow-thick-left:before{content:'\e010'}.oi-arrow-thick-right:before{content:'\e011'}.oi-arrow-thick-top:before{content:'\e012'}.oi-arrow-top:before{content:'\e013'}.oi-audio-spectrum:before{content:'\e014'}.oi-audio:before{content:'\e015'}.oi-badge:before{content:'\e016'}.oi-ban:before{content:'\e017'}.oi-bar-chart:before{content:'\e018'}.oi-basket:before{content:'\e019'}.oi-battery-empty:before{content:'\e01a'}.oi-battery-full:before{content:'\e01b'}.oi-beaker:before{content:'\e01c'}.oi-bell:before{content:'\e01d'}.oi-bluetooth:before{content:'\e01e'}.oi-bold:before{content:'\e01f'}.oi-bolt:before{content:'\e020'}.oi-book:before{content:'\e021'}.oi-bookmark:before{content:'\e022'}.oi-box:before{content:'\e023'}.oi-briefcase:before{content:'\e024'}.oi-british-pound:before{content:'\e025'}.oi-browser:before{content:'\e026'}.oi-brush:before{content:'\e027'}.oi-bug:before{content:'\e028'}.oi-bullhorn:before{content:'\e029'}.oi-calculator:before{content:'\e02a'}.oi-calendar:before{content:'\e02b'}.oi-camera-slr:before{content:'\e02c'}.oi-caret-bottom:before{content:'\e02d'}.oi-caret-left:before{content:'\e02e'}.oi-caret-right:before{content:'\e02f'}.oi-caret-top:before{content:'\e030'}.oi-cart:before{content:'\e031'}.oi-chat:before{content:'\e032'}.oi-check:before{content:'\e033'}.oi-chevron-bottom:before{content:'\e034'}.oi-chevron-left:before{content:'\e035'}.oi-chevron-right:before{content:'\e036'}.oi-chevron-top:before{content:'\e037'}.oi-circle-check:before{content:'\e038'}.oi-circle-x:before{content:'\e039'}.oi-clipboard:before{content:'\e03a'}.oi-clock:before{content:'\e03b'}.oi-cloud-download:before{content:'\e03c'}.oi-cloud-upload:before{content:'\e03d'}.oi-cloud:before{content:'\e03e'}.oi-cloudy:before{content:'\e03f'}.oi-code:before{content:'\e040'}.oi-cog:before{content:'\e041'}.oi-collapse-down:before{content:'\e042'}.oi-collapse-left:before{content:'\e043'}.oi-collapse-right:before{content:'\e044'}.oi-collapse-up:before{content:'\e045'}.oi-command:before{content:'\e046'}.oi-comment-square:before{content:'\e047'}.oi-compass:before{content:'\e048'}.oi-contrast:before{content:'\e049'}.oi-copywriting:before{content:'\e04a'}.oi-credit-card:before{content:'\e04b'}.oi-crop:before{content:'\e04c'}.oi-dashboard:before{content:'\e04d'}.oi-data-transfer-download:before{content:'\e04e'}.oi-data-transfer-upload:before{content:'\e04f'}.oi-delete:before{content:'\e050'}.oi-dial:before{content:'\e051'}.oi-document:before{content:'\e052'}.oi-dollar:before{content:'\e053'}.oi-double-quote-sans-left:before{content:'\e054'}.oi-double-quote-sans-right:before{content:'\e055'}.oi-double-quote-serif-left:before{content:'\e056'}.oi-double-quote-serif-right:before{content:'\e057'}.oi-droplet:before{content:'\e058'}.oi-eject:before{content:'\e059'}.oi-elevator:before{content:'\e05a'}.oi-ellipses:before{content:'\e05b'}.oi-envelope-closed:before{content:'\e05c'}.oi-envelope-open:before{content:'\e05d'}.oi-euro:before{content:'\e05e'}.oi-excerpt:before{content:'\e05f'}.oi-expand-down:before{content:'\e060'}.oi-expand-left:before{content:'\e061'}.oi-expand-right:before{content:'\e062'}.oi-expand-up:before{content:'\e063'}.oi-external-link:before{content:'\e064'}.oi-eye:before{content:'\e065'}.oi-eyedropper:before{content:'\e066'}.oi-file:before{content:'\e067'}.oi-fire:before{content:'\e068'}.oi-flag:before{content:'\e069'}.oi-flash:before{content:'\e06a'}.oi-folder:before{content:'\e06b'}.oi-fork:before{content:'\e06c'}.oi-fullscreen-enter:before{content:'\e06d'}.oi-fullscreen-exit:before{content:'\e06e'}.oi-globe:before{content:'\e06f'}.oi-graph:before{content:'\e070'}.oi-grid-four-up:before{content:'\e071'}.oi-grid-three-up:before{content:'\e072'}.oi-grid-two-up:before{content:'\e073'}.oi-hard-drive:before{content:'\e074'}.oi-header:before{content:'\e075'}.oi-headphones:before{content:'\e076'}.oi-heart:before{content:'\e077'}.oi-home:before{content:'\e078'}.oi-image:before{content:'\e079'}.oi-inbox:before{content:'\e07a'}.oi-infinity:before{content:'\e07b'}.oi-info:before{content:'\e07c'}.oi-italic:before{content:'\e07d'}.oi-justify-center:before{content:'\e07e'}.oi-justify-left:before{content:'\e07f'}.oi-justify-right:before{content:'\e080'}.oi-key:before{content:'\e081'}.oi-laptop:before{content:'\e082'}.oi-layers:before{content:'\e083'}.oi-lightbulb:before{content:'\e084'}.oi-link-broken:before{content:'\e085'}.oi-link-intact:before{content:'\e086'}.oi-list-rich:before{content:'\e087'}.oi-list:before{content:'\e088'}.oi-location:before{content:'\e089'}.oi-lock-locked:before{content:'\e08a'}.oi-lock-unlocked:before{content:'\e08b'}.oi-loop-circular:before{content:'\e08c'}.oi-loop-square:before{content:'\e08d'}.oi-loop:before{content:'\e08e'}.oi-magnifying-glass:before{content:'\e08f'}.oi-map-marker:before{content:'\e090'}.oi-map:before{content:'\e091'}.oi-media-pause:before{content:'\e092'}.oi-media-play:before{content:'\e093'}.oi-media-record:before{content:'\e094'}.oi-media-skip-backward:before{content:'\e095'}.oi-media-skip-forward:before{content:'\e096'}.oi-media-step-backward:before{content:'\e097'}.oi-media-step-forward:before{content:'\e098'}.oi-media-stop:before{content:'\e099'}.oi-medical-cross:before{content:'\e09a'}.oi-menu:before{content:'\e09b'}.oi-microphone:before{content:'\e09c'}.oi-minus:before{content:'\e09d'}.oi-monitor:before{content:'\e09e'}.oi-moon:before{content:'\e09f'}.oi-move:before{content:'\e0a0'}.oi-musical-note:before{content:'\e0a1'}.oi-paperclip:before{content:'\e0a2'}.oi-pencil:before{content:'\e0a3'}.oi-people:before{content:'\e0a4'}.oi-person:before{content:'\e0a5'}.oi-phone:before{content:'\e0a6'}.oi-pie-chart:before{content:'\e0a7'}.oi-pin:before{content:'\e0a8'}.oi-play-circle:before{content:'\e0a9'}.oi-plus:before{content:'\e0aa'}.oi-power-standby:before{content:'\e0ab'}.oi-print:before{content:'\e0ac'}.oi-project:before{content:'\e0ad'}.oi-pulse:before{content:'\e0ae'}.oi-puzzle-piece:before{content:'\e0af'}.oi-question-mark:before{content:'\e0b0'}.oi-rain:before{content:'\e0b1'}.oi-random:before{content:'\e0b2'}.oi-reload:before{content:'\e0b3'}.oi-resize-both:before{content:'\e0b4'}.oi-resize-height:before{content:'\e0b5'}.oi-resize-width:before{content:'\e0b6'}.oi-rss-alt:before{content:'\e0b7'}.oi-rss:before{content:'\e0b8'}.oi-script:before{content:'\e0b9'}.oi-share-boxed:before{content:'\e0ba'}.oi-share:before{content:'\e0bb'}.oi-shield:before{content:'\e0bc'}.oi-signal:before{content:'\e0bd'}.oi-signpost:before{content:'\e0be'}.oi-sort-ascending:before{content:'\e0bf'}.oi-sort-descending:before{content:'\e0c0'}.oi-spreadsheet:before{content:'\e0c1'}.oi-star:before{content:'\e0c2'}.oi-sun:before{content:'\e0c3'}.oi-tablet:before{content:'\e0c4'}.oi-tag:before{content:'\e0c5'}.oi-tags:before{content:'\e0c6'}.oi-target:before{content:'\e0c7'}.oi-task:before{content:'\e0c8'}.oi-terminal:before{content:'\e0c9'}.oi-text:before{content:'\e0ca'}.oi-thumb-down:before{content:'\e0cb'}.oi-thumb-up:before{content:'\e0cc'}.oi-timer:before{content:'\e0cd'}.oi-transfer:before{content:'\e0ce'}.oi-trash:before{content:'\e0cf'}.oi-underline:before{content:'\e0d0'}.oi-vertical-align-bottom:before{content:'\e0d1'}.oi-vertical-align-center:before{content:'\e0d2'}.oi-vertical-align-top:before{content:'\e0d3'}.oi-video:before{content:'\e0d4'}.oi-volume-high:before{content:'\e0d5'}.oi-volume-low:before{content:'\e0d6'}.oi-volume-off:before{content:'\e0d7'}.oi-warning:before{content:'\e0d8'}.oi-wifi:before{content:'\e0d9'}.oi-wrench:before{content:'\e0da'}.oi-x:before{content:'\e0db'}.oi-yen:before{content:'\e0dc'}.oi-zoom-in:before{content:'\e0dd'}.oi-zoom-out:before{content:'\e0de'} -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | :warning: With .NET 5 & .NET 6, it is recommended to use the [scoped CSS](https://docs.microsoft.com/en-us/aspnet/core/blazor/components/css-isolation?view=aspnetcore-5.0) feature instead of this library. 2 | 3 | ## Excubo.Blazor.LazyStyleSheet 4 | 5 | [![Nuget](https://img.shields.io/nuget/v/Excubo.Blazor.LazyStyleSheet)](https://www.nuget.org/packages/Excubo.Blazor.LazyStyleSheet/) 6 | [![Nuget](https://img.shields.io/nuget/dt/Excubo.Blazor.LazyStyleSheet)](https://www.nuget.org/packages/Excubo.Blazor.LazyStyleSheet/) 7 | [![GitHub](https://img.shields.io/github/license/excubo-ag/Blazor.LazyStyleSheet)](https://github.com/excubo-ag/Blazor.LazyStyleSheet) 8 | 9 | A major issue on websites is slow page load. In part, this is due to enormous payloads that need to be downloaded in full before a page can be rendered correctly. Minimization and compression help to some degree, but it ignores the awkward fact that many style sheets are only used to a tiny fraction. 10 | 11 | With HTTP/2, loading small files rather than one large one is less of a performance concern than with HTTP/1.1. Since Blazor uses HTTP/2 by default, we can make use of this and split style sheets into smaller chunks. Those chunks can then be loaded lazily, i.e. only when a component actually needs it. 12 | 13 | Excubo.Blazor.LazyStyleSheet enables you to write dedicated style sheet for each component. 14 | 15 | ## Breaking changes 16 | 17 | ### Version 3.X.Y 18 | 19 | Good news! Adding lazy-loaded style sheets to your component just became a whole lot easier. Simply add `` to any component. 20 | If you write your styles as a `Component.razor.css` file, you don't need to do anything. 21 | And you can now also remove the `` component in your `App.razor`, as well as the dependency injection code in your `Startup.cs`. 22 | 23 | ### Version 2.X.Y 24 | 25 | `Excubo.Blazor.LazyStyleSheet` now contains build tasks to automatically inject the `IStyleSheetService` when you write your component style as a `Component.razor.css` or `Component.razor.scss` file. That means, if you previously manually inserted `IStyleSheetService` into your component, you now have to remove that. 26 | 27 | ## How to use 28 | 29 | ### 1. Install the nuget package Excubo.Blazor.LazyStyleSheet 30 | 31 | Excubo.Blazor.LazyStyleSheet is distributed [via nuget.org](https://www.nuget.org/packages/Excubo.Blazor.LazyStyleSheet/). 32 | [![Nuget](https://img.shields.io/nuget/v/Excubo.Blazor.LazyStyleSheet)]((https://www.nuget.org/packages/Excubo.Blazor.LazyStyleSheet/)) 33 | 34 | #### Package Manager: 35 | ```ps 36 | Install-Package Excubo.Blazor.LazyStyleSheet 37 | ``` 38 | 39 | #### .NET Cli: 40 | ```cmd 41 | dotnet add package Excubo.Blazor.LazyStyleSheet 42 | ``` 43 | 44 | #### Package Reference 45 | ```xml 46 | 47 | ``` 48 | 49 | ### 2a. Write your style sheets and put them next to your component 50 | 51 | `MyComponent.razor`: 52 | ```razor 53 | @page "/hello" 54 | 55 |
My styled component
56 | 57 | ``` 58 | 59 | `MyComponent.razor.css` / `MyComponent.razor.scss`: 60 | ```css 61 | .mystyle { 62 | color: purple 63 | } 64 | ``` 65 | 66 | ### 2b. Load any stylesheet in your component 67 | 68 | `MyComponent.razor`: 69 | ```razor 70 | @page "/hello" 71 | 72 | 73 |
My styled component
74 | 75 | ``` 76 | 77 | ## Remark 78 | 79 | - Style sheet urls may be added any number of times, and will only be added to the DOM once (as duplicate `` tags don't achieve anything). This only applies if the url string matches exactly, i.e. there is a difference between `https://localhost/css/style.css` and `css/style.css`. 80 | 81 | 82 | ## Tips & tricks 83 | 84 | ### Integration with webcompiler 85 | 86 | `Excubo.Blazor.LazyStyleSheet` integrates seemlessly with [`Excubo.WebCompiler`](https://github.com/excubo-ag/WebCompiler). If you have webcompiler installed, a build task will take care of scss/sass compilation, minification, and compression. The use of webcompiler is strictly optional, but recommended and active by default. 87 | 88 | ### Configuration options 89 | 90 | This library can be configured by adding values to your `csproj` file: 91 | 92 | ```xml 93 | 94 | wwwroot 95 | css/components 96 | true 97 | false 98 | true 99 | true 100 | 101 | ``` 102 | 103 | #### StaticAssetFolder 104 | 105 | The static asset folder should be set to the name of the folder where all your static assets are. By default, that's `wwwroot` and does not need to be changed. 106 | 107 | #### ComponentStyleFolder 108 | 109 | `Excubo.Blazor.LazyStyleSheet` puts all `*.razor.css` and `*.razor.scss` files into a subfolder of the static asset folder, to separate them from other styles. The default location is `css/components`, so the full path becomes `wwwroot/css/components` by default. 110 | 111 | #### UseMinifiedStyleSheets 112 | 113 | `Excubo.Blazor.LazyStyleSheet` uses [`Excubo.WebCompiler`](https://github.com/excubo-ag/WebCompiler), if installed. It then generates minified, and compressed versions of your style sheet automatically. By default, `Excubo.Blazor.LazyStyleSheet` then uses the minified version to dynamically and lazily load the style sheet. 114 | If you do not have `Excubo.WebCompiler` installed, and you do not generate minified versions of your style sheets any other way, you need to set UseMinifiedStyleSheets to `false` 115 | 116 | ```xml 117 | 118 | 119 | false 120 | false 121 | false 122 | 123 | ``` 124 | 125 | #### UseGzippedStyleSheets 126 | 127 | Same as with `UseMinifiedStyleSheets`, serving compressed version of your style sheets is also supported, but deactivated by default. This is because Kestrel does not handle gzipped style sheets correctly by default. 128 | 129 | To enable this, add the following to your `Startup.cs` file: 130 | 131 | ```cs 132 | public void Configure(IApplicationBuilder app, IWebHostEnvironment env) 133 | { 134 | /// ... 135 | /// ... 136 | 137 | app.UseStaticFiles(new StaticFileOptions 138 | { 139 | OnPrepareResponse = context => 140 | { 141 | var headers = context.Context.Response.Headers; 142 | HandleCompressedResourced(context, headers); 143 | } 144 | }); 145 | app.UseStaticFiles(); 146 | 147 | /// ... 148 | /// ... 149 | } 150 | 151 | private static void HandleCompressedResourced(StaticFileResponseContext context, IHeaderDictionary headers) 152 | { 153 | if (context.File == null) 154 | { 155 | return; 156 | } 157 | if ((string)headers["Content-Type"] != "application/x-gzip") 158 | { 159 | return; 160 | } 161 | headers.Add("Content-Encoding", "gzip"); 162 | if (context.File.Name.EndsWith("js.gz", System.StringComparison.InvariantCultureIgnoreCase)) 163 | { 164 | headers["Content-Type"] = "application/javascript"; 165 | } 166 | if (context.File.Name.EndsWith("css.gz", System.StringComparison.InvariantCultureIgnoreCase)) 167 | { 168 | headers["Content-Type"] = "text/css"; 169 | } 170 | } 171 | ``` 172 | 173 | Activate use of compressed resources in your `csproj` file: 174 | 175 | ```xml 176 | 177 | true 178 | 179 | ``` 180 | 181 | #### Auto Inject 182 | 183 | A convenient way of writing styled components is to put the scss/css file in the same folder as the component and name the style file according to the component, e.g. `Component.razor` and `Component.razor.css`. 184 | That way the css file gets grouped with the component in Visual Studio (and other IDEs with file nesting capability). 185 | 186 | This library goes one step further, by making sure that components developed this way automatically have the style injected. If you want to opt out of this feature, simply set `false`. 187 | 188 | :warning: If you use a custom namespace for your component (i.e. you have an `@namespace SomeNamespace` directive in your component), then AutoInject won't work for you. Use a `` instead. 189 | 190 | ## Contribute 191 | 192 | If you encounter any issues or have ideas for new features, please raise an issue in this repository. 193 | --------------------------------------------------------------------------------