Файли
openidea/src/features/plugins/decorations.module.css
T
Charlie.Weiтаcharli117 00f482a7cc feat(plugins): Markdown hover cards for editor decorations (API 1.16) (#2622)
decorations.set-markdown (API 1.16) draws the same line-end labels as decorations.set and shows each item's markdown_hover as a hover card on the label or the decorated text. The card renders through the shared Markdown path (marked + DOMPurify, media and resource attributes stripped), uses the editor's hover styling, can be resized from its edges, and closes on Escape, an outside click, window blur or leaving the window. Set ids, the 10,000-item and 4 MiB limits and clear are shared with set. SDK: host::set_markdown_decorations and MarkdownDecoration, with a decorations fixture plugin.

Co-authored-by: charli117 <[email protected]>
2026-11-25 03:57:00 +08:00

110 рядки
2.9 KiB
CSS

.highlight,
.search,
.added,
.modified,
.removed {
background-color: var(--plugin-mark-bg);
background: linear-gradient(var(--plugin-mark-bg), var(--plugin-mark-bg)) center / 100% 1lh no-repeat;
-webkit-box-decoration-break: clone;
box-decoration-break: clone;
}
.highlight {
--plugin-mark-bg: var(--accent-soft);
}
.search {
--plugin-mark-bg: var(--bg-search-match);
color: var(--fg-search-match);
}
.added {
--plugin-mark-bg: color-mix(in srgb, var(--vcs-added) 18%, transparent);
}
.modified {
--plugin-mark-bg: color-mix(in srgb, var(--vcs-modified) 18%, transparent);
}
.removed {
--plugin-mark-bg: color-mix(in srgb, var(--vcs-deleted) 18%, transparent);
}
.warning {
text-decoration: underline wavy var(--warning);
}
.error {
text-decoration: underline wavy var(--danger);
}
.info {
text-decoration: underline dotted var(--info);
}
.typo {
text-decoration: underline wavy var(--wave-typo, var(--success));
}
.weak {
color: var(--fg-weak-warning);
}
.underline {
text-decoration: underline;
}
.strikethrough {
text-decoration: line-through;
}
.muted {
color: var(--fg-muted);
}
/* A zero-width anchor at the line end with the message in an absolutely positioned inner box,
the way the code-vision hint is drawn: the annotation takes no part in the line's flow, so it
neither stretches the line nor moves the caret at the line end. The message's own offset is a
custom property: the blame steps past the message by measuring this inner box plus that
offset (inlineBlame.ts). */
.after {
--openidea-message-offset: var(--space-2);
display: inline-block;
width: 0;
position: relative;
line-height: 1;
user-select: none;
}
.afterInner {
position: absolute;
left: var(--openidea-message-offset);
bottom: -2px;
white-space: pre;
color: var(--fg-muted);
/* No width cap and no overflow: a descender (g, y, p) would be clipped by a
line-height-1 box, and a long message simply runs past the editor's edge,
where the scroller clips it — the way IDEA paints line-end inlays. */
pointer-events: auto;
}
/* Inline text follows the scheme's Error / Warning colours, the way Inspection Lens
colours an annotation. The message span carries the severity class, and the line-end
text itself is never underlined: the wave belongs to the code token. */
.after .error {
color: var(--wave-error);
text-decoration: none;
}
.after .warning {
color: var(--wave-warning);
text-decoration: none;
}
.after .info {
color: var(--info, var(--fg-weak-warning));
text-decoration: none;
}
.after .typo {
color: var(--wave-typo, var(--success));
text-decoration: none;
}
.after .weak {
color: var(--fg-weak-warning);
text-decoration: none;
}
.after .underline,
.after .strikethrough {
text-decoration: none;
}
/* A highlighted label carries emphasis; the range background stays on the text. */
.after .highlight {
background: none;
color: var(--accent);
font-weight: 600;
}