Skip to content

Commit 9d3dfd5

Browse files
authored
[Docs] Add message for when using reboot with different BasePath (#3678)
* Fix #3674 by removing leading slash on @import * Add message on using different BasePath
1 parent 46de517 commit 9d3dfd5

File tree

9 files changed

+17
-16
lines changed

9 files changed

+17
-16
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,12 @@ If you add interactivity later, the Blazor script will kick in and try to load t
8282
If you want to use **Reboot**, you'll need to add to your `app.razor`, `index.html` or `_Layout.cshtml` file a line that includes the stylesheet (`.css` file). This can be done by adding the following line to the `<head>` section:
8383

8484
```html
85-
<link href="_content/Microsoft.FluentUI.AspNetCore.Components/css/reboot.css" rel="stylesheet" />
85+
<link href="/_content/Microsoft.FluentUI.AspNetCore.Components/css/reboot.css" rel="stylesheet" />
8686
```
8787

8888
When using the templates to create your application, **Reboot** is already set-up for you.
8989

90-
90+
_When creating a site that is hosted in a different base path,it might be necessary to remove the leading '/' from the stylesheet link._
9191

9292
### Register Services
9393
Add the following in `Program.cs`

examples/Demo/Shared/Pages/RebootPage.razor

+4-1
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,17 @@
1010
</p>
1111
<p>
1212
If you want to use Reboot, like this demo site, you'll need to include it in your <code>App.razor</code> or <code>index.html</code> file like this:
13-
<CodeSnippet Language="language-html">&lt;link href="_content/Microsoft.FluentUI.AspNetCore.Components/css/reboot.css" rel="stylesheet" /&gt;</CodeSnippet>
13+
<CodeSnippet Language="language-html">&lt;link href="/_content/Microsoft.FluentUI.AspNetCore.Components/css/reboot.css" rel="stylesheet" /&gt;</CodeSnippet>
1414
If you are creating a site by using our <a href="/Templates">Templates</a> package, this is already set up for you. You can
1515
<FluentAnchor Appearance=Appearance.Hypertext Href="_content/Microsoft.FluentUI.AspNetCore.Components/css/reboot.css" Download="reboot.css">download the file</FluentAnchor>
1616
to see what's inside.
1717
</p>
1818
<p>
1919
PS: It is entirely possible to build a site <b>without using Reboot</b> but you will have to do more styling yourself.
2020
</p>
21+
<p>
22+
PSs: <em>When creating a site that is hosted in a different base path,it might be necessary to remove the leading '/' from the stylesheet link.</em>
23+
</p>
2124

2225
<h2 id="approach">Approach <a class="anchor-link" href="#approach" aria-label="Link to this section: Approach"></a></h2>
2326
<p>Reboot builds upon Bootstrap's Reboot which itself builds upon Normalize, providing many HTML elements with somewhat opinionated styles using only element selectors. </p>

examples/Demo/Shared/wwwroot/css/site.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import '/_content/Microsoft.FluentUI.AspNetCore.Components/css/reboot.css';
1+
@import '_content/Microsoft.FluentUI.AspNetCore.Components/css/reboot.css';
22

33
body {
44
height: 100%;

examples/Demo/Shared/wwwroot/docs/CodeSetup.md

+5-7
Original file line numberDiff line numberDiff line change
@@ -79,19 +79,17 @@ builder.Services.AddFluentUIComponents(options =>
7979

8080
#### Reboot
8181
**Reboot** is a collection of element-specific CSS changes in a single file to help kick-start building a site with the **Fluent UI Blazor** components for Blazor. It provides an elegant, consistent, and simple baseline to build upon.
82-
The library automatically includes reboot through the
82+
The library automatically includes reboot through the templates.
8383

84-
If you want to use **Reboot**, you'll need to add to your `app.razor`, `index.html` or `_Layout.cshtml` file a line that includes the stylesheet (`.css` file). This can be done by adding the following line to the `<head>` section:
84+
If you want to use **Reboot**, and your site is not created by using our templates, you'll need to add to your `app.razor`, `index.html` or `_Layout.cshtml` file a line that includes the stylesheet (`.css` file). This can be done by adding the following line to the `<head>` section:
8585

8686
```html
87-
<link href="_content/Microsoft.FluentUI.AspNetCore.Components/css/reboot.css" rel="stylesheet" />
87+
<link href="/_content/Microsoft.FluentUI.AspNetCore.Components/css/reboot.css" rel="stylesheet" />
8888
```
8989

90-
It is entirely possible to build a site without using **Reboot**. If you do not want to use Reboot and you used the templates as a starting point, just remove the following line from the app.css file (it is the first line in the file):
90+
It is entirely possible to build a site without using **Reboot**. Either remove or do not add to file and it will not be used by the components.
9191

92-
```
93-
@import '/_content/Microsoft.FluentUI.AspNetCore.Components/css/reboot.css';
94-
```
92+
_When creating a site that is hosted in a different base path,it might be necessary to remove the leading '/' from the stylesheet link._
9593

9694
### Register Services
9795
Add the following in `Program.cs`

src/Templates/templates/aspire-starter/8.2/Aspire-StarterApplication.1.Web/wwwroot/app.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import '/_content/Microsoft.FluentUI.AspNetCore.Components/css/reboot.css';
1+
@import '_content/Microsoft.FluentUI.AspNetCore.Components/css/reboot.css';
22

33
body {
44
--body-font: "Segoe UI Variable", "Segoe UI", sans-serif;

src/Templates/templates/aspire-starter/9.0/Aspire-StarterApplication.1.Web/wwwroot/app.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import '/_content/Microsoft.FluentUI.AspNetCore.Components/css/reboot.css';
1+
@import '_content/Microsoft.FluentUI.AspNetCore.Components/css/reboot.css';
22

33
body {
44
--body-font: "Segoe UI Variable", "Segoe UI", sans-serif;

src/Templates/templates/blazorweb-csharp/BlazorWeb-CSharp/wwwroot/app.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import '/_content/Microsoft.FluentUI.AspNetCore.Components/css/reboot.css';
1+
@import '_content/Microsoft.FluentUI.AspNetCore.Components/css/reboot.css';
22

33
body {
44
--body-font: "Segoe UI Variable", "Segoe UI", sans-serif;

src/Templates/templates/componentswebassembly-csharp/wwwroot/css/app.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import '/_content/Microsoft.FluentUI.AspNetCore.Components/css/reboot.css';
1+
@import '_content/Microsoft.FluentUI.AspNetCore.Components/css/reboot.css';
22

33
body {
44
--body-font: "Segoe UI Variable", "Segoe UI", sans-serif;

src/Templates/templates/maui-blazor-solution/MauiApp.1.Shared/wwwroot/app.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import '/_content/Microsoft.FluentUI.AspNetCore.Components/css/reboot.css';
1+
@import '_content/Microsoft.FluentUI.AspNetCore.Components/css/reboot.css';
22

33
body {
44
--body-font: "Segoe UI Variable", "Segoe UI", sans-serif;

0 commit comments

Comments
 (0)