An open API service indexing awesome lists of open source software.

https://github.com/soenneker/soenneker.quark.gen.themes

A source generator for generating Quark css files at compile time
https://github.com/soenneker/soenneker.quark.gen.themes

csharp css dotnet gen generator quark quarkthemegenerator source themes theming util

Last synced: about 1 month ago
JSON representation

A source generator for generating Quark css files at compile time

Awesome Lists containing this project

README

          

[![](https://img.shields.io/nuget/v/soenneker.quark.gen.themes.svg?style=for-the-badge)](https://www.nuget.org/packages/soenneker.quark.gen.themes/)
[![](https://img.shields.io/github/actions/workflow/status/soenneker/soenneker.quark.gen.themes/publish-package.yml?style=for-the-badge)](https://github.com/soenneker/soenneker.quark.gen.themes/actions/workflows/publish-package.yml)
[![](https://img.shields.io/nuget/dt/soenneker.quark.gen.themes.svg?style=for-the-badge)](https://www.nuget.org/packages/soenneker.quark.gen.themes/)
[![](https://img.shields.io/github/actions/workflow/status/soenneker/soenneker.quark.gen.themes/codeql.yml?label=CodeQL&style=for-the-badge)](https://github.com/soenneker/soenneker.quark.gen.themes/actions/workflows/codeql.yml)

# ![](https://user-images.githubusercontent.com/4441470/224455560-91ed3ee7-f510-4041-a8d2-3fc093025112.png) Soenneker.Quark.Gen.Themes
### A source generator for generating Quark css files at compile time

## Installation

```
dotnet add package Soenneker.Quark.Gen.Themes
```

## Usage

Add the attribute to a class that exposes a single public static method or property returning a `Theme`.

```csharp
using Soenneker.Quark;
using Soenneker.Quark.Gen.Themes;

[GenerateQuarkThemeCss("wwwroot/css/quark-theme.css")]
public static class MyTheme
{
public static Theme Build() => new()
{
Name = "MyTheme",
Tokens = new ThemeTokens
{
Light =
{
Primary = "oklch(0.623 0.214 259.815)",
PrimaryForeground = "oklch(0.985 0 0)"
}
},
Buttons = new ButtonOptions
{
// theme options here
}
};
}
```

By default the same theme definition also emits `tailwind/quark-theme.generated.css`, which `Soenneker.Quark.Gen.Tailwind` can import to override the baked-in shadcn theme defaults at build time.