diff --git a/src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj b/src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj index b99b85ef9a7..e250331f63a 100644 --- a/src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj +++ b/src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj @@ -79,6 +79,7 @@ + diff --git a/src/BootstrapBlazor.Server/Components/Components/DemoBlock.razor.css b/src/BootstrapBlazor.Server/Components/Components/DemoBlock.razor.css index 169859e1852..9032e3e25d9 100644 --- a/src/BootstrapBlazor.Server/Components/Components/DemoBlock.razor.css +++ b/src/BootstrapBlazor.Server/Components/Components/DemoBlock.razor.css @@ -54,12 +54,12 @@ .card-footer-control { text-align: center; - color: #d3dce6; + color: var(--bs-secondary-color); display: block; } .card-footer-control:hover { - color: #409eff; + color: var(--bs-primary); } .card-footer-control i { diff --git a/src/BootstrapBlazor.Server/Components/Components/Header.razor.css b/src/BootstrapBlazor.Server/Components/Components/Header.razor.css index a4f1d7abb03..a4dc8e5a4f6 100644 --- a/src/BootstrapBlazor.Server/Components/Components/Header.razor.css +++ b/src/BootstrapBlazor.Server/Components/Components/Header.razor.css @@ -1,4 +1,4 @@ -.navbar-header { +.navbar-header { background-color: transparent; background-image: linear-gradient(to right, rgba(var(--bb-primary-color-rgb), 1), rgba(var(--bb-primary-color-rgb), 0.9)); box-shadow: 0 0.5rem 1rem rgba(0,0,0,.05), inset 0 -1px 0 rgba(0,0,0,.1); @@ -41,6 +41,8 @@ .nav-link img { height: 24px; width: auto; + /* the repo svgs ship without a fill (render black) — invert to white on the colored header */ + filter: brightness(0) invert(1); } .navbar-version { diff --git a/src/BootstrapBlazor.Server/Components/Components/ThemeChooser.razor.cs b/src/BootstrapBlazor.Server/Components/Components/ThemeChooser.razor.cs index 70a2e84fb0b..fc0b961baff 100644 --- a/src/BootstrapBlazor.Server/Components/Components/ThemeChooser.razor.cs +++ b/src/BootstrapBlazor.Server/Components/Components/ThemeChooser.razor.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the Apache 2.0 License // See the LICENSE file in the project root for more information. // Maintainer: Argo Zhang(argo@live.ca) Website: https://www.blazor.zone @@ -45,7 +45,7 @@ private void OnClickTheme(SelectedItem item) var theme = WebsiteOption.Value.Themes.FirstOrDefault(i => i.Key == item.Value); if (theme is { Files: not null }) { - _currentTheme.AddRange(theme.Files); + _currentTheme.AddRange(theme.Files.Select(i => Assets[i])); } } diff --git a/src/BootstrapBlazor.Server/Components/Components/ThemeChooser.razor.css b/src/BootstrapBlazor.Server/Components/Components/ThemeChooser.razor.css index 14e158574b7..662e6dfeec4 100644 --- a/src/BootstrapBlazor.Server/Components/Components/ThemeChooser.razor.css +++ b/src/BootstrapBlazor.Server/Components/Components/ThemeChooser.razor.css @@ -1,4 +1,4 @@ -.theme-list { +.theme-list { position: fixed; z-index: 47; bottom: 12rem; @@ -13,7 +13,7 @@ } .theme-list.is-open { - height: 306px; + height: 355px; } .theme-header { diff --git a/src/BootstrapBlazor.Server/Components/Components/ThemeChooser.razor.js b/src/BootstrapBlazor.Server/Components/Components/ThemeChooser.razor.js index 9efccd34bdb..03a890bec19 100644 --- a/src/BootstrapBlazor.Server/Components/Components/ThemeChooser.razor.js +++ b/src/BootstrapBlazor.Server/Components/Components/ThemeChooser.razor.js @@ -7,19 +7,47 @@ export function init(id) { } const themeList = document.querySelector('.theme-list'); - const close = document.querySelector('.theme-list .btn-close'); + if (themeList === null) { + return; + } + EventHandler.on(el, 'click', () => { themeList.classList.toggle('is-open'); }); - EventHandler.on(close, 'click', () => { + + const close = themeList.querySelector('.btn-close'); + if (close) { + EventHandler.on(close, 'click', () => { + themeList.classList.remove('is-open'); + }); + } + + EventHandler.on(themeList, 'click', '.theme-item', () => { themeList.classList.remove('is-open'); }); + + const outsideClick = e => { + if (!el.contains(e.target) && !themeList.contains(e.target)) { + themeList.classList.remove('is-open'); + } + }; + EventHandler.on(document, 'click', outsideClick); + el.themeOutsideClick = outsideClick; } export function dispose(id) { const el = document.getElementById(id); if (el) { EventHandler.off(el, 'click'); + if (el.themeOutsideClick) { + EventHandler.off(document, 'click', el.themeOutsideClick); + delete el.themeOutsideClick; + } + } + + const themeList = document.querySelector('.theme-list'); + if (themeList) { + EventHandler.off(themeList, 'click'); } const close = document.querySelector('.theme-list .btn-close'); diff --git a/src/BootstrapBlazor.Server/Components/Pages/Install.razor b/src/BootstrapBlazor.Server/Components/Pages/Install.razor index ca5c1dbe0a1..7ccfa35b757 100644 --- a/src/BootstrapBlazor.Server/Components/Pages/Install.razor +++ b/src/BootstrapBlazor.Server/Components/Pages/Install.razor @@ -1,4 +1,4 @@ -@page "/install" +@page "/install" @inject IStringLocalizer Localizer @inject IOptions WebsiteOption @@ -30,6 +30,9 @@ <link rel="stylesheet" href="@@Assets["_content/BootstrapBlazor.FontAwesome/css/font-awesome.min.css"]" /> @Localizer["BootstrapStyle"] <link rel="stylesheet" href="@@Assets["_content/BootstrapBlazor/css/bootstrap.blazor.bundle.min.css"]" /> +@Localizer["FluentDesc"] +dotnet add package BootstrapBlazor.Theme.Fluent +<link rel="stylesheet" href="@@Assets["_content/BootstrapBlazor.Theme.Fluent/fluent.min.css"]" /> @Localizer["MotronicDesc"] <link rel="stylesheet" href="@@Assets["_content/BootstrapBlazor/css/motronic.min.css"]" /> @@ -38,6 +41,9 @@ <link rel="stylesheet" href="_content/BootstrapBlazor.FontAwesome/css/font-awesome.min.css" /> @Localizer["BootstrapStyle"] <link rel="stylesheet" href="_content/BootstrapBlazor/css/bootstrap.blazor.bundle.min.css" /> +@Localizer["FluentDesc"] +dotnet add package BootstrapBlazor.Theme.Fluent +<link rel="stylesheet" href="_content/BootstrapBlazor.Theme.Fluent/fluent.min.css" /> @Localizer["MotronicDesc"] <link rel="stylesheet" href="_content/BootstrapBlazor/css/motronic.min.css" /> diff --git a/src/BootstrapBlazor.Server/Components/Pages/Theme.razor b/src/BootstrapBlazor.Server/Components/Pages/Theme.razor index 8523cb49829..437bdd1010e 100644 --- a/src/BootstrapBlazor.Server/Components/Pages/Theme.razor +++ b/src/BootstrapBlazor.Server/Components/Pages/Theme.razor @@ -1,5 +1,7 @@ -@page "/theme" +@page "/theme" @inject IStringLocalizer Localizer +@inject MessageService MessageService +@inject ToastService ToastService

@Localizer["H1"]

@@ -9,6 +11,7 @@
  • @Localizer["P2"]
  • +
  • @Localizer["P11"]
  • @Localizer["P3"]
  • @Localizer["P4"]
  • @Localizer["P5"]
  • @@ -16,9 +19,290 @@

    @Localizer["P6"]

    -

    @Localizer["P7"] Motronic @Localizer["P8"] head @Localizer["P9"]:

    +

    @Localizer["P12"] head @Localizer["P14"]:

    -
    <link href="_content/BootstrapBlazor/css/bootstrap.blazor.bundle.min.css" rel="stylesheet">
    +
    // @Localizer["P23"]
    +<link href="_content/BootstrapBlazor/css/bootstrap.blazor.bundle.min.css" rel="stylesheet">
     
    -// @Localizer["P10"]
    +// @Localizer["P15"] Fluent UI
    +dotnet add package BootstrapBlazor.Theme.Fluent
    +<link rel="stylesheet" href="_content/BootstrapBlazor.Theme.Fluent/fluent.min.css">
    +
    +// @Localizer["P19"] Motronic
     <link rel="stylesheet" href="_content/BootstrapBlazor/css/motronic.min.css">
    + +

    @Localizer["P24"] BootstrapBlazor.Theme.Fluent @Localizer["P25"] _content/BootstrapBlazor.Theme.Fluent/fluent.min.css

    + +

    @Localizer["P16"] data-bs-theme @Localizer["P17"] <html> @Localizer["P20"] data-bs-theme="dark" @Localizer["P21"] ThemeProvider @Localizer["P22"]

    + +

    Component preview

    + +

    Sections below exercise the core components with minimal parameters. Use the theme button at the bottom-right corner of this site to switch between Fluent UI, Motronic and Bootstrap in light or dark mode and eyeball the result in one place.

    + +

    Buttons

    + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +

    Forms

    + +
    +
    + +
    +
    + +
    +
    +