Skip to content

Commit

Permalink
feat: 可自定义内容区域最小宽度,内容区域宽度属性 #67
Browse files Browse the repository at this point in the history
  • Loading branch information
HowieHz committed Oct 15, 2024
1 parent d33640d commit bcbdc45
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
![preview](./screenshots/preview-1.png)

文档版本: `1.8.1`
文档版本: `1.9.0`
(如此处文档版本小于您正在使用的主题版本,说明您正在阅读一份过时的文档,请到[项目原地址](https://github.com/HowieHz/halo-theme-higan-hz/blob/main/README.md)阅读最新版本。)

### 目录
Expand Down Expand Up @@ -101,9 +101,15 @@
#### 增加于“总体样式”

1. “配色方案”(样式-配色方案)添加“跟随系统”选项
2. 可自定义内容区域最大宽度
(默认值为 48rem。允许全部 CSS 长度单位, 如: 48rem, 780px, 70vw, 70%)
(原主题在之后的更新里更新了自适应最大宽度设置,但是实测会让内容显示偏左,因此项默认开启。如果你想体验上游的最大宽度设置模式,请关闭“总体样式-自定义内容区域最大宽度”这一项设置)
2. 对于内容区域宽度给予更大的配置自由度
(说明:原主题在之后的更新里更新了自适应最大宽度设置,内容区域最大宽度将随着屏幕宽度的变化而变化。但是在文字内容较少时(如主页),会显得内容显示位置偏左,因此“可自定义内容区域最大宽度”默认开启。
如果你想使用上游的最大宽度设置模式,请关闭“总体样式-自定义内容区域最大宽度”这一项设置,并且推荐同时开启“内容区域最小宽度”,“自定义内容区域宽度属性”并保持默认值,可有效解决文字较少时内容显示偏左的问题)
1. 可自定义内容区域最大宽度
(默认值为 48rem。允许全部 CSS 长度单位, 如: 48rem, 780px, 70vw, 70%。宽度最大值设置较大时可能会出现内容整体偏左的现象。为解决这个问题,可同时开启“内容区域最小宽度”,“自定义内容区域宽度属性”并保持默认值。)
2. 可自定义内容区域最小宽度
(默认值为 48rem。允许全部 CSS 长度单位, 如: 48rem, 780px, 70vw, 70%)
3. 可自定义内容区域宽度属性
(默认值为 fit-content。默认值效果为:使内容区域宽度=最宽的内容的宽度。(此项实际是在设置内容区域的 width 属性对应的样式值))
3. 允许关闭页面底部主题信息
4. 允许关闭页面底部版权信息
5. 允许关闭页面底部菜单
Expand Down
12 changes: 11 additions & 1 deletion templates/fragments/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,17 @@
max-width: /*[(${theme.config?.styles?.max_width})]*/ 48rem;
}
</style>
<div class="max-width mx-auto px-8 ltr">
<style th:inline="css" th:if="${theme.config?.styles?.is_min_width_settings}">
.min-width {
min-width: /*[(${theme.config?.styles?.min_width})]*/ 48rem;
}
</style>
<style th:inline="css" th:if="${theme.config?.styles?.is_content_width_style_settings}">
.content-width {
width: /*[(${theme.config?.styles?.content_width_style})]*/ fit-content;
}
</style>
<div class="max-width min-width mx-auto px-8 ltr content-width">
<th:block th:replace="${navbar}" />

<div class="!min-h-screen content index pt-16">
Expand Down
2 changes: 1 addition & 1 deletion theme.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ spec:
issues: https://github.com/howiehz/halo-theme-higan-hz/issues
settingName: howiehz-higan-setting
configMapName: howiehz-higan-configmap
version: 1.8.1
version: 1.9.0
requires: ">=2.1.0"
license:
- name: "MIT"
Expand Down

0 comments on commit bcbdc45

Please sign in to comment.