Skip to content

[dev-v5] Add minimum styles for HTML tags (Reboot.css) - #3235

Merged
Denis Voituron (dvoituron) merged 19 commits into
dev-v5from
users/dvoituron/dev-v5/fluentbody
Jan 28, 2025
Merged

Denis Voituron (dvoituron) merged 19 commits into
dev-v5from
users/dvoituron/dev-v5/fluentbody

Conversation

@dvoituron

@dvoituron Denis Voituron (dvoituron) commented Jan 23, 2025 •

Copy link
Copy Markdown
Collaborator

[dev-v5] Add minimum styles for HTML tags (Reboot.css)

Default Styles

The FluentUI Blazor library comes with a set of default styles that are applied to all components.
These styles are based on the Fluent Design System and are designed to make your site look good out of the box.
Component styles are integrated into these components and are based on CSS variables (see below).

In addition to the styles built into components, common HTML tags are also styled using
the default-fuib.css file
file, which is included in the package and automatically applied to your site.

These styles are inspired by the Normalize.css library.
This lib makes browsers render all elements more consistently and in line with modern standards.
It precisely targets only the styles that need normalizing.

Deactivating default sytles

In some cases, you may not want to use the default styles included in default-fuib.css.
You can deactivate them by setting the no-fuib-style attribute on the body tag.

<body no-fuib-style> ... </body>

⚠️ If you deactivate the default styles, you will need to style your site yourself.
And we don't guarantee that components will be correctly represented without the default styles.

Reboot CSS

Reboot is a collection of element-specific CSS changes in a single file to help kickstart building
a site with the FluentUI Blazor library. It provides an elegant, consistent, and simple baseline
to build upon (inspired by Bootstrap's Reboot which again is based on Normalize.css)

If you want to use Reboot you have two options:

  1. You need to include it in your App.razor or index.html file like this:
    <link href="_content/Microsoft.FluentUI.AspNetCore.Components/css/reboot.css" rel="stylesheet" />
  2. You can add the attribute use-reboot to your body tag like this:
    <body use-reboot> ... </body>

Demo

peek_2

@github-actions

github-actions Bot commented Jan 23, 2025 •

Copy link
Copy Markdown

✅ All tests passed successfully

Details on your Workflow / Core Tests page.

@github-actions

github-actions Bot commented Jan 23, 2025 •

Copy link
Copy Markdown

Summary - Unit Tests Code Coverage

Summary
Generated on: 01/28/2025 - 21:19:58
Coverage date: 01/28/2025 - 21:19:52
Parser: Cobertura
Assemblies: 1
Classes: 59
Files: 69
Line coverage: 99% (1205 of 1216)
Covered lines: 1205
Uncovered lines: 11
Coverable lines: 1216
Total lines: 5487
Branch coverage: 91.7% (750 of 817)
Covered branches: 750
Total branches: 817
Method coverage: Feature is only available for sponsors
Tag: 2493_13019743271

Coverage

Microsoft.FluentUI.AspNetCore.Components - 99%
Name Line Branch
Microsoft.FluentUI.AspNetCore.Components 99% 91.7%
Microsoft.FluentUI.AspNetCore.Components.Dialog.MessageBox.FluentMessageBox 100% 100%
Microsoft.FluentUI.AspNetCore.Components.DialogEventArgs 100% 92.8%
Microsoft.FluentUI.AspNetCore.Components.DialogInstance 100% 100%
Microsoft.FluentUI.AspNetCore.Components.DialogOptions 100%
Microsoft.FluentUI.AspNetCore.Components.DialogOptionsFooter 100% 100%
Microsoft.FluentUI.AspNetCore.Components.DialogOptionsFooterAction 100% 100%
Microsoft.FluentUI.AspNetCore.Components.DialogOptionsHeader 100%
Microsoft.FluentUI.AspNetCore.Components.DialogResult 100% 100%
Microsoft.FluentUI.AspNetCore.Components.DialogResult`1 100%
Microsoft.FluentUI.AspNetCore.Components.DialogService 98.9% 81.4%
Microsoft.FluentUI.AspNetCore.Components.DialogToggleEventArgs 100%
Microsoft.FluentUI.AspNetCore.Components.Extensions.EnumExtensions 100% 100%
Microsoft.FluentUI.AspNetCore.Components.Extensions.FluentInputExtensions 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentButton 100% 89.5%
Microsoft.FluentUI.AspNetCore.Components.FluentComponentBase 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentDialog 97.4% 89.7%
Microsoft.FluentUI.AspNetCore.Components.FluentDialogBody 100% 91.6%
Microsoft.FluentUI.AspNetCore.Components.FluentDialogInstance 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentDialogProvider 100% 79.1%
Microsoft.FluentUI.AspNetCore.Components.FluentGrid 100% 90%
Microsoft.FluentUI.AspNetCore.Components.FluentGridItem 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentIcon`1 100% 95.8%
Microsoft.FluentUI.AspNetCore.Components.FluentInputBase`1 97% 66.6%
Microsoft.FluentUI.AspNetCore.Components.FluentInputImmediateBase`1 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentJSModule 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentLabel 100%
Microsoft.FluentUI.AspNetCore.Components.FluentLayout 100% 71.4%
Microsoft.FluentUI.AspNetCore.Components.FluentLayoutHamburger 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentLayoutItem 100% 89.2%
Microsoft.FluentUI.AspNetCore.Components.FluentListBase`1 93.3% 94.7%
Microsoft.FluentUI.AspNetCore.Components.FluentLocalizerExtensions 100%
Microsoft.FluentUI.AspNetCore.Components.FluentLocalizerInternal 100%
Microsoft.FluentUI.AspNetCore.Components.FluentOption 91.6% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentSelect`1 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentServiceBase`1 100%
Microsoft.FluentUI.AspNetCore.Components.FluentServiceProviderException`1 100%
Microsoft.FluentUI.AspNetCore.Components.FluentStack 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentText 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentTextInput 100% 100%
Microsoft.FluentUI.AspNetCore.Components.Icon 100% 91.1%
Microsoft.FluentUI.AspNetCore.Components.IconFromImage 100%
Microsoft.FluentUI.AspNetCore.Components.IconInfo 100%
Microsoft.FluentUI.AspNetCore.Components.IFluentLocalizer 100% 100%
Microsoft.FluentUI.AspNetCore.Components.InternalListContext`1 60%
Microsoft.FluentUI.AspNetCore.Components.Localization.LanguageResource 100% 100%
Microsoft.FluentUI.AspNetCore.Components.MessageBoxOptions 100%
Microsoft.FluentUI.AspNetCore.Components.Migration.AppearanceExtensions 100% 100%
Microsoft.FluentUI.AspNetCore.Components.Migration.FluentInputAppearanceExt
ensions
100% 100%
Microsoft.FluentUI.AspNetCore.Components.ServiceProviderExtensions 100%
Microsoft.FluentUI.AspNetCore.Components.SpacingExtensions 100% 97.2%
Microsoft.FluentUI.AspNetCore.Components.Utilities.AddTag 100% 100%
Microsoft.FluentUI.AspNetCore.Components.Utilities.CssBuilder 100% 92.8%
Microsoft.FluentUI.AspNetCore.Components.Utilities.Debounce 100% 83.3%
Microsoft.FluentUI.AspNetCore.Components.Utilities.Identifier 100% 100%
Microsoft.FluentUI.AspNetCore.Components.Utilities.IdentifierContext 100% 75%
Microsoft.FluentUI.AspNetCore.Components.Utilities.InlineStyleBuilder 100% 92.8%
Microsoft.FluentUI.AspNetCore.Components.Utilities.InternalDebounce.Dispatc
herTimerExtensions
95.7% 75%
Microsoft.FluentUI.AspNetCore.Components.Utilities.StyleBuilder 100% 100%
Microsoft.FluentUI.AspNetCore.Components.ZIndex 100%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants