Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion examples/Demo/Shared/Pages/Design/DesignTokensPage.razor
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,20 @@

<MarkdownSection FromAsset="./_content/FluentUI.Demo.Shared/docs/DesignTokens.md" OnContentConverted="RefreshTableOfContents" />

@code {
@if (refreshCount > 3)
{
<OfficeColorTable />
}

@code {
[CascadingParameter]
public EventCallback OnRefreshTableOfContents { get; set; }

private int refreshCount = 0;

private async Task RefreshTableOfContents()
{
await OnRefreshTableOfContents.InvokeAsync();
refreshCount++; ;
}
}
50 changes: 50 additions & 0 deletions examples/Demo/Shared/Pages/Design/OfficeColorTable.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
ο»Ώ<style>
th, td {
border: solid gray 1px;
padding: 0 5px;
}
</style>
<div>
<table>
<thead>
<tr>
<th>Product</th>
<th>AccentBaseColor</th>
</tr>
</thead>
<tbody>
@{
var allColors = OfficeColorUtilities.AllColors;
@foreach (var color in allColors)
{
<tr>
<td>
<FluentLabel>@color</FluentLabel>
</td>
<td>
<FluentStack>
<FluentIcon Value="@(new Icons.Filled.Size20.RectangleLandscape())"
Color="Color.Custom"
CustomColor="@GetCustomColor(color)" />
<FluentLabel>@GetCustomColor(color)</FluentLabel>
</FluentStack>
</td>
</tr>
}
}
</tbody>
</table>

</div>

@code {
private static string? GetCustomColor(OfficeColor? color)
{
return color switch
{
OfficeColor.Default => "#036ac4",
_ => color.ToAttributeValue(),
};

}
}
2 changes: 1 addition & 1 deletion examples/Demo/Shared/wwwroot/docs/DesignTokens.md
Original file line number Diff line number Diff line change
Expand Up @@ -336,4 +336,4 @@ To make this work, a link needs to be created between the Design Token component

## Colors for integration with specific Microsoft products
If you are configuring the components for integration into a specific Microsoft product, the following table provides `AccentBaseColor` values you can use.
*The library offers an `OfficeColor` enumeration which contains the specific accent colors for 17 different Office applications.*
*The library offers an `OfficeColor` enumeration which contains the specific accent colors for 25 different Office applications.*