Support Bootstrap CSS variables for better theming of DT tables in Bootstrap

Open
#1,081 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

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

Research direction

Start by locating where DT filter popover styles are defined and compare the current inline values with Bootstrap 5 CSS variables. Verify the result with a Bootstrap-themed DT table, including a non-light theme, and confirm that popovers inherit the intended background, text, border, and radius styling.

Written by the indexing model from the issue text.

Description

The latest versions of Bootstrap include a layer of CSS properties that help make theming, and adapting to new themes, much easier for downstream components like DT data tables.

For instance, the popover menus for DT filters assume a light theme by default – https://github.com/rstudio/bslib/issues/267 – and cannot be themed by third parties the outside due to their use of inline styles.

Where DT currently uses the following inline styles for popovers

background-color: rgb(255, 255, 255);
border: 1px solid rgb(221, 221, 221);
border-radius: 4px;
padding: 20px 20px 10px;

it could instead (at least for BS5) use the following.

background-color: var(--bs-body-bg);
color: var(--bs-body-color);
border-color: var(--bs-border-color);
border-width: var(--bs-border-width);
border-radius: var(--bs-border-radius);
border-style: var(--bs-border-style);
Dominant language
JavaScript
Stars
621
Forks
177
PR merge metrics
No merged PRs in 30d

Getting set up

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.

More from rstudio/DT

All issues in rstudio/DT

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.