Skip to content

🎨 Adapt Material You (M3) theme files to various languages and technologies

License

Notifications You must be signed in to change notification settings

Az-21/material-you-adapter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Material You Adapter

Adapt Material You (M3) theme files to various languages and technologies

Usage

  1. Export Jetpack Compose (Kotlin) theme from Material Theme Builder.
  2. [Optional] Rename the zip file; output will use the name of zip file(s).
  3. Place the .zip file in Input/ folder of this program.
  4. Run main.py.
  5. Find generated outputs in Output/ folder.

Tip

This script supports multiple theme files. All .zip files inside Input/ folder will be adapted.

Sample Input

// Generated by Material Theme Builder (zip file > ui/theme/Color.kt)
val primaryLight = Color(0xFF4C662B)
val onPrimaryLight = Color(0xFFFFFFFF)
// ...
val primaryDark = Color(0xFFB1D18A)
val onPrimaryDark = Color(0xFF1F3701)
// ...

Typst Adapter

Typst is a markup-based typesetting system.

Sample Output

#let m3light = (
  primary: rgb("#4C662B"),
  onPrimary: rgb("#FFFFFF"),
  //...
)

#let m3dark = (
  primary: rgb("#B1D18A"),
  onPrimary: rgb("#1F3701"),
  // ...
)

Usage

#import "color.typ": m3dark, m3light

#box(width: 32pt, height: 32pt, fill: m3dark.primary)
#box(width: 32pt, height: 32pt, fill: m3light.primary)

Power FX | Power Apps Adapter

Power Apps is a low-code application building tool.

Sample Output

Note

To reduce modifications required when switching themes, this module generates dark mode and light mode in separate files.

// Light
Set(M3Primary, ColorValue("#4C662B"));
Set(M3OnPrimary, ColorValue("#FFFFFF"));
// ...
// Dark
Set(M3Primary, ColorValue("#B1D18A"));
Set(M3OnPrimary, ColorValue("#1F3701"));
// ...

Usage

  • Copy paste the variable declarations in the OnStart $f x$ parameter of the App.

About

🎨 Adapt Material You (M3) theme files to various languages and technologies

Topics

Resources

License

Stars

Watchers

Forks

Languages