mirror of
https://github.com/max-fluff/obsidian-heading-linker.git
synced 2026-07-22 08:35:13 +00:00
320 lines
7.7 KiB
CSS
320 lines
7.7 KiB
CSS
/* Heading Linker 1.2.1 — assembled from the shared styles and src/styles.css by "npm run build". Do not edit directly. */
|
|
|
|
/* Styles every linker plugin uses. The token below stands for the plugin class prefix;
|
|
build.mjs substitutes it when it assembles styles.css. See CONTRIBUTING.md. */
|
|
|
|
.heading-preview-table {
|
|
width: 100%;
|
|
border-collapse: collapse;
|
|
font-size: var(--font-ui-small);
|
|
}
|
|
|
|
.heading-preview-buttons {
|
|
display: flex;
|
|
gap: 8px;
|
|
justify-content: flex-end;
|
|
margin-top: 16px;
|
|
}
|
|
|
|
.heading-folder-row .setting-item-name {
|
|
font-family: var(--font-monospace);
|
|
font-size: var(--font-ui-smaller);
|
|
overflow-wrap: anywhere;
|
|
}
|
|
|
|
.heading-folder-add {
|
|
display: flex;
|
|
gap: 8px;
|
|
margin: 6px 0 18px 1.5em;
|
|
}
|
|
|
|
.heading-folder-input {
|
|
flex: 1 1 auto;
|
|
min-width: 0;
|
|
}
|
|
|
|
.heading-folder-addbtn {
|
|
display: flex;
|
|
flex: 0 0 auto;
|
|
align-items: center;
|
|
justify-content: center;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.heading-folder-addbtn svg {
|
|
width: 16px;
|
|
height: 16px;
|
|
}
|
|
|
|
/* Priority order among the installed linker plugins. Our own row is the movable one, so
|
|
it is the one that reads as active; the others are context. */
|
|
.heading-precedence-list {
|
|
margin: 0 0 18px 1.5em;
|
|
}
|
|
|
|
.heading-precedence-list .setting-item {
|
|
border-top: none;
|
|
/* Padding matches the folder-list rows, so this nested list lines up with the other one in the same pane: text off the left edge, arrows level with the remove buttons. */ padding: 4px 6px 4px 0.75em;
|
|
}
|
|
|
|
.heading-precedence-list .setting-item-name {
|
|
color: var(--text-muted);
|
|
}
|
|
|
|
.heading-precedence-self .setting-item-name {
|
|
color: var(--text-normal);
|
|
font-weight: var(--font-semibold);
|
|
}
|
|
|
|
/* Styles both prose linkers use. The plugin class prefix is substituted by build.mjs. */
|
|
|
|
.heading-link,
|
|
.cm-heading-link {
|
|
color: var(--heading-link-color, var(--link-color));
|
|
text-decoration: none;
|
|
border-bottom: 1px var(--heading-underline-style, dotted) var(--heading-link-color, var(--link-color));
|
|
cursor: pointer;
|
|
}
|
|
|
|
/* Reading view builds the match as a real <a> so hover preview and click behave like any
|
|
link — and a theme underlines links, which lands a second line under our own. Ours is the
|
|
one carrying the underline-style setting, so the anchor's own decoration is switched off
|
|
here, at a specificity a theme's `.markdown-rendered a` rule can't outrank. */
|
|
a.heading-link,
|
|
a.heading-link:hover,
|
|
a.heading-link.internal-link,
|
|
a.heading-link.internal-link:hover {
|
|
text-decoration: none;
|
|
}
|
|
|
|
.heading-link:hover,
|
|
.cm-heading-link:hover {
|
|
color: var(--link-color-hover);
|
|
border-bottom-style: solid;
|
|
}
|
|
|
|
.heading-ambiguous,
|
|
.cm-heading-ambiguous {
|
|
border-bottom-width: 3px;
|
|
border-bottom-style: var(--heading-ambiguous-underline-style, double);
|
|
}
|
|
|
|
.heading-ambiguous:hover,
|
|
.cm-heading-ambiguous:hover {
|
|
border-bottom-width: 3px;
|
|
border-bottom-style: var(--heading-ambiguous-underline-style, double);
|
|
}
|
|
|
|
/* Autocomplete suggestion rows */
|
|
.heading-suggestion {
|
|
display: flex;
|
|
align-items: baseline;
|
|
gap: 8px;
|
|
}
|
|
|
|
.heading-suggestion-note {
|
|
color: var(--text-muted);
|
|
font-size: var(--font-ui-smaller);
|
|
margin-left: auto;
|
|
}
|
|
|
|
/* Per-word collision resolver in the "turn into links" preview */
|
|
.heading-term-select {
|
|
max-width: 16em;
|
|
}
|
|
|
|
.heading-ambiguous-row td {
|
|
vertical-align: middle;
|
|
}
|
|
|
|
.heading-resolve-panel {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 6px;
|
|
margin: 4px 0 12px;
|
|
padding: 8px 10px;
|
|
border: 1px solid var(--background-modifier-border);
|
|
border-radius: var(--radius-s);
|
|
}
|
|
|
|
.heading-resolve-row {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
}
|
|
|
|
.heading-resolve-word {
|
|
font-weight: var(--font-semibold);
|
|
min-width: 8em;
|
|
}
|
|
|
|
/* Choose-a-term (collision resolution) dialog */
|
|
.heading-choose-list {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 6px;
|
|
margin: 8px 0;
|
|
}
|
|
|
|
/* A button, so it arrives with Obsidian's own layout: inline-flex puts the caption beside the
|
|
title, nowrap keeps a long title from breaking, and the fixed control height clips whatever
|
|
wraps anyway. A row here is a block of text, not a control. */
|
|
.heading-choose-item {
|
|
display: block;
|
|
box-sizing: border-box;
|
|
width: 100%;
|
|
height: auto;
|
|
text-align: left;
|
|
white-space: normal;
|
|
overflow-wrap: anywhere;
|
|
}
|
|
|
|
.heading-preview-table td,
|
|
.heading-preview-table th {
|
|
border-bottom: 1px solid var(--background-modifier-border);
|
|
padding: 4px 8px;
|
|
text-align: left;
|
|
vertical-align: top;
|
|
}
|
|
|
|
.heading-preview-file {
|
|
font-weight: var(--font-semibold);
|
|
margin: 10px 0 4px;
|
|
}
|
|
|
|
.heading-preview-empty {
|
|
color: var(--text-muted);
|
|
padding: 12px 0;
|
|
}
|
|
|
|
.heading-section-desc {
|
|
color: var(--text-muted);
|
|
font-size: var(--font-ui-small);
|
|
margin: 4px 0 14px;
|
|
}
|
|
|
|
/* Language rows share the folder-row indent below, so both nested lists in the
|
|
pane line up. */
|
|
.heading-lang-row.setting-item {
|
|
border-top: none;
|
|
margin-left: 1.5em;
|
|
padding: 6px 6px 6px 0.75em;
|
|
border-left: 2px solid var(--background-modifier-border);
|
|
}
|
|
|
|
.heading-lang-error {
|
|
color: var(--text-error);
|
|
}
|
|
|
|
/* Scoped to our own rows: `.setting-item.mod-warning` on its own would restyle the warning
|
|
rows in every other plugin's settings too. */
|
|
.heading-lang-row.mod-warning .extra-setting-button {
|
|
color: var(--text-error);
|
|
opacity: 1;
|
|
}
|
|
|
|
/* Folder-set editor. Each chosen path is a compact indented row (matching the
|
|
language-row treatment so the pane reads as one list style); a full-width input
|
|
with autocomplete and an add button sits below the list. */
|
|
.heading-folder-rows:not(:empty) {
|
|
margin: 6px 0;
|
|
}
|
|
|
|
.heading-folder-row.setting-item {
|
|
border-top: none;
|
|
padding: 4px 6px 4px 0.75em;
|
|
margin-left: 1.5em;
|
|
border-left: 2px solid var(--background-modifier-border);
|
|
}
|
|
|
|
/* The list of what a word could mean, shown on hover over an ambiguous span. Hovering a
|
|
row opens Obsidian own page preview for that one target, so this stays a plain list. */
|
|
.heading-choices {
|
|
position: fixed;
|
|
z-index: var(--layer-popover);
|
|
max-width: 320px;
|
|
padding: 6px;
|
|
border: 1px solid var(--background-modifier-border);
|
|
border-radius: var(--radius-m);
|
|
background: var(--background-primary);
|
|
box-shadow: var(--shadow-s);
|
|
}
|
|
|
|
.heading-choices.heading-hidden {
|
|
display: none;
|
|
}
|
|
|
|
.heading-choices-title {
|
|
padding: 2px 8px 6px;
|
|
color: var(--text-muted);
|
|
font-size: var(--font-ui-smaller);
|
|
}
|
|
|
|
.heading-choices-item {
|
|
padding: 4px 8px;
|
|
border-radius: var(--radius-s);
|
|
cursor: pointer;
|
|
overflow-wrap: anywhere;
|
|
}
|
|
|
|
.heading-choices-item:hover {
|
|
background: var(--background-modifier-hover);
|
|
}
|
|
|
|
/* Second line of a candidate row: what tells this meaning from the one under it — the kind,
|
|
and the note it lives in. Muted and small so the meanings still scan as a list. */
|
|
.heading-choices-item-note,
|
|
.heading-choose-item-note {
|
|
color: var(--text-muted);
|
|
font-size: var(--font-ui-smaller);
|
|
}
|
|
|
|
/* @settings
|
|
|
|
name: Heading Linker
|
|
id: heading-linker
|
|
settings:
|
|
-
|
|
id: heading-link-color
|
|
title: Highlight color
|
|
description: Color of heading-term highlights. Leave at default to follow the theme's link color.
|
|
type: variable-themed-color
|
|
format: hex
|
|
opacity: false
|
|
default-light: '#705dcf'
|
|
default-dark: '#a68cff'
|
|
-
|
|
id: heading-underline-style
|
|
title: Underline style
|
|
type: variable-select
|
|
default: dotted
|
|
options:
|
|
- dotted
|
|
- solid
|
|
- dashed
|
|
- double
|
|
- none
|
|
-
|
|
id: heading-ambiguous-underline-style
|
|
title: Ambiguous-term underline style
|
|
description: Underline for words that match more than one heading.
|
|
type: variable-select
|
|
default: double
|
|
options:
|
|
- double
|
|
- dotted
|
|
- dashed
|
|
- solid
|
|
|
|
*/
|
|
|
|
/* Heading-level (H1..H6) checkbox row in settings */
|
|
.heading-level-check {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 4px;
|
|
margin-left: 10px;
|
|
cursor: pointer;
|
|
}
|
|
|
|
/* Heading Linker 1.2.1 */
|