Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
.attribute-list-panel {
display: flex;
flex-direction: column;
}
/* The card takes the focus when it is pressed, which is how the copy and paste keys reach the panel
(see AttributeList.tsx) — a way in rather than a place to arrive at, so it is not drawn as focused:
the rows picked out are what says where those keys will land. */
.attribute-list-panel:focus,
.attribute-list-panel:focus-visible {
outline: none;
}
.attribute-list-panel ul.attribute-rows {
margin: 0;
padding-inline-start: 0;
list-style: none;
}
.attribute-list-panel .attribute-row {
/* What the floating action buttons — and, while editing, the overlay — are anchored to. */
position: relative;
display: flex;
align-items: center;
gap: 6px;
padding: 3px 4px;
border-radius: var(--border-radius-size, 4px);
cursor: pointer;
/* A row stands for its attribute rather than spelling it out, so nothing wraps: the name and the
value are cut off instead, and the popup the row opens has them in full. */
white-space: nowrap;
overflow: hidden;
/* A row is pressed rather than read from, and a press that draws a range would otherwise take
the text between the two rows along with them. The popup has the attribute in full to copy
from, and the attributes editor is the surface its text is read off. */
user-select: none;
}
.attribute-list-panel .attribute-row:hover,
.attribute-list-panel .attribute-row.active,
.attribute-list-panel .attribute-row.editing {
background-color: var(--hover-item-background-color);
}
.attribute-list-panel .attribute-row.selected,
.attribute-list-panel .attribute-row.selected:hover {
background-color: var(--selection-background-color);
}
.attribute-list-panel .attribute-row.selected:has(+ .attribute-row.selected) {
border-end-start-radius: 0;
border-end-end-radius: 0;
}
.attribute-list-panel .attribute-row.selected + .attribute-row.selected {
border-start-start-radius: 0;
border-start-end-radius: 0;
}
/* While its value is edited (or the attribute created), the row lets the editor standing over it
(see AttributeEditorOverlay.css) spill past the one line the row keeps to, and comes forward so
the editor is drawn over the rows below rather than under them. */
.attribute-list-panel .attribute-row.editing {
overflow: visible;
z-index: 10;
}
/*
* The checkbox a row is picked out by, standing in the slot the kind icon holds rather than in a
* column of its own: the pane is narrow, and a column would take from the names what it took for
* itself. Only the row being pointed at shows one — until rows are being picked out, when every row
* shows its own, the way a list of mail turns over once one of it is picked.
*/
.attribute-list-panel .attribute-kind-check {
position: absolute;
inset: 0;
display: none;
align-items: center;
justify-content: center;
}
.attribute-list-panel.selecting .attribute-kind-check {
display: flex;
}
.attribute-list-panel .attribute-kind-check .tn-checkbox {
--box-size: 13px;
--box-label-gap: 0px;
display: block;
width: var(--box-size);
height: var(--box-size);
margin: 0;
cursor: pointer;
}
/* The kind icon and its badge give way to the checkbox, hidden rather than removed so the slot keeps
its width. */
.attribute-list-panel.selecting .attribute-kind:has(.attribute-kind-check) > .tn-icon {
visibility: hidden;
}
.attribute-list-panel.selecting .attribute-kind:has(.attribute-kind-check)::after {
display: none;
}
/* A touch screen keeps `:hover` on the last row tapped. */
@media (hover: hover) {
.attribute-list-panel .attribute-row:hover .attribute-kind-check {
display: flex;
}
.attribute-list-panel .attribute-row:hover .attribute-kind:has(.attribute-kind-check) > .tn-icon {
visibility: hidden;
}
.attribute-list-panel .attribute-row:hover .attribute-kind:has(.attribute-kind-check)::after {
display: none;
}
}
/* A fixed height, so that a selection starting or ending does not move the cards below. Sticky so that
it stays in view on a phone, where the whole sheet scrolls. */
.attribute-toolbar {
position: sticky;
top: 0;
z-index: 1;
flex-shrink: 0;
display: flex;
align-items: center;
gap: 2px;
height: 34px;
padding-inline: 4px;
border-bottom: 1px solid var(--main-border-color);
background-color: var(--main-background-color);
--icon-button-size: 26px;
.form-checkbox {
padding-inline-start: 4px;
label {
margin: 0;
color: var(--muted-text-color);
font-size: 0.85em;
white-space: nowrap;
}
}
.attribute-toolbar-read-only {
display: flex;
align-items: center;
gap: 6px;
padding-inline: 4px;
color: var(--muted-text-color);
font-size: 0.85em;
white-space: nowrap;
}
.attribute-toolbar-actions {
display: flex;
align-items: center;
gap: 2px;
margin-inline-start: auto;
}
}
/* The toolbar continues the pane's header, so the header's rule moves below the toolbar. */
#right-pane:has(> .right-pane-tab-body:not(.hidden-ext) > .attribute-toolbar) > .right-pane-header {
border-bottom: 0;
}
/* The card titles are uppercase and letter-spaced; the count is not. */
.attribute-run-count {
margin-inline-start: 6px;
padding: 0.1em 0.5em;
border-radius: 0.5em;
color: var(--muted-text-color);
font-size: 0.7rem;
font-weight: normal;
letter-spacing: 0;
text-transform: none;
vertical-align: middle;
}
/* What separates the note's own vocabulary from the names Trilium reads for itself. Quiet: the sort is
what carries the split, the rule only marks where it falls. */
.attribute-list-panel .attribute-rows-divider {
margin: 4px 4px 5px;
border: none;
border-top: 1px solid var(--main-border-color);
opacity: 0.6;
}
.attribute-list-panel .attribute-name {
flex-shrink: 0;
max-width: 65%;
overflow: hidden;
text-overflow: ellipsis;
font-weight: 500;
}
.attribute-list-panel .attribute-value {
flex: 1;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
color: var(--muted-text-color);
/* A step below the name it follows: the value is the preview, not the point, and drawn smaller
it fits more of itself into the room the row spares it. */
font-size: 0.85em;
}
/* Set against the row's trailing edge rather than trailing the name, so the values line up in a
column of their own: name reads from the one edge, value from the other, and the gap between them
says how much room is left rather than being dead space after every short value. Where the run of
rows asks for it — the two runs of plain attributes, the note's own and the inherited ones (see
AttributeList.tsx); the definitions' summaries keep prose order. */
.attribute-list-panel .attribute-rows.align-values-end .attribute-value {
text-align: end;
}
.attribute-list-panel .attribute-value.empty {
font-style: italic;
opacity: 0.7;
}
/* A label's value is edited in place, so the preview itself is a click target of its own: a text
cursor over it says as much, where the row around it — which opens the popup — points. Not while
rows are being picked out: the whole row picks then, its value and its links along with it, so
nothing on it should offer what it will not do. */
.attribute-list-panel:not(.selecting) .attribute-value.editable {
cursor: text;
}
.attribute-list-panel.selecting .attribute-row :is(a, .attribute-value) {
cursor: pointer;
}
/* A flag's press toggles rather than types (see startValueEdit), and the pointer says so. */
.attribute-list-panel .attribute-value.editable.flag {
cursor: pointer;
}
/* The placeholder holding an empty label's slot open. Hidden rather than left out, so the slot keeps
the height the text gives it, and shown as the row's buttons are: over the row being pointed at,
which is also the only row whose slot could be pressed. */
.attribute-list-panel .attribute-value.value-placeholder {
visibility: hidden;
}
.attribute-list-panel .attribute-row:is(:hover, .active, .editing) .attribute-value.value-placeholder {
visibility: visible;
}
/* The way in at the foot of the list: a ghost of a row, quiet until pointed at — the standing the
table's own add-row keeps. Sized as the values are: an invitation, not an entry. */
.attribute-list-panel .attribute-add-row {
display: flex;
align-items: center;
gap: 6px;
padding: 3px 4px;
border-radius: var(--border-radius-size, 4px);
cursor: pointer;
color: var(--muted-text-color);
font-size: 0.85em;
opacity: 0.75;
}
.attribute-list-panel .attribute-add-row:hover {
background-color: var(--hover-item-background-color);
opacity: 1;
}
/* A colour's chip keeps to its own size: a chip is laid out as a flex box, which alone in the value's
slot would run the width of it, a bar rather than a chip. */
.attribute-list-panel .attribute-value > .label-color-chip {
width: fit-content;
}
/* Being a box rather than text, the chip follows the run's alignment by margin instead. */
.attribute-list-panel .attribute-rows.align-values-end .attribute-value > .label-color-chip {
margin-inline-start: auto;
}
/* A definition's summary: its marks at the leading end, and the alias — the one part the user
wrote — at the trailing edge, where the other cards keep their values. */
.attribute-list-panel .attribute-value.definition {
display: flex;
align-items: center;
gap: 4px;
}
.attribute-list-panel .definition-marker {
flex-shrink: 0;
}
.attribute-list-panel .definition-display-name {
margin-inline-start: auto;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
}
.attribute-list-panel .attribute-marker,
.attribute-list-panel .attribute-owner {
flex-shrink: 0;
color: var(--muted-text-color);
font-size: 0.85em;
}
.attribute-list-panel .attribute-owner {
max-width: 40%;
overflow: hidden;
text-overflow: ellipsis;
}
/* The row's actions — delete, and for a relation the pencil — float over the row's trailing end
instead of reserving room in it; only the row being pointed at shows them. */
.attribute-list-panel .attribute-row-actions {
position: absolute;
inset-inline-end: 1px;
inset-block-start: 50%;
transform: translateY(-50%);
display: none;
align-items: center;
padding-inline-start: 2px;
border-radius: var(--border-radius-size, 4px);
/* A solid stand-in for the hovered row's composite — its hover film is ~a tenth of ink over the
canvas (right-pane cards paint no ground), so the same tenth is mixed from the text colour:
opaque by construction, where the film's own alpha cannot be flattened in CSS. */
background-color: color-mix(in srgb, var(--main-text-color) 9%, var(--main-background-color));
}
/* Not while editing: the actions — later in the DOM — would paint over the very overlay that
replaces them. Nor while rows are being picked out: a row's own actions are about the one row,
which is not what is being done then, and the toolbar carries what is. */
.attribute-list-panel:not(.selecting) .attribute-row:not(.editing):is(:hover, .active) .attribute-row-actions {
display: flex;
}
/* A standing gutter one button wide wherever there are actions at all: the delete cross every such
row carries lands in reserved room, so the value never moves nor is covered. Only a relation's
second button, the pencil, overlays the value's tail — on the cluster's solid ground. */
.attribute-list-panel .attribute-row:has(.attribute-row-actions) .attribute-value {
padding-inline-end: 27px;
}
/* Both at the compact size the theme reserves for close crosses (`.icon-action.bx-x`), which the
trash and the pencil do not get by name. */
.attribute-list-panel .attribute-row-actions .icon-action {
--icon-button-size: 24px;
--icon-button-icon-ratio: 0.8;
border-radius: 50%;
}
/* The red the menus give their trash: deleting is the one destructive press on the row. Stated
from `:root` and with the button's own class doubled on, so as to outweigh the theme's blanket
icon colour (`:root .icon-action:not(...)`) whichever way the stylesheets are ordered. */
:root .attribute-list-panel .attribute-delete-button.icon-action {
color: var(--dropdown-item-icon-destructive-color);
}