logseq-plugin-link-preview icon indicating copy to clipboard operation
logseq-plugin-link-preview copied to clipboard

Link hover content with transparent background and weird font styles

Open compadrejunior opened this issue 2 years ago • 8 comments

Hi folks,

When I mouse over a link the preview card renders a the title and description with a transparent background, no borders and weird font styles.

Here`s an example? image

First time I install the plugin, it works fine. After closing and reopening Logseq the error occurs and then persists.

Thanks in advance.

Regards,

José Compadre Junior

compadrejunior avatar Jan 05 '23 20:01 compadrejunior

Can you try using the default theme and see if the style looks fine?

pengx17 avatar Jan 06 '23 01:01 pengx17

I use logseq-awesome-styler plugin, but even switch to Logseq original theme, preview still with a transparent background like @compadrejunior 's snapshot.

sagiwei avatar Mar 05 '23 03:03 sagiwei

I use logseq-awesome-styler plugin, but even switch to Logseq original theme, preview still with a transparent background like @compadrejunior 's snapshot.

Finally, I found it caused by logseq-awesome-styler plugin, error occurs whenever this plugin turns on.

sagiwei avatar Mar 05 '23 04:03 sagiwei

CSS vars missed image

looks like AwStyler loads little longer and script can't get them. What about wrap with setTimeout for ~1 or 2sec? https://github.com/pengx17/logseq-plugin-link-preview/blob/master/src/App.tsx#L12-L38

yoyurec avatar Mar 09 '23 12:03 yoyurec

fixed + improved // FIXME: adapt for dynamic theme mode change )

yoyurec avatar Mar 09 '23 12:03 yoyurec

I just installed this plug-in and have the Awesome Styler also. The transparent background still occurs, so I am not sure what @yoyurec means by “fixed + improved”.

Edit: turning off Awesome Styler “fixes” the problem.

DutchPete avatar May 06 '23 08:05 DutchPete

@DutchPete @sagiwei @compadrejunior @pengx17 Use with Awesome Series: image image image

Found a way to temporally personally locally solve this. I found out it’s a mistake about variables reference cause this, so just use a fixed color and do not use variables. Find your plugin folder, for MacOS is /Users/UserName/.logseq/plugins/logseq-link-preview/dist/assets.(Could use Developer Tools to locate) Edit the .css file, change the lines indicating colors which are using variables, I edit it like this, change the color as you like:

.link_preview__root {
border: 1px solid #c0c0c033;
}
.link_preview__root:hover {
    border: 1px solid rgba(192, 192, 192, .8)
}
.link_preview__card-container {
    background-color: #f1f1f1b3;
}
.link_preview__text-container-title {
    color: #303030;
}
.link_preview__text-container-description {
    color: #303030;
}
.link_preview__text-container-url-container {
    color: #2573a7;
}

Then, for a little glass effect, I add this in custom.css:

/* link preview fix */
#logseq-link-preview_lsp_main {
  backdrop-filter: blur(3px) ; 
}

Gitbreast avatar Aug 18 '23 12:08 Gitbreast

@Gitbreast thanks a lot.

DutchPete avatar Aug 19 '23 03:08 DutchPete