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

Add stylize_method for all supported attributes #960

Open
hthuz opened this issue Dec 19, 2024 · 0 comments
Open

Add stylize_method for all supported attributes #960

hthuz opened this issue Dec 19, 2024 · 0 comments

Comments

@hthuz
Copy link

hthuz commented Dec 19, 2024

Is your feature request related to a problem? Please describe.

Crossterm supports 28 attributes (See https://docs.rs/crossterm/latest/crossterm/style/enum.Attribute.html). However, only some of them have stylize method

stylize_method!(reset Attribute::Reset);
stylize_method!(bold Attribute::Bold);
stylize_method!(underlined Attribute::Underlined);
stylize_method!(reverse Attribute::Reverse);
stylize_method!(dim Attribute::Dim);
stylize_method!(italic Attribute::Italic);
stylize_method!(negative Attribute::Reverse);
stylize_method!(slow_blink Attribute::SlowBlink);
stylize_method!(rapid_blink Attribute::RapidBlink);
stylize_method!(hidden Attribute::Hidden);
stylize_method!(crossed_out Attribute::CrossedOut);

Describe the solution you'd like
Consider adding styled method for all supported attributes. I can submit a PR if it's appropriate to do so.

Describe alternatives you've considered if any

Additional context
Stylize method helps simplify code like let text = "example".attribute(style::Attribute::Underlined) to let text = "example".underlined()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant