Skip to content

fix: style the popup container in the bundled stylesheets - #548

Open
esetnik wants to merge 1 commit into
react-component:masterfrom
esetnik:fix/stylesheet-container-class
Open

esetnik wants to merge 1 commit into
react-component:masterfrom
esetnik:fix/stylesheet-container-class

Conversation

@esetnik

@esetnik esetnik commented Nov 17, 2026 •

Copy link
Copy Markdown

What

The bundled stylesheets no longer style the tooltip's content box.

Popup renders the content in .rc-tooltip-container. It was .rc-tooltip-inner up to 1.2.2 and .rc-tooltip-body in 1.3.0–1.3.2, then #505 renamed it. assets/bootstrap.less and assets/bootstrap_white.less still style .rc-tooltip-inner. So an app that imports @rc-component/tooltip/assets/bootstrap_white.css, as the README's usage example does (or bootstrap.css), gets a tooltip with no background, padding, text color or border radius. The published 1.5.2 bootstrap.css is byte-identical to the one in rc-tooltip 6.4.0.

Change

  • Rename the content rule to .@{tooltip-prefix-cls}-container in both themes. The -arrow-inner rules of the white theme are a different element and are unchanged.
  • Add tests/assets.test.tsx. It renders a tooltip, checks that the role="tooltip" element carries rc-tooltip-container, and checks that both .less files style that class and no longer style -inner. It fails on master.

Checks

  • npm test: 33 passed. The new test fails without the change.
  • npm run tsc and ESLint are clean. lessc assets/bootstrap.less emits the .rc-tooltip-container rule.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • 样式
    • 更新了两种主题下的提示框内容样式,使其适配新的容器选择器。
  • 测试
    • 新增测试,验证提示框内容与两种主题样式使用一致的选择器。

Since 1.3.3 the popup renders its content in `.rc-tooltip-container`
(it was `-inner` up to 1.2.2 and `-body` in 1.3.0 to 1.3.2), but
`assets/bootstrap.less` and `assets/bootstrap_white.less` still style
`.rc-tooltip-inner`. Anyone importing `assets/bootstrap.css` or
`assets/bootstrap_white.css` gets a tooltip with no background, padding
or text color.

Rename the rule in both themes, and add a test that the stylesheets
style the class the popup renders.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 17, 2026

Copy link
Copy Markdown

@esetnik is attempting to deploy a commit to the afc163's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

两个 Bootstrap LESS 文件将提示框内容样式选择器从 rc-tooltip-inner 改为 rc-tooltip-container。新增测试验证 Tooltip 渲染类名及两个样式文件中的选择器。

Changes

提示框样式选择器更新

Layer / File(s) Summary
更新选择器并验证
assets/bootstrap.less, assets/bootstrap_white.less, tests/assets.test.tsx
两个 LESS 文件改用 rc-tooltip-container 选择器。测试验证 Tooltip 内容元素包含该类,并检查样式文件包含 container 选择器且不包含 inner 选择器。

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

Suggested reviewers: yiminghe, sehuo

Merge Risk: Minimal · up to 82e09

This updates the bundled Bootstrap theme styles to target the tooltip content class that is actually rendered, so the tooltip regains its background, padding and text color. No concrete merge risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed 标题“fix: style the popup container in the bundled stylesheets”与变更内容一致。变更将 assets/bootstrap.less 和 assets/bootstrap_white.less 中的工具提示样式选择器从 .rc-tooltip-inner 改为 .rc-tooltip-container,并新增测试验证该类名。标题准确描述了主…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

标题“fix: style the popup container in the bundled stylesheets”与变更内容一致。变更将 assets/bootstrap.less 和 assets/bootstrap_white.less 中的工具提示样式选择器从 .rc-tooltip-inner 改为 .rc-tooltip-container,并新增测试验证该类名。标题准确描述了主要变更:为打包样式表中的弹出内容容器添加样式。

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

我是小兔,蹦到样式旁,
看见 container 换上新衣裳。
两份样式,选择相同,
测试轻轻确认无误。
胡萝卜作响,我开心跳跃。

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 014fe29f-58ce-4003-af7f-97c86e285ba8
Commits

Reviewing files that changed from the base of the PR and between 2d2edbb and 82e0953.

Files selected for processing: 3

  • assets/bootstrap.less
  • assets/bootstrap_white.less
  • tests/assets.test.tsx

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

@codecov

codecov Bot commented Nov 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (2d2edbb) to head (82e0953).

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #548   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            3         3           
  Lines           38        38           
  Branches        15        15           
=========================================
  Hits            38        38           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

1 participant