Skip to content

Inherit container color and background-color into nested containers - #858

Open
chenyangsu wants to merge 1 commit into
r-lib:mainfrom
chenyangsu:fix/div-color-bullets
Open

chenyangsu wants to merge 1 commit into
r-lib:mainfrom
chenyangsu:fix/div-color-bullets

Conversation

@chenyangsu

Copy link
Copy Markdown

Setting color or background-color on a cli_div() colors cli_text(), while nested containers like cli_bullets() and cli_par() drop both (cli_fmt() returns "bullet" instead of "\033[33mbullet\033[39m"). merge_embedded_styles() (R/themes.R) clears old$color and background-color for every child, though only inline <span> nodes are formatted by their parent container.

clii__container_start() now passes inherit_color = tag != "span" so block containers inherit parent colors while keeping overrides and NULL resets. Happy to restrict this to specific container tags instead if you prefer. Fixes #660.

Testing: testthat::test_local(".", filter = "themes|bullets|containers|lists|alerts|inline|keypress") passes (188 passed, 0 failed; 4 new expectations fail on main).

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

Changing color for bullets

1 participant