mirror of
https://github.com/jldiaz/copy-protocol-plugin.git
synced 2026-07-22 06:56:55 +00:00
30 lines
1.5 KiB
CSS
30 lines
1.5 KiB
CSS
/*
|
|
* Visual indicator for obsidian://copy protocol links.
|
|
*
|
|
* Prepends a clipboard icon (lucide:copy) before the link text using a CSS
|
|
* mask so it inherits the current link color from the active theme.
|
|
* Works in both Reading View and Live Preview.
|
|
*/
|
|
|
|
a[href^="obsidian://copy"]::before {
|
|
content: "";
|
|
display: inline-block;
|
|
width: 0.75em;
|
|
height: 0.75em;
|
|
margin-right: 0.25em;
|
|
vertical-align: middle;
|
|
/* Fills with the link color of the active theme */
|
|
background-color: currentColor;
|
|
/* Lucide "copy" icon as a mask — shape only, color comes from above */
|
|
-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='14' height='14' x='8' y='8' rx='2' ry='2'/%3E%3Cpath d='M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2'/%3E%3C/svg%3E");
|
|
-webkit-mask-size: contain;
|
|
-webkit-mask-repeat: no-repeat;
|
|
mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='14' height='14' x='8' y='8' rx='2' ry='2'/%3E%3Cpath d='M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2'/%3E%3C/svg%3E");
|
|
mask-size: contain;
|
|
mask-repeat: no-repeat;
|
|
}
|
|
|
|
/* Show a "copy" cursor on hover to reinforce the action */
|
|
a[href^="obsidian://copy"]:hover {
|
|
cursor: copy;
|
|
}
|