Skip to content

Commit cc455c1

Browse files
authored
[Docs] Some site changes (#3236)
1 parent 933f21e commit cc455c1

File tree

9 files changed

+219
-157
lines changed

9 files changed

+219
-157
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<div class="calendar">
2+
<div class="calendar-header">
3+
<div class="month">@Month</div>
4+
@if (@IncludeYear)
5+
{
6+
<div class="year">@Year</div>
7+
}
8+
</div>
9+
<div class="calendar-body">
10+
<div class="date">@Day</div>
11+
</div>
12+
</div>
13+
14+
@code {
15+
[Parameter, EditorRequired]
16+
public string? Day { get; set; }
17+
18+
[Parameter, EditorRequired]
19+
public string? Month { get; set; }
20+
21+
[Parameter, EditorRequired]
22+
public string? Year { get; set; }
23+
24+
[Parameter]
25+
public bool IncludeYear { get; set; } = false;
26+
27+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
.calendar {
2+
width: 30px;
3+
border: 1px solid var(--accent-fill-rest);
4+
border-radius: 8px;
5+
background-color: #fff;
6+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
7+
overflow: hidden;
8+
}
9+
10+
.calendar-header {
11+
background-color: var(--accent-fill-active);
12+
color: var(--neutral-fill-rest);
13+
text-align: center;
14+
}
15+
16+
.calendar-header .month{
17+
height: 20px;
18+
font-size: 0.7em;
19+
font-weight: bold;
20+
}
21+
22+
.calendar-header .year {
23+
height: 10px;
24+
font-size: 0.7em;
25+
}
26+
27+
.calendar-body {
28+
text-align: center;
29+
position: relative;
30+
}
31+
32+
.calendar-body .date {
33+
font-size: 1em;
34+
font-weight: bolder;
35+
color: var(--accent-fill-rest)
36+
}

examples/Demo/Shared/Pages/Home/Home.razor

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,13 @@
1616
<p>
1717
To get up and running with the <code>Microsoft.FluentUI.AspNetCore.Components</code> library, see the &quot;Getting Started&quot; section below.
1818
</p>
19+
1920
<h2>Introduction and getting started video</h2>
20-
<div class="youtube-responsive">
21-
<iframe src="https://www.youtube.com/embed/lUZ5mrg2Q8k" frameborder="0" allowfullscreen></iframe>
21+
<div class="youtube-thumbnail">
22+
<a href="https://youtu.be/lUZ5mrg2Q8k" target="_blank" title="Fluent UI Blazor introduction video"><img src="https://img.youtube.com/vi/lUZ5mrg2Q8k/maxresdefault.jpg" alt="Fluent UI Blazor introduction video" /></a>
2223
</div>
2324
<p style="margin-top: 0.5rem;">
24-
More videos on our <a href="/Videos">videos page</a>
25+
More videos available on our <a href="/Videos">videos page</a>.
2526
</p>
2627

2728
</FluentGridItem>
@@ -35,26 +36,25 @@
3536
<p>
3637
The demo and documentation sites for previous version is available:<br />
3738
<a href="https://aka.ms/fluentui-blazor-v3/" target="_blank">Version 3.8.0</a><br />
38-
Please be aware that this version is no longer supported as both .NET 6 and .NET 7 are out of support now.
39+
<em>Please be aware that this version is no longer supported as both .NET 6 and .NET 7 are out of support now.</em>
3940
</p>
4041
</div>
41-
<h2 id="whatsnew">What's new?</h2>
42+
43+
<h2>What's new</h2>
44+
<ul class="news">
45+
<li><NewsDate Day="14" Month="Jan" Year="25" /><a href="/WhatsNew#v4.11.3">v4.11.3 released</a></li>
46+
<li><NewsDate Day="13" Month="Jan" Year="25" /><a href="/WhatsNew#v4.11.2">v4.11.2 released</a></li>
47+
<li><NewsDate Day="10" Month="Jan" Year="25" /><a href="/WhatsNew#v4.11.1">v4.11.1 released</a></li>
48+
<li><NewsDate Day="19" Month="Dec" Year="24" /><a href="/WhatsNew#v4.11.0">v4.11.0 released</a></li>
49+
<li><NewsDate Day="15" Month="Nov" Year="24" /><a href="https://youtu.be/w8BKS1a8MnU" target="_blank">Our .NET Cont 2024 session on YouTube</a></li>
50+
51+
<!--<li><a href=""></a></li>-->
52+
</ul>
53+
4254
<p>
4355
If you are already up-and-running and upgrading from an earlier version of the library, please go to the <a href="/WhatsNew">What's new</a> page
4456
for information on additions, fixes and (breaking) changes.
4557
</p>
46-
<h2 id="interactivity">Components & render modes</h2>
47-
<p>
48-
As described in the <a href="https://learn.microsoft.com/en-us/aspnet/core/blazor/components/render-modes?view=aspnetcore-8.0" target="_blank"> Blazor documentation</a>:
49-
</p>
50-
<blockquote>
51-
By default, components use Static Server-side rendering (SSR). The component renders to the response stream and there is no interactivity.
52-
</blockquote>
53-
<p>
54-
A component inherits its render mode from its parent. So unless a render mode is specified on the app, page or component level, every
55-
component (including ours) is <em>statically rendered</em> on the server and <strong>will not be interactive</strong>. For the
56-
Fluent UI Blazor library this means most components will display correctly but <strong>will not offer</strong> complete, if any, functionality.
57-
</p>
5858
</FluentGridItem>
5959
<FluentGridItem xs="12" sm="12" md="6">
6060
<h2 id="getting-started">Getting Started</h2>
@@ -130,6 +130,18 @@
130130
</DemoSection>
131131
</FluentGridItem>
132132
<FluentGridItem xs="12" sm="12" md="4">
133+
<h2 id="interactivity">Components & render modes</h2>
134+
<p>
135+
As described in the <a href="https://learn.microsoft.com/en-us/aspnet/core/blazor/components/render-modes?view=aspnetcore-8.0" target="_blank"> Blazor documentation</a>:
136+
</p>
137+
<blockquote>
138+
By default, components use Static Server-side rendering (SSR). The component renders to the response stream and there is no interactivity.
139+
</blockquote>
140+
<p>
141+
A component inherits its render mode from its parent. So unless a render mode is specified on the app, page or component level, every
142+
component (including ours) is <em>statically rendered</em> on the server and <strong>will not be interactive</strong>. For the
143+
Fluent UI Blazor library this means most components will display correctly but <strong>will not offer</strong> complete, if any, functionality.
144+
</p>
133145
<h2 id="configuring-the-design-system">Configuring the Design System</h2>
134146
<p>
135147
The Fluent UI Blazor components are built on FAST's Adaptive UI technology, which enables design customization and personalization, while

examples/Demo/Shared/Pages/Home/Videos.razor

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<h1>Videos</h1>
88

9-
<p>Every now and then, we do guests appearances in videos to promote the library and show a bit more on how it works. See the overview below for our most recent appearances</p>
9+
<p>Every now and then, we present or do guests appearances in videos to promote the library and show a bit more on how it works. See the overview below for our most recent appearances</p>
1010

1111
<FluentGrid Spacing="7">
1212
<FluentGridItem xs="12" sm="4">
@@ -15,10 +15,7 @@
1515
<iframe src="https://www.youtube.com/embed/w8BKS1a8MnU?si=ugsYLTHGhBrXdAhn" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
1616
</div>
1717
</FluentGridItem>
18-
<FluentGridItem xs="12" sm="4">
19-
</FluentGridItem>
20-
<FluentGridItem xs="12" sm="4">
21-
</FluentGridItem>
18+
2219
<FluentGridItem xs="12" sm="4">
2320
<div class="youtube-title">ASP.NET Community Standup 2024</div>
2421
<div class="youtube-responsive">
@@ -27,8 +24,7 @@
2724
</FluentGridItem>
2825
<FluentGridItem xs="12" sm="4">
2926
</FluentGridItem>
30-
<FluentGridItem xs="12" sm="4">
31-
</FluentGridItem>
27+
3228
<FluentGridItem xs="12" sm="4">
3329
<div class="youtube-title" style="overflow: unset;">Open at Microsoft - 2024</div>
3430
<div class="youtube-responsive">

examples/Demo/Shared/Pages/TemplatesPage.razor

Lines changed: 9 additions & 131 deletions
Original file line numberDiff line numberDiff line change
@@ -4,137 +4,15 @@
44

55
<h1><FluentIcon Value="@(new Icons.Regular.Size24.Classification())" /> Project templates</h1>
66

7-
<p>
8-
To make it easier to start a project that uses the Fluent UI Web Components for Blazor out of the box, we have created the
9-
<a target="top" href="https://www.nuget.org/packages/Microsoft.FluentUI.AspNetCore.Templates/">Microsoft.FluentUI.AspNetCore.Templates</a> template package.
10-
</p>
11-
<p>
12-
The package contains templates for creating Blazor Server and/or Blazor WebAssembly apps which mimic the regular Blazor
13-
templates. The Fluent UI Blazor components are already fully set up. If you choose to use the sample pages when creating a project,
14-
all components have been replaced with Fluent UI counterparts (and a few extra have been added). All Bootstrap styling is removed of course as well.
15-
</p>
16-
<p>
17-
If you want to use the Icon component with applications based on the templates, we have already included and set up the Icon package for you.
18-
The full collection of approximately 12 thousand icons in different variants and sizes can be browsed and searched from the <a href="/Icon">Icon</a> page.
19-
</p>
20-
<p>
21-
If you want to use the Emoji component with applications based on the templates, you still need to make some changes to the project. See the
22-
<a href="/IconsAndEmoji"> Icons and Emoji</a> page for more information.
23-
</p>
7+
<MarkdownSection FromAsset="./_content/FluentUI.Demo.Shared/docs/Templates.md" OnContentConverted="RefreshTableOfContents" />
248

25-
<p>
26-
The pages created from these templates will appear like the following based on the type of project and options selected during creation.
27-
</p>
28-
<p style="display: flex; flex-direction:column; align-items:center">
29-
<img style="width: 750px;" src="_content/FluentUI.Demo.Shared/images/template-home.png" alt="Home page for site created Fluent UI templates" />
30-
<br />
31-
<img style="width: 750px;" src="_content/FluentUI.Demo.Shared/images/template-counter.png" alt="Counter page for site created Fluent UI templates" />
32-
<br />
33-
<img style="width: 750px;" src="_content/FluentUI.Demo.Shared/images/template-weather.png" alt="Fetch data page for site created Fluent UI templates" />
34-
</p>
9+
@code {
3510

36-
<blockquote>
37-
<strong>IMPORTANT!!</strong>
38-
<p>Just as with the standard Blazor Web App template, Blazor will use SSR by default. If you want to have interactive components, make sure you add a rendermode to the app, page or component!</p>
39-
</blockquote>
11+
[CascadingParameter]
12+
public EventCallback OnRefreshTableOfContents { get; set; }
4013

41-
<h2 id="installation">Installation</h2>
42-
<p>
43-
You can install the templates by running the following command:
44-
</p>
45-
46-
<CodeSnippet>dotnet new install Microsoft.FluentUI.AspNetCore.Templates</CodeSnippet>
47-
48-
<p>
49-
The current version can be found on the <a href="https://www.nuget.org/packages/Microsoft.FLuentUI.AspNetCore.Templates/" rel="noopener noreferrer nofollow">NuGet site</a>.
50-
</p>
51-
52-
<h2 id="usage">Usage</h2>
53-
<p>
54-
After installing the templates, you can create a new project from either the CLI or by using the 'Creating a new project'-dialog in Visual Studio 2022.
55-
</p>
56-
57-
<p>
58-
For creating a new Fluent Blazor Web App project from the CLI:
59-
</p>
60-
61-
<CodeSnippet>dotnet new fluentblazor -o {your project name}</CodeSnippet>
62-
63-
<p>
64-
For creating a Fluent Blazor WebAssembly Standalone App project from the CLI:
65-
</p>
66-
67-
<CodeSnippet>dotnet new fluentblazorwasm -o {your project name}</CodeSnippet>
68-
69-
<p>
70-
In Visual Studio you can create a new project by selecting either the 'Fluent Blazor Web App' template or the 'Fluent Blazor WebAssembly Standalone App'
71-
template in the 'File-&gt;New-&gt;Project'-dialog. It looks like this:
72-
</p>
73-
<p style="display: flex; justify-content:center">
74-
<img style="border: 1px solid var(--neutral-foreground-focus);" src="_content/FluentUI.Demo.Shared/images/newproject.png" alt="New project dialog with Fluent UI templates" />
75-
</p>
76-
77-
<h3>Blazor Web App details</h3>
78-
<p>
79-
The rendermode and interactivity choices made when creating an application with the template determine the behavior of the NavMenu and whether we include the web
80-
components script in <code>App.razor</code>. Starting with v4.2.1 of the templates, the result of that choices is described in the table below:
81-
82-
<table width="90%">
83-
<thead>
84-
<tr>
85-
<th width="33%">Rendermode / Interactivity</th>
86-
<th width="33%">NavMenu @@rendermode</th>
87-
<th width="33%">NavMenu Collapsible</th>
88-
</tr>
89-
</thead>
90-
<tbody>
91-
<tr>
92-
<td>SSR / not applicable</td>
93-
<td>❌</td>
94-
<td>✅<sup>*</sup></td>
95-
</tr>
96-
<tr>
97-
<td>Server / Global</td>
98-
<td>❌</td>
99-
<td>✅</td>
100-
</tr>
101-
<tr>
102-
<td>Server / Per Page</td>
103-
<td>✅</td>
104-
<td>✅</td>
105-
</tr>
106-
<tr>
107-
<td>WebAssembly / Global<sup>**</sup></td>
108-
<td>❌</td>
109-
<td>✅</td>
110-
</tr>
111-
<tr>
112-
<td>WebAssembly / Per Page<sup>**</sup></td>
113-
<td>✅</td>
114-
<td>✅</td>
115-
</tr>
116-
<tr>
117-
<td>Auto / Global<sup>**</sup></td>
118-
<td>❌</td>
119-
<td>✅</td>
120-
</tr>
121-
<tr>
122-
<td>Auto / Per Page<sup>**</sup></td>
123-
<td>✅</td>
124-
<td>✅</td>
125-
</tr>
126-
</tbody>
127-
</table>
128-
</p>
129-
<p>
130-
<em>* For expanding/collapsing items, this uses a JavaScript file that is only active when running in SSR mode.</em><br />
131-
<em>** The NavMenu component is located in the Client project.</em>
132-
</p>
133-
134-
<h2 id="uninstalling-the-templates">Uninstalling the templates</h2>
135-
136-
<p>
137-
If you want to uninstall the templates, both from the CLI and Visual Studio 2022, run the following command:
138-
</p>
139-
140-
<CodeSnippet>dotnet new uninstall Microsoft.FluentUI.AspNetCore.Templates</CodeSnippet>
14+
private async Task RefreshTableOfContents()
15+
{
16+
await OnRefreshTableOfContents.InvokeAsync();
17+
}
18+
}

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

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,31 @@ nav fluent-anchor {
140140
display: flex;
141141
}
142142

143+
ul.news {
144+
padding-left: 0;
145+
list-style-type: none;
146+
}
147+
148+
ul.news li {
149+
display: flex;
150+
gap: calc( var(--design-unit) * 2px);
151+
align-items: center;
152+
padding-bottom: calc( var(--design-unit) * 2px);
153+
}
154+
155+
.news .calendar {
156+
157+
}
158+
159+
.news a {
160+
font-size: var(--type-ramp-plus-1-font-size);
161+
line-height: var(--type-ramp-plus-1-line-height);
162+
font-weight: 600;
163+
text-decoration: none;
164+
}
165+
166+
167+
143168
article {
144169
padding: 1.5rem 1rem;
145170
border-right: 1px solid var(--neutral-stroke-divider-rest);
@@ -301,7 +326,7 @@ kbd {
301326
text-align: center;
302327
font-weight: bold;
303328
inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
304-
margin-top:80px;
329+
margin-top: 80px;
305330
}
306331

307332
.loading-progress-text:after {
@@ -426,14 +451,15 @@ kbd {
426451
fluent-select::part(control) {
427452
width: 150px;
428453
}
454+
429455
.content {
430456
flex-direction: column;
431457
}
432458

433459
aside {
434460
padding: 1.5em 0.75em 1em 0.75em;
435461
width: 100%;
436-
height: 100%!important;
462+
height: 100% !important;
437463
max-height: 100% !important;
438464
}
439465

@@ -554,3 +580,13 @@ kbd {
554580
display: block;
555581
min-height: 24px;
556582
}
583+
584+
.youtube-thumbnail {
585+
position: relative;
586+
overflow: hidden;
587+
max-width: 100%;
588+
}
589+
590+
.youtube-thumbnail img {
591+
width: 100%;
592+
}

0 commit comments

Comments
 (0)