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

文字区过少时改内容宽度为 70% 首页未居中 #67

Closed
jalr4ever opened this issue Oct 12, 2024 · 6 comments
Closed

文字区过少时改内容宽度为 70% 首页未居中 #67

jalr4ever opened this issue Oct 12, 2024 · 6 comments
Labels
enhancement New feature or request high priority 高优先级 upstream 来自上游的 issue

Comments

@jalr4ever
Copy link

jalr4ever commented Oct 12, 2024

内容区域最大宽度 48rem:
iShot_2024-10-12_11 20 48

内容区域最大宽度 70% :
iShot_2024-10-12_11 21 11

如图改了宽度后,首页变得居左了,首页能否保留 48em 那种居中的效果呢?

@HowieHz
Copy link
Owner

HowieHz commented Oct 14, 2024

已读,正在检查此问题

@HowieHz
Copy link
Owner

HowieHz commented Oct 14, 2024

flex 框一直是居中的,设置为 70% 的时候 flex 框变大了,内部的文字依然从左开始,在文字比较少的页面上就体现的是整体偏左
image
image

调成 78rem 也有类似的现象
image

@HowieHz
Copy link
Owner

HowieHz commented Oct 14, 2024

我猜测,理想的样式可能是

设置一个宽度最小值(如 48rem)和一个宽度最大值(如 70%)
按照最长的文字设置这个框的宽度,把这个框撑大
如果一行文字超过宽度最大值,就给这行文字换行

@HowieHz HowieHz added enhancement New feature or request need further discussion 需要进一步讨论 high priority 高优先级 labels Oct 14, 2024
@jalr4ever
Copy link
Author

@HowieHz 这个方案不错,如果 70% 一开始会感觉很空,会居左显示

@HowieHz
Copy link
Owner

HowieHz commented Oct 16, 2024

关联上游 issue guqing/halo-theme-higan#118

@HowieHz HowieHz added upstream 来自上游的 issue and removed need further discussion 需要进一步讨论 labels Oct 16, 2024
@HowieHz
Copy link
Owner

HowieHz commented Oct 16, 2024

已发布新版本
https://github.com/HowieHz/halo-theme-higan-hz/releases/tag/v1.9.0

简述版

现在要解决这个看起来不居中的问题,你只需要去开启“自定义内容区域最小宽度”和“自定义内容区域宽度属性”即可。

完整描述版

如果你要用上游原主题的宽度设置,那就关闭“自定义内容区域最大宽度”,开启“自定义内容区域最小宽度”和“自定义内容区域宽度属性”。

如果你要设定最大宽度为 70%,那就开启“自定义内容区域最大宽度”设定为 70%,并开启“自定义内容区域最小宽度”和“自定义内容区域宽度属性”。

@HowieHz HowieHz closed this as completed Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request high priority 高优先级 upstream 来自上游的 issue
Projects
None yet
Development

No branches or pull requests

2 participants