Skip to content

Commit

Permalink
Merge pull request #1301 from unoplatform/dev/jela/lint-all-md
Browse files Browse the repository at this point in the history
docs: Lint all markdown files
  • Loading branch information
agneszitte authored Dec 13, 2023
2 parents 6624d9f + 657bfba commit 66536ca
Show file tree
Hide file tree
Showing 32 changed files with 249 additions and 113 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Uno.Themes

<p align="center">
<img src="doc/assets/themes-design-systems.png">
<img src="doc/assets/themes-design-systems.png" alt="Themes design systems" />
</p>

[![Open Uno.Themes in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/unoplatform/uno.themes)
Expand Down
2 changes: 1 addition & 1 deletion build/stage-validations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@
- bash: npm install -g markdownlint-cli
displayName: Install markdownlint-cli

- bash: markdownlint -c $(Build.SourcesDirectory)/build/.markdownlint.json "*.md"
- bash: markdownlint -c $(Build.SourcesDirectory)/build/.markdownlint.json "**/*.md"
displayName: Run Markdown Linter
5 changes: 5 additions & 0 deletions doc/cupertino-controls-styles.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
---
uid: Uno.Themes.Cupertino.Styles
---

# Cupertino Controls Styles

Control|Style Key
-|-
`Button`|CupertinoButtonStyle<br/>CupertinoContainedButtonStyle<br/>CupertinoDatePickerFlyoutButtonStyle
Expand Down
8 changes: 4 additions & 4 deletions doc/cupertino-getting-started.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
uid: uno.themes.cupertino.getstarted
uid: Uno.Themes.Cupertino.GetStarted
---

# Uno.Cupertino

<p align="center">
<img src="assets/cupertino-design-system.png">
<img src="assets/cupertino-design-system.png" alt="Cupertino design system" />
</p>

# Uno.Cupertino

Uno Cupertino is an add-on package that lets you apply [Cupertino - Human Interface Guideline styling](https://developer.apple.com/design/human-interface-guidelines) to your application with a few lines of code.

## Getting Started
Expand Down
40 changes: 21 additions & 19 deletions doc/fluent-getting-started.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
uid: uno.themes.fluent.getstarted
uid: Uno.Themes.Fluent.GetStarted
---

# Fluent-styled controls

<p align="center">
<img src="assets/fluent-design-system.png">
<img src="assets/fluent-design-system.png" alt="Fluent design system" />
</p>

# Fluent-styled controls

Uno Platform 3.0 and above supports control styles conforming to the [Fluent design system](https://www.microsoft.com/design/fluent).
Uno Platform 3.0 and above supports control styles conforming to the [Fluent design system](https://www.microsoft.com/design/fluent).
The details below explain how to use them in your app.

## Upgrading existing Uno apps to use Fluent styles
Expand All @@ -24,27 +24,29 @@ The step-by-step process to enable Fluent design styles within an existing Uno P
1. In only the `UWP` head project of your solution, if you have one, install the [WinUI 2 NuGet package](https://www.nuget.org/packages/Microsoft.UI.Xaml). This step is the same as required for WinUI 2 UWP apps.

1. Within the shared project used by all platform heads, add the `XamlControlsResources` resource dictionary to your application resources inside `App.xaml`. This step is the same as required for WinUI 2 UWP apps.

```xml
<Application>
<Application.Resources>
<Application>
<Application.Resources>
<!-- Load WinUI resources -->
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
</Application.Resources>
</Application>
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
</Application.Resources>
</Application>
```

Or, if you have other existing application-scope resources, add `XamlControlsResources` at the top (before other resources) as a merged dictionary:

```xml
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<!-- Load WinUI resources -->
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
<!-- Other merged dictionaries here -->
</ResourceDictionary.MergedDictionaries>
<!-- Other app resources here -->
</ResourceDictionary>
</Application.Resources>
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
<!-- Other merged dictionaries here -->
</ResourceDictionary.MergedDictionaries>
<!-- Other app resources here -->
</ResourceDictionary>
</Application.Resources>
```

1. In all platform head projects except UWP the Fluent control styles require the Uno Fluent Assets icon font to display correctly. [Follow the instructions here](https://platform.uno/docs/articles/uno-fluent-assets.html) to upgrade your app to use this font. This step is required because the Uno Platform uses a cross-platform ready default font within its styles different from UWP's *Segoe MDL2 Assets*.
11 changes: 6 additions & 5 deletions doc/lightweight-styling.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
uid: uno.themes.lightweightstyling
uid: Uno.Themes.LightweightStyling
---

# Lightweight Styling

[Lightweight styling](https://learn.microsoft.com/windows/apps/design/style/xaml-styles#lightweight-styling) is a way to customize the appearance of XAML controls by **overriding** their default brushes, fonts, and numeric properties. Lightweight styles are changed by providing alternate resources with the same key. All Uno Material styles support the capability to be customized through resource overrides without the need to redefine the style.
Expand Down Expand Up @@ -172,25 +173,25 @@ The general pattern used for mapping the Lightweight Styling resource keys to C#
| Name Part | Description |
| --- | --- |
| `control` | Name of the control type (Button, TextBox, CheckBox, etc.) |
| `variant` | **(Optional) Defaults to `Default`** Certain styles have multiple variants. Ex: For Button we have variants such as: Outlined, Text, Filled |
| `variant` | **(Optional) Defaults to `Default`** Certain styles have multiple variants. Ex: For Button we have variants such as: Outlined, Text, Filled |
| `member-path` | The property or the nested property to assign value to. (Foreground, Background, Placeholder.Foreground, etc.) |
| `visual-state` | **(Optional) Defaults to `Default`** Specifies which `VisualState` that this resource will be applied to (PointerOver, Checked, Disabled, etc.) |

For example, the following resource keys are used with `FilledButtonStyle`, `HyperlinkButtonStyle`, and `CheckBoxStyle` from Uno Material:

##### Filled Button
#### Filled Button

- `Theme.Button.Resources.Filled.Foreground.Default`
- `Theme.Button.Resources.Filled.Foreground.Pressed`
- `Theme.Button.Resources.Filled.Foreground.PointerOver`

##### HyperlinkButton (Default)
#### HyperlinkButton (Default)

- `Theme.HyperlinkButton.Resources.Default.Foreground.Default`
- `Theme.HyperlinkButton.Resources.Default.Foreground.Pressed`
- `Theme.HyperlinkButton.Resources.Default.Foreground.PointerOver`

##### CheckBox (Default)
#### CheckBox (Default)

- `Theme.CheckBox.Resources.Default.Foreground.Checked`
- `Theme.CheckBox.Resources.Default.Foreground.CheckedPressed`
Expand Down
5 changes: 4 additions & 1 deletion doc/material-colors.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
---
uid: uno.themes.material.colors
uid: Uno.Themes.Material.Colors
---

# Material Colors and Brushes

## Colors

| Key | LightValue | DarkValue |
| -------------------------- | ---------- | --------- |
| PrimaryColor | #5946D2 | #C7BFFF |
Expand Down Expand Up @@ -41,6 +42,7 @@ uid: uno.themes.material.colors
| OutlineVariantColor | #C9C5D0 | #57545D |

## Opacities

| Key | Value |
| ------------------ | ----- |
| HoverOpacity | 0.08 |
Expand All @@ -54,6 +56,7 @@ uid: uno.themes.material.colors
| DisabledLowOpacity | 0.12 |

## Brushes

| Key | Color | Opacity |
| ------------------------------------- | -------------------------- | ------------------ |
| PrimaryBrush | PrimaryColor | 1 |
Expand Down
8 changes: 6 additions & 2 deletions doc/material-controls-extensions.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
uid: Uno.Themes.Material.Extensions
---

# Material Control Extensions

## Icon
Expand Down Expand Up @@ -118,11 +122,11 @@ Applying the surface tint for elevated controls is optional and must be explicit

The above XAML will produce the following result:

![](assets/material-elevation-buttons.png)
![Uno Material Elevation Buttons with Tint Enabled](assets/material-elevation-buttons.png)

If we were to alter the XAML above and set `um:ControlExtensions.IsTintEnabled="False"` on each of the buttons, we would see elevated buttons without tints:

![](assets/material-elevation-buttons-shadow-only.png)
![Uno Material Elevation Buttons with Tint Disabled](assets/material-elevation-buttons-shadow-only.png)

### Supported Controls

Expand Down
7 changes: 6 additions & 1 deletion doc/material-controls-styles.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# Material Controls Styles
---
uid: Uno.Themes.Material.Styles
---

# Material Controls Styles

Control|Style Key|IsDefaultStyle*
-|-|-
AppBarButton|AppBarButtonStyle|True
Expand Down
11 changes: 9 additions & 2 deletions doc/material-dsp.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,39 @@
---
uid: Uno.Material.DSP
uid: Uno.Themes.Material.DSP
---

# Using the DSP Tooling in Uno.Material

## Introduction

Is it possible to automate the creation of the Material Design color palette? Yes, it is. Uno.Material provides a tooling to generate the color palette from the official Material Design color palette. This tooling is available in the [Uno.Dsp.Cli](https://nuget.org/packages/Uno.Dsp.Cli) and [Uno.Dsp.Tasks](https://nuget.org/packages/Uno.Dsp.Tasks) NuGet packages. The following instructions will cover the Uno.Dsp.Tasks version, which is more automatic.

> [!NOTE]
> Make sure you are referencing the generated XAML file in your
> application's `App.xaml` file, as shown in the following example:
>
> ```xml
> <MaterialTheme xmlns="using:Uno.Material"
> ColorOverrideSource="ms-appx:///PROJECT_NAME/Styles/Application/MaterialColorsOverride.xaml" />
> ```
>
> More details [In the _Manual Color Overrides_ section of the Getting Started page](xref:uno.themes.material.getstarted)
## The Uno.Dsp.Tasks NuGet package
This package will be automatically present in the project after [creating a new Uno Platform project](https://aka.platform.uno/get-started) specifying the _Material_ theme. It is also possible to add it manually to an existing Uno Platform project by adding the following line to the _PackageReference_ section of the _csproj_ file:
* Add a nuget package reference:
```xml
<PackageReference Include="Uno.Dsp.Tasks" Version="[latest version]" />
```
* The package is already present when you select _Material_ theme during project creation:
![](assets/material-theme-selection-wizard.png)
![Selection of Material theme when creating a project using the Uno Template Wizard](assets/material-theme-selection-wizard.png)

## Generating a custom color palette and export as DSP file

1. Navigate to the [Material Theme Builder](https://m3.material.io/theme-builder#/custom) and select the colors you want to use for your application.
2. Locate the _Export_ button and pick the _material Tokens (DSP)_ format.

Expand All @@ -37,6 +43,7 @@ This package will be automatically present in the project after [creating a new
5. Build your application. The `ColorPaletterOverride.xaml` file will be automatically updated with the colors present in the DSP zip file.

## More flexibility

This will generate the file at each build, potentially overriding any changes you made to the file. If you want to keep it that way, you can simply remove the `ColorPaletteOverride.zip` file from the `Styles` folder, the file won't get overwritten anymore.

Alternatively, you can also use the [Uno.Dsp.Cli](https://nuget.org/packages/Uno.Dsp.Cli) package to generate the file from the command line. This will allow you to generate the file only when you want to, and not at each build.
12 changes: 7 additions & 5 deletions doc/material-getting-started.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
uid: uno.themes.material.getstarted
uid: Uno.Themes.Material.GetStarted
---

# Uno.Material

<p align="center">
<img src="assets/material-design-system.png">
<img src="assets/material-design-system.png" alt="Material design system" />
</p>

# Uno.Material

The Uno.Material library is available as NuGet packages that can be added to any new or existing Uno solution.
Uno Material lets you apply [Material Design 3](https://m3.material.io/) styling to your application with just a few lines of code.

Expand Down Expand Up @@ -94,6 +94,7 @@ If your application is based on the older solution template that includes a shar
## Customization

### Color Overrides using _Material Theme Builder_ and DSP format

It is possible to use the [Material Theme Builder](https://m3.material.io/theme-builder#/custom) to generate a custom color palette derived from your own basic colors. The generated palette is provided in the [DSP format](https://m3.material.io/styles/color/the-color-system/color-dsp) and can be used to override the default Uno.Material colors.

The tooling required to generate the _Material Colors Override_ file from a DSP package (zip file) will be present by default when creating a _Uno Extensions_ project with support for Uno.Material.
Expand All @@ -103,6 +104,7 @@ The tooling required to generate the _Material Colors Override_ file from a DSP
Follow this link to get [more Information about the DSP tooling](xref:Uno.Material.DSP).

### Manual Color Overrides

Use this when you want to specify MANUALLY each colors.

1. In the application's **App Code Library** project (`PROJECT_NAME.csproj`), add a new Resource Dictionary named `MaterialColorsOverride.xaml`
Expand Down Expand Up @@ -262,7 +264,7 @@ If you would like Uno.Material to use a different font, you can override the def

## Using C# Markup

Uno Material also has support for C# Markup through a [Uno.Material.WinUI.Markup](https://www.nuget.org/packages/Uno.Material.WinUI.Markup) NuGet Package.
Uno Material also has support for C# Markup through a [Uno.Material.WinUI.Markup](https://www.nuget.org/packages/Uno.Material.WinUI.Markup) NuGet Package.

To get started with Uno Material in your C# Markup application, add the `Uno.Material.WinUI.Markup` NuGet package to your **App Code Library** project and your platform heads.
Then, add the following code to your `AppResources.cs`:
Expand Down
Loading

0 comments on commit 66536ca

Please sign in to comment.