mirror of
https://github.com/cetrodk/obsidian-inline-annotations.git
synced 2026-07-22 15:00:27 +00:00
- Remove unnecessary type assertions flagged by Obsidian linter - Extract getAnnotationTarget helper to avoid double-casting - Replace element.style.visibility with CSS class toggling - Use setCssProps for popup positioning instead of inline styles
121 lines
2.4 KiB
CSS
121 lines
2.4 KiB
CSS
.inline-annotation {
|
|
color: var(--text-accent);
|
|
border-bottom: 1px dotted var(--text-accent);
|
|
cursor: pointer;
|
|
transition: opacity 150ms ease;
|
|
}
|
|
|
|
.inline-annotation:hover {
|
|
opacity: 0.8;
|
|
}
|
|
|
|
.annotation-popup {
|
|
position: fixed;
|
|
top: var(--popup-top);
|
|
left: var(--popup-left);
|
|
z-index: var(--layer-popover);
|
|
background: color-mix(in srgb, var(--interactive-accent) 12%, var(--background-primary));
|
|
border: 1px solid var(--interactive-accent);
|
|
border-radius: 8px;
|
|
padding: 10px 16px;
|
|
font-size: var(--font-ui-medium);
|
|
line-height: 1.5;
|
|
color: var(--text-normal);
|
|
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
|
|
max-width: 320px;
|
|
transform: translateX(-50%);
|
|
animation: annotation-fade-in 100ms ease;
|
|
}
|
|
|
|
.annotation-popup.is-hidden {
|
|
visibility: hidden;
|
|
}
|
|
|
|
.annotation-popup-textarea {
|
|
width: 100%;
|
|
min-width: 240px;
|
|
background: transparent;
|
|
border: none;
|
|
outline: none;
|
|
resize: none;
|
|
font-family: inherit;
|
|
font-size: inherit;
|
|
line-height: inherit;
|
|
color: var(--text-normal);
|
|
padding: 0;
|
|
margin: 0;
|
|
field-sizing: content;
|
|
max-height: 200px;
|
|
overflow-y: auto;
|
|
cursor: default;
|
|
}
|
|
|
|
.annotation-popup-buttons {
|
|
display: flex;
|
|
gap: 6px;
|
|
margin-top: 6px;
|
|
}
|
|
|
|
.annotation-popup-btn {
|
|
flex: 1;
|
|
padding: 4px 8px;
|
|
background: transparent;
|
|
border: 1px solid var(--text-faint);
|
|
border-radius: 4px;
|
|
color: var(--text-muted);
|
|
font-size: var(--font-ui-small);
|
|
cursor: pointer;
|
|
transition: color 150ms ease, border-color 150ms ease;
|
|
}
|
|
|
|
.annotation-popup-btn:hover {
|
|
color: var(--text-normal);
|
|
border-color: var(--text-normal);
|
|
}
|
|
|
|
.annotation-popup-btn-danger:hover {
|
|
color: var(--text-error);
|
|
border-color: var(--text-error);
|
|
}
|
|
|
|
.annotation-modal-textarea {
|
|
width: 100%;
|
|
min-height: 120px;
|
|
resize: vertical;
|
|
background: var(--background-modifier-form-field);
|
|
border: 1px solid var(--background-modifier-border);
|
|
border-radius: 4px;
|
|
padding: 8px;
|
|
font-family: inherit;
|
|
font-size: var(--font-ui-medium);
|
|
line-height: 1.5;
|
|
color: var(--text-normal);
|
|
margin-top: 8px;
|
|
}
|
|
|
|
.annotation-modal-textarea:focus {
|
|
border-color: var(--interactive-accent);
|
|
outline: none;
|
|
}
|
|
|
|
.annotation-modal-buttons {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 12px;
|
|
margin-top: 12px;
|
|
}
|
|
|
|
.annotation-modal-hint {
|
|
color: var(--text-muted);
|
|
}
|
|
|
|
@keyframes annotation-fade-in {
|
|
from {
|
|
opacity: 0;
|
|
transform: translateX(-50%) translateY(4px);
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
transform: translateX(-50%) translateY(0);
|
|
}
|
|
}
|