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

Tweaking cli::col_h1() styling #696

Open
olivroy opened this issue Jun 4, 2024 · 1 comment
Open

Tweaking cli::col_h1() styling #696

olivroy opened this issue Jun 4, 2024 · 1 comment
Labels
feature a feature request or enhancement

Comments

@olivroy
Copy link
Contributor

olivroy commented Jun 4, 2024

I am wondering if it was possible to make this output with cli::cli_h1()

image

cli::cli_h1(cli::col_yellow("GP goodpractice"))

Almost does it, but it doesn't affect the line.

I tried playing with https://cli.r-lib.org/reference/themes.html#examples, but it doesn't really work.

I am wondering if docs could be enhanced generally for the id and class arguments. More examples on how to create custom theming of elements would be great!

I'd be happy to make some doc edits, but I can't figure out how things work at the moment..

Using cli::rule(left = "aa", right = "a", col = "yellow") works

@gaborcsardi
Copy link
Member

Currently you need to change the fmt property in the theme of h1 to achieve this. Example:

cli/R/themes.R

Line 106 in b7f8259

fmt = function(x) cli::rule(x, line_col = "cyan")),

@gaborcsardi gaborcsardi added the feature a feature request or enhancement label Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants