SlRvb / Obsidian--ITS-Theme

Theme designed with readability and customizability in mind. Change it easily to your liking with the Style Settings plugin installed.
https://publish.obsidian.md/slrvb-docs/ITS+Theme/ITS+Theme
GNU General Public License v2.0
555 stars 114 forks source link

[Bug] 'Image Zoom' option interferes with native Obsidian variant on mobile #173

Closed Jnosh closed 1 year ago

Jnosh commented 1 year ago

Describe the bug

The mobile version of Obsidian has a built-in equivalent to the ITS 'Image Zoom' option. Unfortunately, if 'Image Zoom' is enabled in the ITS settings (to use it with the desktop version) it interferes with the built-in version and neither works right.

The easiest solution is probably to just only enable 'Image Zoom' on the desktop client since it isn't really needed on mobile anyway.

To Reproduce

OS

Additional context

I am currently working round the issue by disabling 'Image Zoom' and creating a snippet with the image zoom CSS that is only enabled on desktop. Something similar should probably work for ITS proper.

body:not(.is-mobile) .markdown-preview-view img {
  cursor: zoom-in;
}

body:not(.is-mobile) .markdown-preview-view img:active {
  cursor: zoom-out;
  display: block;
  z-index: 100;
  position: fixed;
  max-height: 100%;
  max-width: 100%;
  height: 100%;
  width: 100%;
  object-fit: contain;
  margin: 0 auto;
  text-align: center;
  top: 50%;
  transform: translateY(-50%);
  padding: 0;
  left: 0;
  right: 0;
  bottom: 0;
}
SlRvb commented 1 year ago

That toggle is now a depreciated feature in the beta so this shouldn't conflict anymore