mirror of
https://github.com/jldiaz/copy-protocol-plugin.git
synced 2026-07-22 06:56:55 +00:00
109 lines
3.1 KiB
CSS
109 lines
3.1 KiB
CSS
/*
|
|
* Visual indicator for obsidian://copy protocol links.
|
|
*/
|
|
|
|
/* ── Reading View (Standard Links) ── */
|
|
|
|
/*
|
|
* We target the same pseudo-element Obsidian uses (::after) but with higher
|
|
* specificity to override it completely without !important.
|
|
*/
|
|
.markdown-rendered a.copy-protocol-link,
|
|
.markdown-preview-view a.copy-protocol-link,
|
|
.markdown-rendered a.external-link[href^="obsidian://copy"],
|
|
.markdown-preview-view a.external-link[href^="obsidian://copy"] {
|
|
background-image: none;
|
|
padding-inline-end: 0;
|
|
}
|
|
|
|
/* Hide Obsidian's default external link icon elements in Reading Mode */
|
|
.markdown-rendered a[href^="obsidian://copy"] .external-link,
|
|
.markdown-rendered a[href^="obsidian://copy"] + .external-link,
|
|
.markdown-preview-view a[href^="obsidian://copy"] .external-link,
|
|
.markdown-preview-view a[href^="obsidian://copy"] + .external-link,
|
|
.markdown-rendered a.copy-protocol-link .external-link,
|
|
.markdown-rendered a.copy-protocol-link + .external-link,
|
|
.markdown-preview-view a.copy-protocol-link .external-link,
|
|
.markdown-preview-view a.copy-protocol-link + .external-link {
|
|
display: none;
|
|
}
|
|
|
|
/* ── Live Preview (Managed by ViewPlugin Widget) ── */
|
|
|
|
/*
|
|
* Hide Obsidian's default external link icon on our copy links.
|
|
* Instead of :has(), we use the .has-copy-protocol-line class added in JS.
|
|
*/
|
|
.markdown-source-view.mod-cm6 .has-copy-protocol-line .external-link,
|
|
.markdown-source-view.mod-cm6 .has-copy-protocol-line .cm-url.external-link {
|
|
display: none;
|
|
}
|
|
|
|
/* Ensure the link text looks like a link */
|
|
.markdown-source-view.mod-cm6 .copy-protocol-link {
|
|
text-decoration: underline;
|
|
text-underline-offset: 2px;
|
|
}
|
|
|
|
/* Copy cursor on hover */
|
|
.markdown-source-view.mod-cm6 .copy-protocol-link:hover,
|
|
.markdown-source-view.mod-cm6 a[href^="obsidian://copy"]:hover,
|
|
a.copy-protocol-link:hover {
|
|
cursor: copy;
|
|
}
|
|
|
|
|
|
/* ── Widget Styles (Live Preview) ── */
|
|
|
|
.copy-protocol-icon {
|
|
cursor: copy;
|
|
display: inline-flex;
|
|
margin-left: 5px;
|
|
vertical-align: middle;
|
|
opacity: 0.8;
|
|
transition: transform 0.1s ease-out, opacity 0.1s ease-out;
|
|
}
|
|
|
|
.copy-protocol-icon:hover {
|
|
opacity: 1;
|
|
}
|
|
|
|
.copy-protocol-icon svg {
|
|
width: 0.85em;
|
|
height: 0.85em;
|
|
}
|
|
|
|
.copy-protocol-icon.is-clicked {
|
|
transform: scale(1.2);
|
|
}
|
|
|
|
/* ── Custom Premium Tooltip ── */
|
|
|
|
.copy-protocol-tooltip {
|
|
position: absolute;
|
|
z-index: 10000;
|
|
background-color: var(--background-tooltip, var(--background-secondary-alt, #303030));
|
|
backdrop-filter: blur(8px);
|
|
-webkit-backdrop-filter: blur(8px);
|
|
color: var(--text-normal);
|
|
border: 1px solid var(--border-color, var(--background-modifier-border, #444444));
|
|
border-radius: 6px;
|
|
padding: 6px 12px;
|
|
font-size: 12px;
|
|
font-family: var(--font-interface);
|
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
|
pointer-events: none;
|
|
opacity: 0;
|
|
transition: opacity 0.15s ease-in-out, transform 0.15s ease-in-out;
|
|
transform: translateY(5px);
|
|
white-space: nowrap;
|
|
max-width: 350px;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
}
|
|
|
|
.copy-protocol-tooltip.is-visible {
|
|
opacity: 1;
|
|
transform: translateY(0);
|
|
}
|
|
|