You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary: logseq's packaged (internal) style.css contains an img,video {height:auto;[..]} style which appears to prevent per-image-enforcement of height+width settings (ie. forcing a particular aspect ratio). This is inconvenient in certain cases, is there any way to use custom.css to override it?
When you resize an image, the aspect ratio is preserved (ie. distortion is prevented). That's generally a good thing, but I would prefer to be able to, in particular cases, display images with precisely the aspect ratio that I choose. Say that the image code is ![my image](../assets/myimage.png){:height 180, :width 125}, then the aspect ratio ought to be 180:125 even if the content of the image is, say, 200x200 px
I know that this particular style is responsible because setting width / height to arbitrary values and then using devtools to pick the image and disable the height: auto style instantly results in the image resizing to the width/height that were set.
I have attempted to use custom.css, with the help of W3Schools and the devtools on the Logseq window. The closest I got to a rule that makes sense was
But this doesn't actually work, it just replaces logseq's problematic height style with a different problematic style.
So far, the only way I have found to address this is the obvious: remove the height: auto styling from logseq style.css. That works but of course also means ALL images are displayed without aspect preservation.
My question is, is it actually possible to 'cancel out' logseq's problematic style viacustom.css? Or is there another (sensible) way to do this?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Summary: logseq's packaged (internal)
style.css
contains animg,video {height:auto;[..]}
style which appears to prevent per-image-enforcement of height+width settings (ie. forcing a particular aspect ratio). This is inconvenient in certain cases, is there any way to use custom.css to override it?When you resize an image, the aspect ratio is preserved (ie. distortion is prevented). That's generally a good thing, but I would prefer to be able to, in particular cases, display images with precisely the aspect ratio that I choose. Say that the image code is
![my image](../assets/myimage.png){:height 180, :width 125}
, then the aspect ratio ought to be 180:125 even if the content of the image is, say, 200x200 pxI know that this particular style is responsible because setting width / height to arbitrary values and then using devtools to pick the image and disable the
height: auto
style instantly results in the image resizing to the width/height that were set.I have attempted to use custom.css, with the help of W3Schools and the devtools on the Logseq window. The closest I got to a rule that makes sense was
But this doesn't actually work, it just replaces logseq's problematic
height
style with a different problematic style.So far, the only way I have found to address this is the obvious: remove the
height: auto
styling from logseqstyle.css
. That works but of course also means ALL images are displayed without aspect preservation.My question is, is it actually possible to 'cancel out' logseq's problematic style via
custom.css
? Or is there another (sensible) way to do this?Beta Was this translation helpful? Give feedback.
All reactions