rstudio / rstudio/flexdashboard

Specifying font color for `valueBox()`.

Open
#409 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
848
Forks
298
PR merge metrics
No merged PRs in 30d

Description

I notice that some of my value boxes are now defaulting to a black font color instead of the white that it used to be. Looking inside the function definition, I see there is some work being done to automatically pick a font color based on the background color using

color <- htmltools::parseCssColors(color)
    colorText <- getColorContrast(color)
    colorIcon <- sassValue(paste0("mix(", color, ",", getColorContrast(colorText), 
      ",50%)"))

I'm wondering if we could simply control the font color ourselves to override this default behavior?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the valueBox() implementation and the color-selection code shown in the issue. Trace how the background and font colors are currently chosen, then identify the existing valueBox styling or option path relevant to an explicit font color. Done means a specified font color can override the automatic choice without breaking the default behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
r, sass
Domain
frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.