ozntel / oz-image-in-editor-obsidian

This Obsidian plugin to view Images, Transclusions, iFrames and PDF Files within the Editor without a necessity to switch to Preview.
339 stars 13 forks source link

When zooming the picture to full screen with invert mode, the background still showing. #38

Closed trungng2006 closed 3 years ago

trungng2006 commented 3 years ago

image

I use this CSS to zoom:

/*Click and hold to expand image*/
.markdown-preview-view img {
    max-width:100%;
    cursor:zoom-in;
    }

.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;
    }

I think that this can be fix by adjusting the mix blend mode in invert css

.theme-dark img[alt$="#invert"], .theme-dark div.oz-image-widget > img[alt$="#invert"] {
    filter: invert(1) hue-rotate(180deg);
    mix-blend-mode: normal;
}
trungng2006 commented 3 years ago

When i edit mix-blend-mode to screen in the style.css, The picture zoom up ok.

ozntel commented 3 years ago

Since it is related to your custom CSS, I advise overwriting the snippet in your CSS file.

csss1234 commented 3 years ago

Im having the same problem when using Blue Topaz theme with no custom snippets. I tried the suggested css above,m with different mix blend modes, did not fix. Any suggestions appreciated