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

feat(dialog): support custom padding bottom when no footer #3800

Closed

Conversation

guoyunhe
Copy link
Contributor

没有 footer 时,给 .next-dialog-body 增加一个类 .next-dialog-body-no-footer。这个类的 padding-bottom 会使用一个新的变量 $dialog-content-padding-bottom-no-footer,可供定制。默认值和原有的 $dialog-content-padding-bottom 一致,保证向前兼容。

Fix #3799

@codecov
Copy link

codecov bot commented Mar 16, 2022

Codecov Report

Merging #3800 (db9fb45) into master (dd7d557) will decrease coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #3800      +/-   ##
==========================================
- Coverage   90.59%   90.57%   -0.03%     
==========================================
  Files         303      303              
  Lines       17819    17833      +14     
  Branches     5369     5375       +6     
==========================================
+ Hits        16143    16152       +9     
- Misses       1657     1661       +4     
- Partials       19       20       +1     
Impacted Files Coverage Δ
src/dialog/inner.jsx 73.68% <100.00%> (ø)
src/select/base.jsx 83.48% <0.00%> (-0.78%) ⬇️
src/upload/card.jsx 86.66% <0.00%> (-0.52%) ⬇️
src/table/selection.jsx 81.87% <0.00%> (-0.41%) ⬇️
src/select/select.jsx 92.40% <0.00%> (-0.19%) ⬇️
src/dialog/dialog.jsx 93.20% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 51f0208...db9fb45. Read the comment docs.

@bindoon
Copy link
Member

bindoon commented Mar 16, 2022

感觉会有breakchange, 如果用户就是期望不写footer 的时候内容是向下贴边的呢

你可以在 Dialog 内容区域自己做间距控制

@guoyunhe
Copy link
Contributor Author

@bindoon 改成向前兼容的模式了,即使用户配了不要下边距也不会影响。

之所以不在内容区域做控制,是为了整个主题能作为一个开箱即用的设计规范给开发者用。起码要让主题网站的实例能和设计稿保持一致。而主题网站是不支持自己去配置内容的,看起来就会有问题。这个主题未来是要给整个国际站用的,设计师希望这个主题能够有比较高的完成度。

@bindoon
Copy link
Member

bindoon commented Mar 17, 2022

确认加 padding 能达到你要的效果吗?
image
我怎么感觉必须是margin呢
image

@@ -164,6 +171,9 @@
#{$dialog-prefix}-header + #{$dialog-prefix}-body {
padding: $dialog-content-padding-top $dialog-content-padding-left-right $dialog-content-padding-bottom $dialog-content-padding-left-right;
}
#{$dialog-prefix}-header + #{$dialog-prefix}-body-no-footer {
padding: $dialog-content-padding-top $dialog-content-padding-left-right $dialog-content-padding-bottom-no-footer $dialog-content-padding-left-right;
Copy link
Member

Choose a reason for hiding this comment

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

在 body 上面加padding 似乎依然是贴边的

@bindoon
Copy link
Member

bindoon commented Mar 17, 2022

如果期望留着底边是不是可以 footer={[]} 把两个按钮去掉?

@bindoon bindoon closed this Mar 21, 2022
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.

[Dialog]支持配置有 Footer 和无 Footer 时,Body 的 padding-bottom 不同
2 participants