ratatui-org / ratatui

Rust library that's all about cooking up terminal user interfaces (TUIs) 👨‍🍳🐀
https://ratatui.rs
MIT License
8.86k stars 269 forks source link

Add Stylize methods directly to Style #1158

Open joshka opened 1 month ago

joshka commented 1 month ago

Problem

I'd like to be able to write:

const FOO: Style = Style::new().green().bold();

But trait methods can't be const.

Solution

Add the Stylize methods directly to the Style type rather than implementing them via Stylize.

Alternatives

Additional context

g4titanx commented 1 month ago

where can the Style type be found in the codebase?

joshka commented 1 month ago

I'd like to get buy-in / thoughts from the other maintainers before implementing this. I've removed the good first issue label for now.

g4titanx commented 1 month ago

alright