tfrere's picture
tfrere HF Staff
fix inline glossary issues
6c9bb4f
raw
history blame
4.53 kB
/* ============================================================================ */
/* Glossary Component */
/* ============================================================================ */
.glossary-container {
display: inline;
position: relative;
}
.glossary-term {
display: inline;
color: var(--primary-color) !important;
text-decoration: none !important;
background: color-mix(in srgb, var(--primary-color) 15%, transparent);
border-bottom: 1px dashed color-mix(in srgb, var(--primary-color) 100%, transparent) !important;
cursor: help;
transition: all 0.2s ease;
border-radius: 3px;
padding: 2px 6px;
}
.glossary-term:hover,
.glossary-term:focus {
color: var(--primary-color-hover) !important;
text-decoration: none !important;
background: color-mix(in srgb, var(--primary-color) 20%, transparent);
outline: none;
}
.glossary-term:focus {
box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary-color) 20%, transparent);
}
.glossary-tooltip {
position: fixed;
top: -9999px;
left: -9999px;
z-index: var(--z-tooltip);
opacity: 0;
transform: translateY(-4px);
transition: opacity 0.2s ease, transform 0.2s ease;
pointer-events: none;
max-width: 300px;
min-width: 200px;
visibility: hidden;
}
.glossary-tooltip.is-visible {
visibility: visible;
opacity: 1;
transform: translateY(0);
pointer-events: auto;
}
.glossary-tooltip__content {
display: block;
background: var(--surface-bg);
border: 1px solid var(--border-color);
border-radius: 8px;
padding: 12px 16px;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
backdrop-filter: saturate(1.12) blur(8px);
}
.glossary-tooltip__term {
display: block;
font-weight: 600;
font-size: 14px;
color: var(--primary-color);
margin-bottom: 4px;
line-height: 1.3;
}
.glossary-tooltip__definition {
display: block;
font-size: 13px;
color: var(--text-color);
line-height: 1.4;
margin: 0;
}
.glossary-tooltip__arrow {
display: block;
position: absolute;
width: 0;
height: 0;
border: 6px solid transparent;
}
/* Arrow positioning */
.glossary-tooltip[data-position="top"] .glossary-tooltip__arrow {
bottom: -6px;
left: 50%;
transform: translateX(-50%);
border-top-color: var(--border-color);
}
.glossary-tooltip[data-position="top"] .glossary-tooltip__arrow::after {
content: '';
position: absolute;
top: -7px;
left: -6px;
border: 6px solid transparent;
border-top-color: var(--surface-bg);
}
.glossary-tooltip[data-position="bottom"] .glossary-tooltip__arrow {
top: -6px;
left: 50%;
transform: translateX(-50%);
border-bottom-color: var(--border-color);
}
.glossary-tooltip[data-position="bottom"] .glossary-tooltip__arrow::after {
content: '';
position: absolute;
top: -5px;
left: -6px;
border: 6px solid transparent;
border-bottom-color: var(--surface-bg);
}
.glossary-tooltip[data-position="left"] .glossary-tooltip__arrow {
right: -6px;
top: 50%;
transform: translateY(-50%);
border-left-color: var(--border-color);
}
.glossary-tooltip[data-position="left"] .glossary-tooltip__arrow::after {
content: '';
position: absolute;
top: -6px;
left: -7px;
border: 6px solid transparent;
border-left-color: var(--surface-bg);
}
.glossary-tooltip[data-position="right"] .glossary-tooltip__arrow {
left: -6px;
top: 50%;
transform: translateY(-50%);
border-right-color: var(--border-color);
}
.glossary-tooltip[data-position="right"] .glossary-tooltip__arrow::after {
content: '';
position: absolute;
top: -6px;
left: -5px;
border: 6px solid transparent;
border-right-color: var(--surface-bg);
}
/* Mode sombre */
[data-theme="dark"] .glossary-tooltip__content {
background: var(--surface-bg);
border-color: var(--border-color);
}
[data-theme="dark"] .glossary-tooltip__term {
color: var(--primary-color);
}
[data-theme="dark"] .glossary-tooltip__definition {
color: var(--text-color);
}
/* Responsive - hide on mobile if disabled */
@media (max-width: 768px) {
.glossary-term[data-glossary-disable-mobile="true"] {
border-bottom: none;
color: inherit;
cursor: default;
}
.glossary-term[data-glossary-disable-mobile="true"]:hover,
.glossary-term[data-glossary-disable-mobile="true"]:focus {
background: none;
color: inherit;
border-bottom: none;
}
}
/* Accessibility improvement */
@media (prefers-reduced-motion: reduce) {
.glossary-tooltip {
transition: none;
}
.glossary-term {
transition: none;
}
}