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

idea: Macro to make defining themes less repetitive #446

Open
tigerros opened this issue Dec 31, 2023 · 0 comments
Open

idea: Macro to make defining themes less repetitive #446

tigerros opened this issue Dec 31, 2023 · 0 comments
Labels
enhancement 🔥 New feature or request idea 💡

Comments

@tigerros
Copy link
Contributor

I'm mostly talking about having to specify Cow::Borrowed for each string. The internal light and dark themes have 81 occurrences of the Cow::Borrowed and it will get larger. Adding new strings is annoying. Example solution:

pub const LIGHT_THEME: Theme = magic! {
  name: "light",
  // Could remove `foo: FooTheme` as well
  button: {
    background: %[str] "white",
    font_theme: {
      color: &[str] "black",
    }
  }
};
@marc2332 marc2332 added enhancement 🔥 New feature or request idea 💡 labels Dec 31, 2023
@marc2332 marc2332 changed the title Macro to make defining themes less repetitive idea: Macro to make defining themes less repetitive Dec 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 🔥 New feature or request idea 💡
Projects
None yet
Development

No branches or pull requests

2 participants