mirror of
https://github.com/chetscmd/Hover-Tooltips-Obsidian.git
synced 2026-07-22 06:43:03 +00:00
Update styles.css
This commit is contained in:
parent
355822aa96
commit
bcfcb09d3f
1 changed files with 83 additions and 18 deletions
101
styles.css
101
styles.css
|
|
@ -1,37 +1,102 @@
|
|||
.tooltip-word {
|
||||
position: relative;
|
||||
cursor: help;
|
||||
border-bottom: 2px dotted var(--text-muted);
|
||||
transition: color 0.25s ease, border-color 0.25s ease;
|
||||
display: inline;
|
||||
text-decoration-line: underline;
|
||||
text-decoration-style: dotted;
|
||||
text-decoration-color: var(--text-muted);
|
||||
text-decoration-thickness: 2px;
|
||||
text-underline-offset: 3px;
|
||||
text-decoration-skip-ink: none;
|
||||
transition: color 0.25s ease, text-decoration-color 0.25s ease;
|
||||
}
|
||||
|
||||
.tooltip-word:hover {
|
||||
color: var(--text-accent);
|
||||
border-color: var(--text-accent);
|
||||
text-decoration-color: var(--text-accent);
|
||||
}
|
||||
|
||||
.tooltip-text {
|
||||
position: fixed;
|
||||
z-index: 2147483647;
|
||||
visibility: hidden;
|
||||
opacity: 0;
|
||||
width: max-content;
|
||||
max-width: 300px;
|
||||
background-color: var(--background-secondary);
|
||||
max-width: 400px;
|
||||
min-width: 150px;
|
||||
background-color: var(--background-primary);
|
||||
color: var(--text-normal);
|
||||
text-align: left;
|
||||
border-radius: 8px;
|
||||
padding: 8px 10px;
|
||||
position: absolute;
|
||||
z-index: 100;
|
||||
bottom: 125%;
|
||||
left: 50%;
|
||||
transform: translateX(-50%) translateY(5px);
|
||||
box-shadow: 0 8px 15px rgba(0, 0, 0, 0.25);
|
||||
border-radius: 10px;
|
||||
padding: 12px 14px;
|
||||
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3), 0 0 0 1px var(--background-modifier-border);
|
||||
transition: opacity 0.3s ease, transform 0.3s ease;
|
||||
font-size: 0.9em;
|
||||
font-size: 1em;
|
||||
line-height: 1.4;
|
||||
white-space: normal;
|
||||
word-wrap: break-word;
|
||||
transform-origin: bottom center;
|
||||
user-select: text;
|
||||
-webkit-user-select: text;
|
||||
-moz-user-select: text;
|
||||
-ms-user-select: text;
|
||||
}
|
||||
|
||||
.tooltip-word:hover .tooltip-text {
|
||||
.tooltip-text.visible {
|
||||
visibility: visible;
|
||||
opacity: 1;
|
||||
transform: translateX(-50%) translateY(0);
|
||||
}
|
||||
transform: translateY(-5px);
|
||||
}
|
||||
|
||||
.tooltip-text a.internal-link {
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
color: var(--text-accent);
|
||||
font-weight: 500;
|
||||
user-select: auto;
|
||||
}
|
||||
|
||||
.tooltip-text a.external-link {
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
color: var(--text-accent-hover);
|
||||
font-weight: 500;
|
||||
user-select: auto;
|
||||
}
|
||||
|
||||
.tooltip-text a.internal-link:hover,
|
||||
.tooltip-text a.external-link:hover {
|
||||
text-decoration: underline;
|
||||
text-decoration-thickness: 2px;
|
||||
}
|
||||
|
||||
.tooltip-text code {
|
||||
background-color: var(--background-secondary);
|
||||
padding: 2px 4px;
|
||||
border-radius: 4px;
|
||||
font-family: var(--font-monospace);
|
||||
font-size: 0.9em;
|
||||
user-select: text;
|
||||
}
|
||||
|
||||
.tooltip-text strong {
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.tooltip-text em {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.tooltip-text mark {
|
||||
background-color: var(--text-highlight-bg);
|
||||
color: var(--text-normal);
|
||||
padding: 1px 2px;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.tooltip-text {
|
||||
max-width: 280px;
|
||||
font-size: 0.95em;
|
||||
padding: 10px 12px;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue