Skip to content

Commit

Permalink
client/posts: respect right side margin in original and height fit modes
Browse files Browse the repository at this point in the history
Still not perfect for comment section and edit mode, but we should
really replace image resizing logic with css.
  • Loading branch information
po5 committed Mar 21, 2024
1 parent 81416b6 commit e2bdb5f
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 22 deletions.
60 changes: 38 additions & 22 deletions client/css/post-main-view.styl
Original file line number Diff line number Diff line change
Expand Up @@ -15,38 +15,53 @@
border: 0
outline: 0

nav.buttons
margin-top: 0
display: flex
flex-wrap: wrap
article
flex: 1 0 33%
a
display: inline-block
width: 100%
padding: 0.3em 0
text-align: center
vertical-align: middle
transition: background 0.2s linear, box-shadow 0.2s linear
&:not(.inactive):hover
background: lighten($main-color, 90%)
i
font-size: 140%
>.sidebar>nav.buttons, >.content nav.buttons
margin-top: 0
display: flex
flex-wrap: wrap
article
flex: 1 0 33%
a
display: inline-block
width: 100%
padding: 0.3em 0
text-align: center
@media (max-width: 800px)
margin-top: 2em
vertical-align: middle
transition: background 0.2s linear, box-shadow 0.2s linear
&:not(.inactive):hover
background: lighten($main-color, 90%)
i
font-size: 140%
text-align: center
@media (max-width: 800px)
margin-top: 0.6em
margin-bottom: 0.6em

>.content
width: 100%
&[data-fit=fit-original] .after-mobile-controls, &[data-fit=fit-height] .after-mobile-controls
width: auto
margin-right: 1.5em
@media (max-width: 1000px)
margin-right: 1em

.post-container
margin-bottom: 2em
margin-bottom: 0.6em

.post-content
margin: 0
background-size: cover
background-repeat: no-repeat
background-origin: content-box
padding-right: 1.5em
@media (max-width: 1000px)
padding-right: 1em

.after-mobile-controls
width: 100%

.darktheme .post-view
>.sidebar
>.sidebar, >.content
nav.buttons
article
a:not(.inactive):hover
Expand All @@ -56,6 +71,8 @@
@media (max-width: 800px)
.post-view
flex-wrap: wrap
>.after-mobile-controls
order: 3
>.sidebar
order: 2
min-width: 100%
Expand Down Expand Up @@ -113,7 +130,6 @@
h1
margin-bottom: 0.5em
.thumbnail
background-position: 50% 30%
width: 4em
height: 3em
li
Expand Down
1 change: 1 addition & 0 deletions client/js/controls/post_readonly_sidebar_control.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ class PostReadonlySidebarControl extends events.EventTarget {
oldNode.classList.remove("active");
}
newNode.classList.add("active");
document.querySelector(".content").dataset.fit = className;
}

_evtAddToFavoritesClick(e) {
Expand Down

0 comments on commit e2bdb5f

Please sign in to comment.