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

fix: resolve the style not taking effect error #52210

Merged
merged 3 commits into from
Jan 3, 2025

Conversation

Wxh16144
Copy link
Member

@Wxh16144 Wxh16144 commented Jan 2, 2025

…icity (#51936)"

This reverts commit a5dc406.

中文版模板 / Chinese template

🤔 This is a ...

  • 🆕 New feature
  • 🐞 Bug fix
  • 📝 Site / documentation improvement
  • 📽️ Demo improvement
  • 💄 Component style improvement
  • 🤖 TypeScript definition improvement
  • 📦 Bundle size optimization
  • ⚡️ Performance optimization
  • ⭐️ Feature enhancement
  • 🌐 Internationalization
  • 🛠 Refactoring
  • 🎨 Code style optimization
  • ✅ Test Case
  • 🔀 Branch merge
  • ⏩ Workflow
  • ❓ Other (about what?)

🔗 Related Issues

  • Describe the source of related requirements, such as links to relevant issue discussions.
  • For example: close #xxxx, fix #xxxx

💡 Background and Solution

image

如上,整个 sider 都加权重就好了。 一开始就是多一个选择器的,看这里:https://github.com/ant-design/ant-design/pull/50780/files#diff-2dfadcf4cb6e7f95c8edf70cc3750abd37a1f8996c4301a40eefb94dd78c118e

  • The specific problem to be addressed.
  • List the final API implementation and usage if needed.
  • If there are UI/interaction changes, consider providing screenshots or GIFs.

📝 Change Log

Language Changelog
🇺🇸 English fix: resolve the style not taking effect error
🇨🇳 Chinese 修复 Layout Sider 的样式不生效错误

Sorry, something went wrong.

Copy link

stackblitz bot commented Jan 2, 2025

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link
Contributor

github-actions bot commented Jan 2, 2025

👁 Visual Regression Report for PR #52210 Failed ❌

🎯 Target branch: master (bcc802d)
📖 View Full Report ↗︎

Expected (Branch master) Actual (Current PR) Diff
input-group.compact.png input-group.compact.png input-group.compact.css-var.png input-group.compact.css-var.png
layout-component-token.compact.png layout-component-token.compact.png layout-component-token.compact.png layout-component-token.compact.png
layout-component-token.dark.png layout-component-token.dark.png layout-component-token.dark.png layout-component-token.dark.png
layout-component-token.default.png layout-component-token.default.png layout-component-token.default.png layout-component-token.default.png

Important

There are 4 diffs found in this PR: 🔄 4 changed.
Please check all items:

  • Visual diff is acceptable

Sorry, something went wrong.

Copy link
Contributor

github-actions bot commented Jan 2, 2025

Preview is ready

Copy link

Walkthrough

This pull request addresses a bug fix related to style issues in the Layout Sider component. It reverts a previous commit to resolve the problem of styles not taking effect by adjusting the CSS selectors and style hooks.

Changes

File Summary
components/layout/style/sider.ts Adjusted CSS selectors for &-zero-width and updated style hooks to ensure styles are applied correctly.

@@ -69,7 +69,7 @@ const genSiderStyle: GenerateStyle<LayoutToken, CSSObject> = (token) => {
transition: `all ${motionDurationMid}`,
},

[`${antCls}-layout &-zero-width`]: {
'&-zero-width': {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure that the removal of ${antCls}-layout from the selector does not affect other components relying on this style. Verify that the new selector &-zero-width is scoped correctly.

@@ -139,7 +139,9 @@ const genSiderStyle: GenerateStyle<LayoutToken, CSSObject> = (token) => {

export default genStyleHooks(
['Layout', 'Sider'],
(token) => [genSiderStyle(token)],
(token) => ({

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure that the new structure of genStyleHooks with the updated token mapping does not introduce any regressions in the style application.

Copy link

pkg-pr-new bot commented Jan 2, 2025

Copy link

codecov bot commented Jan 2, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (bcc802d) to head (66a3099).
Report is 72 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master    #52210   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          763       763           
  Lines        13643     13643           
  Branches      3560      3560           
=========================================
  Hits         13643     13643           

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

@afc163
Copy link
Member

afc163 commented Jan 2, 2025

看下 visual diff 对不对

@Wxh16144
Copy link
Member Author

Wxh16144 commented Jan 3, 2025

看下 visual diff 对不对

同步一下 master 再看看,前面快照有问题的

@afc163 afc163 merged commit 46a8eff into ant-design:master Jan 3, 2025
39 of 40 checks passed
@afc163
Copy link
Member

afc163 commented Jan 3, 2025

相当于回滚了 #51936@aojunhao123 看看是否符合预期

@aojunhao123
Copy link
Contributor

嗯,看着没问题

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.

Layout.Sider 特殊 trigger 的定位样式错误
3 participants