pub mod css;
pub mod fleet_fonts;
pub mod ghostty;
pub mod glsl;
pub mod json;
pub mod nix;
pub mod nix_ast;
pub mod rust;
pub mod scss;
pub mod stylix;
pub mod stylix_fonts;
pub mod svg;
pub mod tailwind;
pub mod tui;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Target {
Css,
Tailwind,
Scss,
Rust,
Json,
Glsl,
Ghostty,
Tui,
Svg,
Stylix,
Nix,
StylixFonts,
FleetFonts,
}
impl Target {
pub fn from_str(s: &str) -> Option<Self> {
Some(match s {
"css" => Self::Css,
"tailwind" => Self::Tailwind,
"scss" => Self::Scss,
"rust" => Self::Rust,
"json" => Self::Json,
"glsl" => Self::Glsl,
"ghostty" => Self::Ghostty,
"tui" => Self::Tui,
"svg" => Self::Svg,
"stylix" | "stylix-base16" => Self::Stylix,
"stylix-fonts" | "fonts-nix" => Self::StylixFonts,
"nix" | "nord-palette-nix" => Self::Nix,
"fleet-fonts" | "fleet_fonts" => Self::FleetFonts,
_ => return None,
})
}
pub fn render(&self, tokens: &ishou_tokens::TokenSet) -> String {
match self {
Self::Css => css::render(tokens),
Self::Tailwind => tailwind::render(tokens),
Self::Scss => scss::render(tokens),
Self::Rust => rust::render(tokens),
Self::Json => json::render(tokens),
Self::Glsl => glsl::render(tokens),
Self::Ghostty => ghostty::render(tokens),
Self::Tui => tui::render(tokens),
Self::Svg => svg::render(tokens),
Self::Stylix => stylix::render(tokens),
Self::Nix => nix::render(tokens),
Self::StylixFonts => stylix_fonts::render(tokens),
Self::FleetFonts => fleet_fonts::render(tokens),
}
}
pub fn all() -> [Target; 13] {
[
Self::Css,
Self::Tailwind,
Self::Scss,
Self::Rust,
Self::Json,
Self::Glsl,
Self::Ghostty,
Self::Tui,
Self::Svg,
Self::Stylix,
Self::Nix,
Self::StylixFonts,
Self::FleetFonts,
]
}
}