Skip to content

Commit

Permalink
docs: added UnoDspImportColor mention
Browse files Browse the repository at this point in the history
  • Loading branch information
rajamatt committed May 10, 2024
1 parent 4d87b4c commit 1599847
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions doc/material-dsp.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,25 @@ 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` and `csharp`.

```xml
<ItemGroup>
<UnoDspImportColors Include="Styles\*.json" Generator="csharp" OutputPath="json_file.g.cs" />
</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

0 comments on commit 1599847

Please sign in to comment.