wenlzhang_obsidian-tag-index/styles.css

568 lines
11 KiB
CSS

/* Tag Index Container */
.tag-index-container {
margin-top: 8px;
display: flex;
flex-direction: column;
gap: 4px;
}
.tag-index-empty-state {
padding: 20px;
text-align: center;
color: var(--text-muted);
font-style: italic;
}
/* Tree structure styling */
.tag-index-tree-item {
position: relative;
}
.tag-index-tree-item-self {
display: flex;
align-items: center;
padding: 4px 8px;
cursor: pointer;
border-radius: 4px;
transition: background-color 0.2s ease;
}
.tag-index-tree-item-self:hover {
background-color: var(--background-secondary-alt);
}
/* Indentation based on level - scalable for unlimited levels */
.tag-index-tree-item[data-level="0"] .tag-index-tree-item-self {
padding-left: 8px;
}
.tag-index-tree-item[data-level="1"] .tag-index-tree-item-self {
padding-left: calc(8px + 16px * 1);
}
.tag-index-tree-item[data-level="2"] .tag-index-tree-item-self {
padding-left: calc(8px + 16px * 2);
}
.tag-index-tree-item[data-level="3"] .tag-index-tree-item-self {
padding-left: calc(8px + 16px * 3);
}
.tag-index-tree-item[data-level="4"] .tag-index-tree-item-self {
padding-left: calc(8px + 16px * 4);
}
.tag-index-tree-item[data-level="5"] .tag-index-tree-item-self {
padding-left: calc(8px + 16px * 5);
}
.tag-index-tree-item[data-level="6"] .tag-index-tree-item-self {
padding-left: calc(8px + 16px * 6);
}
.tag-index-tree-item[data-level="7"] .tag-index-tree-item-self {
padding-left: calc(8px + 16px * 7);
}
.tag-index-tree-item[data-level="8"] .tag-index-tree-item-self {
padding-left: calc(8px + 16px * 8);
}
.tag-index-tree-item[data-level="9"] .tag-index-tree-item-self {
padding-left: calc(8px + 16px * 9);
}
.tag-index-tree-item[data-level="10"] .tag-index-tree-item-self {
padding-left: calc(8px + 16px * 10);
}
/* Connection lines - continuous vertical lines */
.tag-index-tree-item::before {
content: '';
position: absolute;
left: 0;
top: 0;
bottom: 0;
width: 1px;
background: var(--background-modifier-border);
}
.tag-index-tree-item[data-level="1"]::before {
left: calc(4px + 16px * 0.5);
}
.tag-index-tree-item[data-level="2"]::before {
left: calc(4px + 16px * 1.5);
}
.tag-index-tree-item[data-level="3"]::before {
left: calc(4px + 16px * 2.5);
}
.tag-index-tree-item[data-level="4"]::before {
left: calc(4px + 16px * 3.5);
}
.tag-index-tree-item[data-level="5"]::before {
left: calc(4px + 16px * 4.5);
}
.tag-index-tree-item[data-level="6"]::before {
left: calc(4px + 16px * 5.5);
}
.tag-index-tree-item[data-level="7"]::before {
left: calc(4px + 16px * 6.5);
}
.tag-index-tree-item[data-level="8"]::before {
left: calc(4px + 16px * 7.5);
}
.tag-index-tree-item[data-level="9"]::before {
left: calc(4px + 16px * 8.5);
}
.tag-index-tree-item[data-level="10"]::before {
left: calc(4px + 16px * 9.5);
}
/* Only the last child stops the line at its midpoint */
.tag-index-tree-item:last-child::before {
bottom: 50%;
}
/* Extend line through expanded items with children */
.tag-index-tree-item-children:not(.tag-index-display-none) ~ .tag-index-tree-item::before {
top: 0;
}
/* Chevron icon */
.tag-index-tree-item-icon {
display: flex;
align-items: center;
justify-content: center;
width: 16px;
height: 16px;
margin-right: 4px;
flex-shrink: 0;
cursor: pointer;
}
.tag-index-tree-item-icon-placeholder {
width: 16px;
height: 16px;
margin-right: 4px;
flex-shrink: 0;
}
/* Tree item name */
.tag-index-tree-item-name {
flex: 1;
font-size: 14px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
/* Node styling (intermediate paths) */
.tag-index-tree-item-node {
color: var(--text-muted);
font-weight: 400;
}
/* Actual tag styling */
.tag-index-tree-item-tag {
color: var(--text-normal);
font-weight: 500;
}
/* Children container */
.tag-index-tree-item-children {
margin-left: 0;
}
/* Notes section - should be indented relative to the tag */
.tag-index-tag-notes {
margin-top: 4px;
margin-bottom: 4px;
}
/* Indent notes based on their tree level - scalable for unlimited levels */
.tag-index-tag-notes[data-level="0"] {
padding-left: calc(8px + 16px * 0 + 20px);
}
.tag-index-tag-notes[data-level="1"] {
padding-left: calc(8px + 16px * 1 + 20px);
}
.tag-index-tag-notes[data-level="2"] {
padding-left: calc(8px + 16px * 2 + 20px);
}
.tag-index-tag-notes[data-level="3"] {
padding-left: calc(8px + 16px * 3 + 20px);
}
.tag-index-tag-notes[data-level="4"] {
padding-left: calc(8px + 16px * 4 + 20px);
}
.tag-index-tag-notes[data-level="5"] {
padding-left: calc(8px + 16px * 5 + 20px);
}
.tag-index-tag-notes[data-level="6"] {
padding-left: calc(8px + 16px * 6 + 20px);
}
.tag-index-tag-notes[data-level="7"] {
padding-left: calc(8px + 16px * 7 + 20px);
}
.tag-index-tag-notes[data-level="8"] {
padding-left: calc(8px + 16px * 8 + 20px);
}
.tag-index-tag-notes[data-level="9"] {
padding-left: calc(8px + 16px * 9 + 20px);
}
.tag-index-tag-notes[data-level="10"] {
padding-left: calc(8px + 16px * 10 + 20px);
}
.tag-index-notes-list {
display: flex;
flex-direction: column;
gap: 2px;
}
.tag-index-tag-header {
display: flex;
align-items: center;
padding: 4px 12px;
cursor: pointer;
border-radius: 4px;
justify-content: space-between;
}
.tag-index-tag-header:hover {
background-color: var(--background-secondary-alt);
}
.tag-index-collapse-icon {
color: var(--text-muted);
display: flex;
align-items: center;
justify-content: center;
width: 16px;
height: 16px;
margin-right: 4px;
}
.tag-index-tag-name {
display: flex;
align-items: center;
gap: 0px; /* No gap between prefix and label */
flex: 1;
}
.tag-index-tag-prefix {
color: var(--text-muted);
opacity: 0.7;
font-size: 0.9em;
margin-right: 0; /* Ensure no extra margin */
}
.tag-index-tag-label {
color: var(--text-normal);
font-weight: 500;
margin-left: 0; /* Ensure no extra margin */
}
.tag-index-icon {
color: var(--text-accent);
}
/* Header styling */
.tag-index-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 8px;
margin-top: 8px;
margin-bottom: 4px;
}
.tag-index-header-left {
display: flex;
align-items: center;
gap: 6px;
}
.tag-index-sort-button {
color: var(--text-muted);
cursor: pointer;
opacity: 0.7;
transition: opacity 0.2s ease;
display: flex;
align-items: center;
justify-content: center;
padding: 2px;
border-radius: 3px;
}
.tag-index-sort-button:hover {
opacity: 1;
color: var(--text-accent);
background-color: var(--background-modifier-hover);
}
.tag-index-info-icon {
color: var(--text-muted);
cursor: help;
opacity: 0.7;
transition: opacity 0.2s ease;
}
.tag-index-info-icon:hover {
opacity: 1;
color: var(--text-normal);
}
/* Draggable indicator */
.tag-index-draggable {
cursor: grab;
}
.tag-index-draggable:active {
cursor: grabbing;
}
/* Notes container within a tag - OLD STYLE, KEEPING FOR COMPATIBILITY */
.tag-index-tag-notes.legacy {
padding-left: 32px;
margin: 0px 0 4px 0;
border-left: 1px solid var(--background-modifier-border);
}
/* Expanded tag */
.tag-expanded > .tag-index-tag-header {
font-weight: 500;
}
/* Loading indicator */
.tag-index-loading {
padding: 8px;
color: var(--text-muted);
font-style: italic;
font-size: 0.9em;
}
/* Empty note message */
.tag-index-empty-note {
padding: 8px;
color: var(--text-muted);
font-style: italic;
font-size: 0.9em;
}
/* Remove button */
.tag-index-remove-btn {
opacity: 0.6;
cursor: pointer;
transition: opacity 0.2s ease;
display: flex;
align-items: center;
justify-content: center;
}
.tag-index-remove-btn:hover {
opacity: 1;
color: var(--text-error);
}
/* Drag and drop styles */
.tag-being-dragged {
opacity: 0.5;
border: 1px dashed var(--text-accent);
}
.tag-drag-over {
border-top: 2px solid var(--text-accent);
}
/* Notes list */
.tag-index-notes-list {
margin-top: 4px;
display: flex;
flex-direction: column;
gap: 2px;
}
.tag-index-note-item {
position: relative;
padding: 0px 8px;
border-radius: 4px;
display: flex;
flex-direction: column;
gap: 2px;
transition: background-color 0.2s ease;
margin-bottom: 2px;
}
.tag-index-note-item:hover {
background-color: var(--background-secondary-alt);
}
/* Note header contains the file link */
.tag-index-note-header {
display: flex;
align-items: center;
gap: 6px;
}
/* Add a file icon before note names */
.tag-index-note-header::before {
content: '📄';
font-size: 13px;
opacity: 0.6;
flex-shrink: 0;
}
.tag-index-note-link {
text-decoration: none;
color: var(--text-accent-hover);
flex: 1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 14px;
font-weight: 400;
border-bottom: 1px solid transparent;
transition: all 0.2s ease;
}
.tag-index-note-link:hover {
text-decoration: none; /* Prevent double underline */
border-bottom-color: var(--text-accent);
color: var(--text-accent);
}
/* Settings tab styles */
.tag-index-instructions {
background-color: var(--background-secondary);
padding: 16px;
border-radius: 4px;
margin: 12px 0;
}
.tag-index-instructions p {
margin: 8px 0;
line-height: 1.5;
}
/* Slider value display */
.tag-index-slider-value {
display: inline-block;
margin-left: 10px;
padding: 2px 8px;
background-color: var(--background-secondary);
border-radius: 4px;
font-size: 12px;
font-family: var(--font-monospace);
color: var(--text-muted);
min-width: 60px;
text-align: center;
}
/* Display state classes */
.tag-index-display-none {
display: none;
}
.tag-index-display-block {
display: block;
}
/* Line content display */
.tag-index-line-content-container {
margin-left: 20px;
padding-left: 8px;
border-left: 2px solid var(--background-modifier-border);
display: flex;
flex-direction: column;
gap: 4px;
}
.tag-index-line-content {
padding: 6px 8px;
background-color: var(--background-primary-alt);
border-radius: 4px;
border: 1px solid var(--background-modifier-border);
font-size: 13px;
line-height: 1.6;
display: flex;
align-items: flex-start;
gap: 8px;
transition: all 0.2s ease;
}
.tag-index-line-content:hover {
background-color: var(--background-modifier-hover);
border-color: var(--background-modifier-border-hover);
}
/* Clickable line content styling */
.tag-index-line-clickable {
cursor: pointer;
}
.tag-index-line-clickable:hover {
background-color: var(--interactive-hover);
border-color: var(--interactive-accent);
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.tag-index-line-clickable:active {
background-color: var(--interactive-accent);
transform: translateY(1px);
}
.tag-index-line-number {
color: var(--text-faint);
font-family: var(--font-monospace);
font-size: 11px;
flex-shrink: 0;
opacity: 0.8;
min-width: 40px;
text-align: right;
font-weight: 500;
}
.tag-index-line-text {
flex: 1;
color: var(--text-normal);
overflow: hidden;
word-wrap: break-word;
}
/* Ensure proper rendering of markdown in line content */
.tag-index-line-text p {
margin: 0;
display: inline;
}
.tag-index-line-text code {
font-size: 11px;
}
.tag-index-line-text strong {
font-weight: 600;
}
.tag-index-line-text em {
font-style: italic;
}