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

Unexpected color error with CSS shorthand hex #839

Closed
jat255 opened this issue Sep 23, 2021 · 1 comment · Fixed by #870
Closed

Unexpected color error with CSS shorthand hex #839

jat255 opened this issue Sep 23, 2021 · 1 comment · Fixed by #870

Comments

@jat255
Copy link

jat255 commented Sep 23, 2021

In some existing (previously working) code, we got an error after updating GT to 0.3.1, that I think is a regression introduced by #787.

Using shorthand hex codes for colors results in an error:

tab_style(
      style = list(
        cell_text(weight = "bold",
                  color = "#555")
      ),

Gives the following error:

WARN [2021-09-23 16:54:48.776] Error in : An invalid color name was used (`"#555"`):
* Only R/X11 color names and CSS 3.0 color names can be used - function (m) { logger::log_warn(m$message) }
Warning: Error in : An invalid color name was used (`"#555"`):
 * Only R/X11 color names and CSS 3.0 color names can be used
  1: shiny::runApp

This is easy to workaround for the time being (just change to full hex colors instead), but thought it was important to report, as those are valid CSS color identifiers.

@rich-iannone
Copy link
Member

We didn't yet implement short hexadecimal color codes but we've certainly thought about it. Seeing that it's being used makes us definitely want to make it work now. Thanks for reporting!

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

Successfully merging a pull request may close this issue.

2 participants