Skip to content

Commit

Permalink
fix: 修复图片位置偏移的问题
Browse files Browse the repository at this point in the history
使用补丁方式实现css修改
  • Loading branch information
AirboZH committed Sep 12, 2023
1 parent a188c91 commit 5dc063c
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 8 deletions.
3 changes: 0 additions & 3 deletions src/css/addon/commons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -718,9 +718,6 @@ $btn-mb: 0.5rem;
display: block;
width: 7rem;
height: 7rem;
line-height: 7rem;
font-size: 40px;
text-align: center;
overflow: hidden;
box-shadow: var(--avatar-border-color) 0 0 0 2px;
transform: translateZ(0); /* fixed the zoom in Safari */
Expand Down
13 changes: 13 additions & 0 deletions src/css/patch/commons.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#sidebar {
#avatar {
font-size: 50px;
text-align: center;
display: flex;
justify-content: center;
align-items: center;

p {
margin: auto;
}
}
}
2 changes: 2 additions & 0 deletions src/css/patch/index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@import "footer";
@import "commons";
2 changes: 1 addition & 1 deletion src/css/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

//append your custom style below

@import "patch/footer";
@import "patch";

//import third-party css
@import "bootstrap/dist/css/bootstrap.css";
Expand Down
7 changes: 3 additions & 4 deletions templates/modules/sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@
<th:block th:if="${not #strings.isEmpty(site.logo)}">
<img th:src="${site.logo}" width="112" height="112" alt="avatar" />
</th:block>
<th:block
th:if="${#strings.isEmpty(site.logo)}"
th:text="${#strings.substring(site.title,0,1)}"
></th:block>
<th:block th:if="${#strings.isEmpty(site.logo)}">
<p th:text="${#strings.substring(site.title,0,1)}" />
</th:block>
</a>

<div class="site-title">
Expand Down

0 comments on commit 5dc063c

Please sign in to comment.