Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: added UnoDspImportColor mention #1407

Merged
merged 1 commit into from
May 13, 2024
Merged
Changes from all 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
21 changes: 21 additions & 0 deletions doc/material-dsp.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,27 @@ This package will be automatically present in the project after [creating a new
* The package is already present when you select _Material_ theme during project creation:
![Selection of Material theme when creating a project using the Uno Template Wizard](assets/material-theme-selection-wizard.png)

It is possible to configure the import process. The _UnoDspImportColors_ item found in the _csproj_ file has a number of attributes we can set:

| Attribute | Description | Default Value |
|------------------|---------------------------------|-------------------------|
| `Include` | Style files to input | |
| `Generator`* | Type of generator to use | `Xaml` |
| `OutputPath`** | Path to use for the output | Input file directory |

\* The possible values for `Generator` are `Xaml` or `Csharp`.

\*\* If `Include` is a glob (eg: \*.json), `OutputPath` should be a directory.

```xml
<ItemGroup>
<UnoDspImportColors Include="Styles\*.json" Generator="Csharp" OutputPath="Styles\Theme\" />
</ItemGroup>
```

> [!NOTE]
> The Uno.Sdk will automatically include this configuration for you. Creating a new project with the _CSharpMarkup_ feature will automatically set the generator attribute to `Csharp`. It will set the generator to `Xaml` by default.

## Generating a custom color palette and exporting it as a JSON 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.
Expand Down
Loading