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
/*
* CKEDITOR
*/
/*
* Toolbar
*/
.ck.ck-toolbar,
.ck.ck-block-toolbar-button,
.ck.ck-color-selector,
.ck-math-form .ck-math-button-row {
--ck-color-toolbar-background: transparent;
--ck-color-button-default-background: transparent;
--ck-color-button-default-hover-background: var(--hover-item-background-color);
--ck-color-button-default-disabled-background: transparent;
--ck-color-button-on-background: transparent;
--ck-color-button-on-hover-background: var(--hover-item-background-color);
--ck-color-button-default-active-background: var(--hover-item-background-color);
--ck-color-split-button-hover-background: var(--ck-editor-toolbar-dropdown-button-open-background);
--ck-border-radius: 6px;
--ck-toolbar-text-font-size: 13px;
}
/* Toolbar button in on state */
.ck.ck-toolbar .ck-button.ck-on:not(.ck-dropdown__button):not(.ck-list-item-button):not(.ck-button_with-text) {
--ck-color-button-on-background: var(--ck-editor-toolbar-button-on-background);
--ck-color-button-on-hover-background:
linear-gradient(var(--hover-item-background-color), var(--hover-item-background-color)),
var(--ck-editor-toolbar-button-on-background);
--ck-color-button-on-active-background: var(--ck-color-button-on-hover-background);
--ck-color-button-on-color: var(--ck-editor-toolbar-button-on-color);
box-shadow: var(--ck-editor-toolbar-button-on-shadow);
}
/* Toolbar button with its dropdown open */
.ck.ck-toolbar .ck-button.ck-dropdown__button {
--ck-color-button-on-background: var(--ck-editor-toolbar-dropdown-button-open-background);
--ck-color-button-on-hover-background:
linear-gradient(var(--hover-item-background-color), var(--hover-item-background-color)),
var(--ck-editor-toolbar-dropdown-button-open-background);
--ck-color-button-on-active-background: var(--ck-color-button-on-hover-background);
--ck-color-button-on-color: currentColor;
}
/* The toolbar show / hide button for the current text block. Unlike the buttons above it, this one
floats free, so its hover and on states need a surface of their own; the hover tint is flattened
onto it. */
:root .ck.ck-block-toolbar-button {
--block-toolbar-button-hover-surface:
linear-gradient(var(--hover-item-background-color), var(--hover-item-background-color)),
var(--main-background-color);
--ck-color-block-toolbar-button: var(--muted-text-color);
--ck-color-button-on-background: var(--main-background-color);
--ck-color-button-default-hover-background: var(--block-toolbar-button-hover-surface);
--ck-color-button-on-hover-background: var(--block-toolbar-button-hover-surface);
--ck-color-button-on-color: var(--ck-editor-toolbar-button-on-color);
z-index: 1600;
}
/* Inside the note, under the sticky formatting toolbar of the popup editor (998). */
:root .block-drag-handle-container .ck.ck-block-toolbar-button {
z-index: auto;
}
:root .ck.block-drag-handle:not(:hover) {
color: var(--main-border-color);
}
:root .ck.ck-toolbar .ck-button:not(.ck-disabled):active {
background-color: var(--hover-item-background-color);
}
:root .ck.ck-block-toolbar-button:active {
background: var(--block-toolbar-button-hover-surface);
}
.ck.ck-toolbar:not([role="radiogroup"]) .ck-button:active:not(.ck-list-item-button):not(.ck-button_with-text):not(.ck-disabled) svg:not(.ck-dropdown__arrow),
.ck.ck-block-toolbar-button:active svg {
transform: scale(.8);
}
/* Disabled button */
:root .classic-toolbar-widget .ck.ck-button.ck-disabled {
opacity: .75;
}
/* Focus visible */
.ck.ck-toolbar,
.ck.ck-block-toolbar-button,
.ck.ck-dropdown__panel,
.ck-math-form .ck-math-button-row {
--ck-focus-ring: 1px solid transparent;
--ck-button-focus-border-color: transparent;
--ck-color-focus-border: var(--input-focus-outline-color);
--ck-focus-outer-shadow: none;
--ck-focus-disabled-outer-shadow: none;
}
.ck.ck-toolbar .ck-button:focus-visible,
.ck.ck-dropdown__panel .ck-button:focus-visible,
.ck-math-form .ck-math-button-row .ck-button:focus-visible {
--ck-focus-ring: 1px solid var(--input-focus-outline-color);
--ck-button-focus-border-color: var(--input-focus-outline-color);
}
/* Remove the border from hovered split arrow button */
.ck.ck-splitbutton:hover > .ck-splitbutton__arrow:not(.ck-disabled)::after {
visibility: collapse;
}
/*
* Dropdowns
*/
/* Dropdown body */
:root .ck.ck-dropdown__panel,
:root .ck.ck-balloon-panel:not(.ck-tooltip) {
--ck-editor-popup-padding: 4px;
--ck-color-panel-background: var(--menu-background-color);
--ck-color-panel-border: var(--ck-editor-popup-border-color);
--ck-rounded-corners-radius: 6px;
box-shadow: 0px 10px 20px rgba(0, 0, 0, var(--dropdown-shadow-opacity));
outline: transparent !important;
border: 1px solid var(--ck-editor-popup-border-color) !important;
border-radius: var(--dropdown-border-radius) !important;
background: var(--menu-background-color) !important;
padding: var(--ck-editor-popup-padding);
}
/*
* Backdrop blur pseudo-element
*
* Since .ck-balloon-panel already uses the :after and :before pseudo-elements, there is no other
* option than using a :before on the children element to apply the backdrop blur.
* This pseudoelement will overflow and cover the entire surface of .ck-balloon-panel.
*/
:root .ck-balloon-panel > .ck-toolbar,
:root .ck-balloon-panel > .ck-balloon-rotator {
position: relative;
}
:root .ck-balloon-panel > .ck-toolbar::before,
:root .ck-balloon-panel > .ck-balloon-rotator::before {
--negative-padding: calc(0px - var(--ck-editor-popup-padding)); /* Compensate the parent's padding */
content: "";
position: absolute;
top: var(--negative-padding);
inset-inline-end: var(--negative-padding);
bottom: var(--negative-padding);
inset-inline-start: var(--negative-padding);
border-radius: var(--dropdown-border-radius);
backdrop-filter: var(--dropdown-backdrop-filter);
z-index: -1;
}
:root .ck.ck-dropdown__panel {
--ck-editor-popup-padding: var(--menu-padding-size);
--ck-button-focus-border-color: transparent;
--ck-focus-outer-shadow: none;
}
:root .ck.ck-dropdown__panel .ck-button:focus-visible {
--ck-button-focus-border-color: var(--input-focus-outline-color);
}
/* Submenu panel */
:root .ck.ck-balloon-panel.ck-dropdown-menu__nested-menu__panel {
--ck-editor-popup-padding: var(--menu-padding-size);
backdrop-filter: var(--dropdown-backdrop-filter);
}
body.background-effects .ck.ck-balloon-panel.ck-dropdown-menu__nested-menu__panel {
--menu-background-color: var(--menu-background-color-no-backdrop);
backdrop-filter: none;
}
/* Inline icon picker: the icon grid scrolls, so it runs to the balloon's edges. */
:root .ck.ck-balloon-panel:has(.icon-picker-balloon) {
--ck-editor-popup-padding: 0px;
}
.ck.ck-balloon-panel .icon-picker-balloon {
border-radius: calc(var(--dropdown-border-radius) - 1px);
overflow: clip;
}
/* Submenu arrow */
:root .ck.ck-button.ck-dropdown-menu-list__nested-menu__button > .ck-dropdown-menu-list__nested-menu__button__arrow {
color: var(--menu-item-arrow-color);
}
/* Dropdown panel containing a toolbar */
:root .ck.ck-dropdown__panel:has(>.ck-toolbar) {
--ck-editor-popup-padding: calc(
var(--menu-padding-size) - var(--ck-spacing-small, var(--ck-spacing-sm))
);
}
/* Bulleted / number list toolbar */
.ck-list-styles-list {
--ck-list-styles-list-padding: var(--ck-spacing-small, var(--ck-spacing-sm));
}
:root ul.ck.ck-list,
:root div.ck.ck-balloon-panel:not(.ck-tooltip) {
border: none;
background: transparent;
}
:root .ck.ck-list {
padding: 0;
}
/* Tooltip */
:root div.ck.ck-balloon-panel.ck-tooltip {
--ck-rounded-corners-radius: var(--tooltip-border-radius);
--ck-balloon-border-width: 0;
--ck-color-panel-background: var(--tooltip-background-color);
--ck-color-tooltip-text: var(--tooltip-foreground-color);
backdrop-filter: var(--tooltip-backdrop-filter);
padding: var(--tooltip-padding);
box-shadow: var(--tooltip-box-shadow);
font-size: var(--tooltip-font-size);
}
/* Dropdown list item */
:root ul.ck.ck-list button.ck-button,
:root .ck.ck-collapsible > button.ck-button {
padding: 2px 16px;
background: transparent;
border-radius: 6px !important;
box-shadow: unset;
}
:root .ck.ck-list__item {
min-width: 10em;
}
/* Menu list item, in a menu with submenus */
:root .ck.ck-dropdown-menu-list {
--ck-color-button-default-hover-background: var(--hover-item-background-color);
--ck-color-list-button-hover-background: var(--hover-item-background-color);
--ck-color-list-button-on-background: var(--hover-item-background-color);
--ck-color-list-button-on-background-focus: var(--hover-item-background-color);
--ck-color-list-button-on-text: var(--hover-item-text-color);
}
/* Item with icon */
:root .ck.ck-button_with-text svg:first-child,
:root .ck.ck-button_with-text > .ck-ai-action-icon {
color: var(--menu-item-icon-color);
}
/* Checked list item */
:root ul.ck.ck-list button.ck-button:hover,
:root ul.ck.ck-list button.ck-button.ck-on:hover,
:root .ck.ck-collapsible > button.ck-button:not(.ck-disabled):hover,
:root .ck.ck-collapsible > button.ck-button:not(.ck-disabled):not(:focus):hover {
background: var(--hover-item-background-color);
color: var(--hover-item-color);
}
/* List item checkmark container */
:root .ck.ck-list-item-button .ck.ck-list-item-button__check-holder {
margin-inline-start: var(--ck-spacing-small, var(--ck-spacing-sm));
margin-inline-end: var(--menu-padding-size);
}
:root .ck.ck-list-item-button .ck-list-item-button__check-holder svg {
transform: scale(1.2);
color: var(--menu-item-icon-color);
}
/* Separator */
:root .ck .ck-list__separator {
flex-shrink: 0;
margin: .5em 0;
margin-inline-start: calc(0px - var(--ck-editor-popup-padding));
width: calc(100% + (var(--ck-editor-popup-padding) * 2));
background: var(--menu-item-delimiter-color);
}
:root .ck.ck-list {
--ck-list-divider-color: var(--menu-item-delimiter-color);
}
/* Collapsible section */
div.ck.ck-collapsible {
position: relative;
border: unset !important;
padding-top: var(--ck-editor-popup-padding);
}
.ck.ck-collapsible::before {
/* Adds a background shade which overlaps the dropdown's padding */
--negative-padding: calc(0px - var(--ck-editor-popup-padding));
display: block;
content: "";
position: absolute;
top: 0;
bottom: var(--negative-padding);
inset-inline-start: var(--negative-padding);
inset-inline-end: var(--negative-padding);
border-top: 1px solid var(--ck-editor-popup-border-color);
background: var(--menu-section-background-color);
}
.ck.ck-collapsible:last-child::before {
border-radius: 0 0 var(--dropdown-border-radius) var(--dropdown-border-radius);
}
.ck.ck-collapsible.ck-collapsible_collapsed > button.ck-button {
font-weight: normal !important;
}
.ck.ck-collapsible .ck-collapsible__children {
padding-top: 1em;
}
/* Toolbar separators */
:root .ck.ck-toolbar .ck.ck-toolbar__separator {
background: transparent;
border-inline-start: 1px solid var(--ck-color-toolbar-border);
}
/* Heading dropdown */
:root .ck.ck-dropdown.ck-heading-dropdown .ck-dropdown__panel .ck-list__item {
min-width: 170px;
}
/* Font size dropdown */
.ck-fontsize-option {
min-height: 2rem !important;
}
.ck-fontsize-option.text-tiny {--_size: .75em;}
.ck-fontsize-option.text-small {--_size: .85em;}
.ck-fontsize-option.text-big {--_size: 1.4em;}
.ck-fontsize-option.text-huge {--_size: 1.8em;}
:root .ck-fontsize-option .ck.ck-button__label {
font-size: var(--_size);
}
/* Color picker dropdown */
:root .ck.ck-color-selector {
--ck-color-selector-padding: 0;
--ck-color-selector-grids-fragment-padding: 0;
--ck-button-border-radius: var(--ck-border-radius);
--ck-color-grid-padding: 8px;
}
/* Remove color and color picker buttons */
:root .ck.ck-color-selector .ck-color-grids-fragment .ck-button:is(
.ck-color-selector__remove-color, .ck-color-selector__color-picker
) {
padding-inline-start: calc(
var(--ck-color-grid-padding)
+ (var(--ck-color-grid-tile-size) - var(--ck-icon-size)) / 2
- 1px
);
}
/* Color palette */
:root .ck.ck-color-selector .ck-color-grid {
--ck-editor-toolbar-button-on-shadow: none; /* Remove the shadow of the selected color button */
--ck-color-grid-gap: 8px;
--ck-color-grid-tile-border-radius: 4px;
width: auto;
}
/* Color tiles, drawn as the cells of ColorPicker.css */
:root .ck.ck-color-selector .ck-color-grid__tile {
&:is(.ck-on, :hover, :focus) {
box-shadow: none;
}
&.ck-color-selector__color-tile_bordered {
box-shadow: inset 0 0 0 1px var(--ck-color-border-control);
}
&:hover:not(.ck-on, .ck-disabled) {
transform: scale(1.2);
}
&:focus-visible {
outline: 2px solid var(--input-focus-outline-color);
outline-offset: 2px;
}
&.ck-on .ck-icon {
display: none;
}
/* The selection ring takes the tile's own color, which only its inline background holds. */
&.ck-on::after {
content: "";
position: absolute;
inset: -4px;
border: 2px solid transparent;
border-radius: 8px;
background: inherit;
mask-image: linear-gradient(#000 0 0), linear-gradient(#000 0 0);
mask-clip: padding-box, border-box;
mask-composite: exclude;
}
&.ck-color-selector__color-tile_bordered.ck-on::after {
background: var(--main-text-color);
}
}
/* Color picker button */
:root .ck.ck-color-selector .ck-color-grids-fragment .ck-button.ck-color-selector__color-picker {
--ck-color-base-border: transparent; /* Remove the top border */
border-bottom-left-radius: var(--ck-border-radius);
border-bottom-right-radius: var(--ck-border-radius);
}
/* Hex color input box prefix */
:root .ck.ck-color-selector .ck-color-picker__hash-view {
margin-top: var(--ck-input-label-height);
}
/* Numbered list */
:root .ck.ck-list-properties_with-numbered-properties .ck.ck-list-styles-list {
min-width: 200px;
grid-template-columns: repeat(3, auto);
justify-content: space-between;
padding-bottom: calc(
var(--ck-spacing-medium, var(--ck-spacing-base)) + var(--menu-padding-size)
);
}
/* Table dropdown */
/* Table rows / columns button grid container */
.ck-insert-table-dropdown__grid {
--ck-insert-table-dropdown-box-width: 16px;
--ck-insert-table-dropdown-box-height: 16px;
--ck-insert-table-dropdown-box-margin: 2px;
--ck-color-base-border: var(--ck-color-panel-border); /* Cell box color */
--ck-color-focus-border: var(--hover-item-text-color); /* Selected cell box border color */
--ck-color-focus-outer-shadow: var(--hover-item-background-color); /* Selected cell box background color */
--ck-border-radius: 0;
--ck-editor-toolbar-button-on-shadow: 1px 1px 1px rgba(0, 0, 0, .35);
}
/* Selected rows / column counter */
.ck.ck-insert-table-dropdown__label {
margin-top: var(--ck-spacing-medium, var(--ck-spacing-base));
}
/* Admonitions dropdown */
.ck-tn-admonition-note { --icon: "\eb21"; --accent: var(--admonition-note-accent-color);}
.ck-tn-admonition-tip { --icon: "\ea0d"; --accent: var(--admonition-tip-accent-color);}
.ck-tn-admonition-important { --icon: "\ea7c"; --accent: var(--admonition-important-accent-color);}
.ck-tn-admonition-caution { --icon: "\eac7"; --accent: var(--admonition-caution-accent-color);}
.ck-tn-admonition-warning { --icon: "\eac5"; --accent: var(--admonition-warning-accent-color);}
:root .ck.ck-tn-admonition-option span.ck-button__label {
display: inline-flex;
align-items: center;
width: 100%;
margin: 4px;
background: color-mix(in srgb, var(--accent) 15%, var(--main-background-color));
padding-block: 4px;
padding-inline-end: 2em;
border: 1px solid var(--accent);
border-radius: 6px;
}
:root .ck.ck-tn-admonition-option .ck-button__label::before {
display: inline-block;
content: var(--icon);
width: 2em;
text-align: center;
font-size: 1.4em;
font-family: boxicons;
color: var(--accent);
}
/* Scrollable dropdown panel. Applies to our reusable `.ck-tn-dropdown`
(footnotes, mermaid; set via `dropdownView.class`) and to CKEditor's own code
block language dropdown, whose 250px default we bump up to 400px. */
.ck.ck-dropdown.ck-tn-dropdown .ck-dropdown__panel,
.ck.ck-dropdown.ck-code-block-dropdown .ck-dropdown__panel,
.ck.ck-toolbar-container.codeblock-language-list .ck.ck-dropdown__panel {
--_panel-height: 400px;
overflow: hidden;
max-height: var(--_panel-height);
padding: 0;
}
.ck-tn-dropdown .ck-dropdown__panel .ck-list,
.ck-code-block-dropdown .ck-dropdown__panel .ck-list,
.ck.ck-toolbar-container.codeblock-language-list .ck.ck-dropdown__panel .ck-list {
box-sizing: border-box;
overflow: auto;
max-height: calc(var(--_panel-height) - 2px);
padding: var(--ck-editor-popup-padding);
}
/* Text snippet dropdown */
div.ck-template-form {
--ck-template-icon-size: 38px;
--ck-color-list-button-hover-background: var(--hover-item-background-color);
padding: 8px;
}
div.ck-template-form .ck-labeled-field-view {
margin-bottom: 8px;
}
:root div.ck.ck-template-form .ck.ck-search__results {
border-top: 0;
}
:root .ck.ck-template-form > .ck-search__results > .ck.ck-list.ck-template-list {
padding-top: 0;
}
/* Template item */
:root .ck.ck-template-form > .ck-search__results > .ck.ck-list.ck-template-list > .ck.ck-list__item:not(.ck-hidden) ~ .ck.ck-list__item {
margin-top: 2px; /* Item gap */
}
:root .ck.ck-template-form > .ck-search__results > .ck.ck-list.ck-template-list > .ck.ck-list__item > .ck.ck-button {
--ck-spacing-large: 8px; /* The gap between the icon and the text */
padding: 2px 8px;
}
:root .ck.ck-template-form > .ck-search__results > .ck.ck-list.ck-template-list > .ck.ck-list__item > .ck.ck-button:not(:focus) {
border-color: transparent;
}
/* Note icon — a plain font-icon <span>, no SVG <foreignObject> wrapper. The glyph is drawn by the
Boxicons font on the element's own ::before, so the circular backdrop goes on ::after to avoid
clobbering the glyph's `content`. */
:root div.ck-template-form .ck-template-icon {
position: relative;
/* Render like a real note icon (cf. the list/grid view's `.note-icon`): a hue-light glyph on a
hue-tinted circular backdrop when the note has a `#color`, falling back to the neutral icon
colours otherwise. The `--note-icon-custom-*` variables come from the `.with-hue` rule the
plugin opts into (see theme-next-{dark,light}.css); they derive from `--custom-color-hue`,
which the note's colour class carries. */
color: var(--note-icon-custom-color, var(--note-icon-color));
&::after {
display: block;
content: "";
position: absolute;
inset: 2px;
border-radius: 50%;
background: var(--note-icon-custom-background-color, var(--note-icon-hover-background-color));
z-index: -1;
}
}
/* Template name */
div.ck-template-form .ck-template-form__text-part {
color: var(--hover-item-text-color);
font-size: .9rem;
}
div.ck-template-form .ck-template-form__text-part mark {
--ck-color-highlight-background: transparent;
color: var(--quick-search-result-highlight-color);
text-decoration: underline;
font-weight: bold;
}
/* Template description */
:root div.ck-template-form .ck-template-form__description {
--ck-spacing-tiny: 0; /* Used for the top margin */
display: block;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap !important;
font-size: .9em;
}
/* Messages */
div.ck-template-form .ck-search__info > span {
line-height: initial;
color: var(--muted-text-color);
}
div.ck-template-form .ck-search__info span:last-child {
display: block;
opacity: .5;
margin-top: 8px;
font-size: .9em;
}
/* Link dropdown */
:root .ck.ck-form.ck-link-form ul.ck-link-form__providers-list {
border-top: none;
}
/* Anchors and the anchors list, drawn as menu items (menus.css, Menu.css) */
:root .ck.ck-link-form .ck-link-form__providers-list .ck-link__button,
:root .ck.ck-link-providers .ck-link-providers__list .ck-list__item > .ck-button {
border-color: transparent;
color: var(--menu-text-color);
&:is(:hover, :focus-visible):not(.ck-disabled) {
background: var(--hover-item-background-color);
color: var(--hover-item-text-color);
}
}
:root .ck.ck-link-form .ck-link-form__providers-list .ck-link__button > .ck-icon {
color: var(--menu-item-arrow-color);
}
/* Math popup */
:root .ck-math-form .ck-math-button-row {
--ck-button-border-radius: var(--ck-border-radius);
}
/* Room inside the scrolling view for the fields' focus ring animation */
:root .ck.ck-math-input > :is(.ck-mathlive-container, .ck-latex-textarea) {
margin: 4px;
}
:root .ck.ck-math-input > .ck-mathlive-container {
padding-inline: 12px;
}
:root .ck.ck-math-input > .ck-latex-textarea {
padding-inline: 16px;
}
:root .ck-math-form math-field::part(virtual-keyboard-toggle),
:root .ck-math-form math-field::part(menu-toggle) {
color: var(--icon-button-color);
}
:root .ck-math-form math-field::part(virtual-keyboard-toggle):hover,
:root .ck-math-form math-field::part(menu-toggle):hover {
background: var(--icon-button-hover-background);
color: var(--icon-button-hover-color);
}
:root .ck-math-form math-field {
--ui-font-family: var(--ck-font-face);
--ui-font-size: 0.9rem;
--ui-menu-bg: var(--menu-background-color);
--ui-menu-text: var(--ck-color-text);
--ui-menu-bg-active: var(--hover-item-background-color);
--ui-menu-text-active: var(--ck-color-text);
--ui-menu-bg-active-muted: var(--hover-item-background-color);
--ui-menu-text-active-muted: var(--ck-color-text);
--ui-menu-divider: var(--menu-item-delimiter-color);
--ui-menu-shadow: 0px 10px 20px rgba(0, 0, 0, var(--dropdown-shadow-opacity));
/* CKEditor's list row geometry: 27px tall, 4px apart, 11px from the menu's edge */
--ui-line-height: 21px;
--ck-math-menu-item-margin: 4px 11px;
--ck-math-menu-item-padding: 1px 15px;
--ck-math-menu-item-border-radius: 6px;
--ck-math-menu-heading-margin: 0 0 8px;
--ck-math-menu-heading-padding: 2px 26px 1px;
--ck-math-menu-heading-border: 1px solid var(--menu-item-delimiter-color);
--ck-math-menu-heading-opacity: 1;
--ck-math-menu-heading-font-size: 0.8em;
--ck-math-menu-heading-font-weight: 500;
--ck-math-menu-heading-letter-spacing: 1pt;
--ck-math-menu-heading-text-transform: uppercase;
--ck-math-menu-heading-color: var(--menu-item-group-header-color);
--ck-math-menu-checkmark-order: 1;
--ck-math-menu-checkmark-margin-inline: 12px 2px;
--ck-math-menu-checkmark-color: var(--menu-item-icon-color);
--ck-math-menu-checkmark-indent: 0;
--ck-math-menu-swatch-size: var(--ck-color-grid-tile-size);
--ck-math-menu-swatch-gap: 8px;
--ck-math-menu-swatch-background: transparent;
--ck-math-menu-swatch-border-radius: 4px;
--ck-math-menu-swatch-shadow: inset 0 0 0 1px var(--main-border-color);
}
:root .ck-math-form math-field::part(ui-menu-container) {
/* An outline takes no room from the four swatch columns of `.swatches-submenu` */
outline: 1px solid var(--ck-editor-popup-border-color);
outline-offset: -1px;
border-radius: var(--dropdown-border-radius);
padding-block: 7px;
backdrop-filter: var(--dropdown-backdrop-filter);
}
:root .ck-math-form math-field::part(menu-divider) {
margin: calc(.5em + 2px) 0;
padding: 0;
width: 100%;
opacity: 1;
}
body.background-effects .ck-math-form math-field {
--ui-menu-bg: var(--menu-background-color-no-backdrop);
}
body.background-effects .ck-math-form math-field::part(ui-menu-container) {
backdrop-filter: none;
}
/* Special character and emoji tiles, drawn as the cells of the note icon list (shell.css) */
:root .ck.ck-character-grid button.ck-button.ck-character-grid__tile,
:root .ck.ck-emoji .ck.ck-emoji__tiles button.ck-button.ck-emoji__tile {
box-shadow: none;
border-radius: 6px;
background: transparent;
transition: transform 150ms ease-out;
&:is(:hover, :focus-visible):not(.ck-disabled) {
background: var(--hover-item-background-color);
color: var(--hover-item-text-color);
}
&:hover:not(.ck-disabled) {
transform: scale(1.5);
}
/* Emoji fonts advance wider than the tile, and overflowing text ignores `text-align`. */
> .ck-button__label {
display: flex;
justify-content: center;
}
}
/* Emoji dropdown */
:root .ck.ck-emoji {
display: flex;
flex-direction: column;
}
/* Categories, drawn as a segmented button (buttons.css) */
:root .ck.ck-emoji__categories-list {
order: 1;
margin-top: 12px;
}
:root .ck.ck-emoji__categories-list > .ck-tab-button::before {
display: none;
}
:root .ck.ck-emoji .ck.ck-emoji__tiles {
border-top: none;
}
:root .ck.ck-emoji-picker-form .ck-emoji__search {
align-items: end;
padding-bottom: 12px;
}
/* Find and replace dialog */
.ck-find-and-replace-form .ck-find-and-replace-form__inputs button {
margin-top: var(--ck-input-label-height);
}
/*
* FORMS
*/
/*
* Buttons
*/
button.ck.ck-button:is(.ck-button-action, .ck-button-save, .ck-button-cancel, .ck-button_standard).ck-button_with-text,
.ck-table-form__action-row > button.ck.ck-button.ck-button_with-text {
--ck-color-text: var(--cmd-button-text-color);
min-width: 60px;
font-weight: 500;
}
/*
* Dropdowns in forms
*/
:root .ck.ck-form .ck.ck-dropdown > .ck.ck-button.ck-dropdown__button {
border: unset;
border-radius: var(--bs-border-radius);
box-shadow: unset;
background: var(--input-background-color);
color: var(--input-text-color);
&:not(.ck-disabled):hover {
background: var(--input-hover-background);
color: var(--input-hover-color);
}
&:focus-visible {
outline: 3px solid var(--input-focus-outline-color);
outline-offset: 0;
}
}
/*
* Text boxes
*/
.ck.ck-labeled-field-view {
padding-top: var(--ck-input-label-height) !important; /* Create space for the label */
}
.ck.ck-labeled-field-view > .ck.ck-labeled-field-view__input-wrapper > label.ck.ck-label {
/* Move the label above the text box regardless of the text box state */
transform: translate(0, calc(-.2em - var(--ck-input-label-height))) !important;
padding-inline-start: 0 !important;
background: transparent;
font-size: .85em;
font-weight: 600;
}
.ck.ck-table-form__cell-type-row > .ck.ck-labeled-field-view,
.ck.ck-labeled-field-view.ck-table-cell-properties-form__background {
padding-top: 0 !important;
> .ck.ck-labeled-field-view__input-wrapper > label.ck.ck-label {
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(50%);
white-space: nowrap;
}
}
:root input.ck.ck-input-text[readonly="true"] {
cursor: not-allowed;
background: var(--input-background-color);
}
/*
* Combo boxes
*/
/* forms.css draws the arrow as a background and dims the whole box when disabled. */
:root .ck-labeled-field-view__input-wrapper > .ck-dropdown .ck-dropdown__arrow,
:root .ck-emoji__skin-tone > .ck-dropdown .ck-dropdown__arrow {
display: none;
}
:root .ck-labeled-field-view__input-wrapper > .ck.ck-dropdown
> .ck-button.ck-dropdown__button.ck-disabled .ck-button__label {
opacity: 1;
}
/*
* Color inputs
*/
:root .ck.ck-input-color {
--input-group-padding-inline-end: 0;
--ck-input-color-preview-border-radius: 4px;
}
:root .ck.ck-input-color > .ck.ck-dropdown > button.ck.ck-input-color__button {
box-shadow: none;
border-color: transparent;
background: transparent;
}
:root .ck.ck-input-color__button__preview {
--ck-color-input-border: transparent;
}
:root .ck.ck-input-color__button:focus-visible > .ck-input-color__button__preview {
outline: 2px solid var(--input-focus-outline-color);
outline-offset: 2px;
}
/* No color, drawn as the reset cell of ColorPicker.css */
:root .ck.ck-input-color__button__preview:not(:has(> .ck-hidden)) {
background: var(--note-color-picker-clear-color-cell-background);
&::after {
content: "\ec8d";
display: flex;
position: absolute;
inset: 0;
justify-content: center;
align-items: center;
font-family: boxicons;
font-size: 16px;
color: var(--note-color-picker-clear-color-cell-color);
}
> .ck-input-color__button__preview__no-color-indicator {
visibility: hidden;
}
}
/*
* Button groups
*/
:root .ck.ck-toolbar[role="radiogroup"] {
border: none;
}
/*
* Toggle switches, drawn as the switches of menu rows (FormToggle.css, FormList.css)
*/
:root button.ck.ck-button.ck-switchbutton {
--ck-switch-button-toggle-width: 40px;
--ck-switch-button-toggle-inner-size: 12px;
--ck-switch-button-translation: 20px;
--ck-switch-button-toggle-border-radius: 24px;
--ck-switch-button-toggle-inner-border-radius: 50%;
--ck-switch-button-inner-hover-shadow: none;
--ck-color-switch-button-off-background: var(--switch-off-track-background);
--ck-color-switch-button-off-hover-background: var(--switch-off-track-background);
--ck-color-switch-button-on-background: var(--switch-on-track-background);
--ck-color-switch-button-on-hover-background: var(--switch-on-track-background);
--ck-color-switch-button-inner-background: var(--switch-off-thumb-background);
--ck-color-list-button-hover-background: var(--hover-item-background-color);
--ck-color-list-background: transparent;
--ck-color-surface-control: transparent;
&:focus-visible {
--ck-color-surface-control: var(--input-focus-outline-color);
border-color: var(--input-focus-outline-color);
}
.ck-button__toggle {
box-shadow: none;
outline: none;
border: none;
padding: 4px;
transition: background 200ms ease-in;
}
.ck-button__toggle__inner {
transition:
transform 600ms cubic-bezier(0.22, 1, 0.36, 1),
background 200ms ease-out;
}
&.ck-on {
--ck-color-switch-button-inner-background: var(--switch-on-thumb-background);
.ck-button__toggle {
transition: background 100ms ease-out;
}
.ck-button__toggle__inner {
transition:
transform 200ms cubic-bezier(0.64, 0, 0.78, 0),
background 100ms ease-in;
}
}
}
/* AI assistant composer */
:root .ck-ai-assistant-form__prompt-row input.ck.ck-input-text,
:root .ck-ai-assistant-form__prompt-row input.ck.ck-input-text:not([readonly="true"]):hover,
:root .ck-ai-assistant-form__prompt-row input.ck.ck-input-text:not([readonly="true"]):focus {
outline: none;
background: transparent;
}
/* Forms */
:root .ck.ck-form__row.ck-form__row_with-submit {
align-items: baseline;
}
:root .ck.ck-form__row.ck-form__row_with-submit > :not(:first-child) {
margin-inline-start: 16px;
}
:root .ck.ck-form__header {
border-bottom: none;
}
/* Back button, drawn as an icon button (buttons.css) */
:root button.ck.ck-button.ck-button-back {
--ck-icon-size: calc(var(--icon-button-size) * var(--icon-button-icon-ratio));
box-shadow: none;
background: transparent;
}
/*
* Multistate checkboxes
*/
/* Prevent variables from bleeding into nested items */
.ck-content.ck-editor__editable .todo-list .todo-list {
--_task-checkbox-hover-background-color: initial;
}
/* Checkboxes with a task state */
.ck-content .todo-list li[data-trilium-task-state]:not([data-trilium-task-state="none"]) {
--_task-checkbox-hover-background-color: var(--task-state-custom-hover-background-color, var(--task-checkbox-with-state-hover-background));
}
/* Checkboxes in the "done" state */
.ck-content.ck-editor__editable .todo-list li:where(:not([data-trilium-task-state]), [data-trilium-task-state="done"]):has(> .todo-list__label input[type="checkbox"]:checked) {
--_task-checkbox-hover-background-color: var(--task-checkbox-done-hover-color);
}
/* All checkboxes */
:root .ck-content.ck-editor__editable ul.todo-list li .todo-list__label input[type="checkbox"] {
background: transparent;
&:hover::before {
box-shadow: 0 0 0 5px color-mix(in srgb, var(--_task-checkbox-background, var(--task-checkbox-without-state-hover-background)) 25%, transparent);
background: var(--_task-checkbox-hover-background-color, var(--task-checkbox-without-state-hover-background));
}
}
/* Unknown task state */
:root .ck-content.ck-editor__editable ul.todo-list li.tn-unknown-task-state .todo-list__label input[type="checkbox"] {
outline: none;
&:before {
outline: 2px solid var(--task-checkbox-unknown-state-color);
}
}
/*
* EDITOR'S CONTENT
*/
.note-detail-editable-text-editor > .ck-placeholder {
opacity: .5;
}
/* A widget that CKEditor wrongly flags as the placeholder host (see the
`.ck-widget.ck-placeholder` note in style.css) must not be dimmed — its
content is real. The overlaid placeholder text is suppressed there. */
.note-detail-editable-text-editor > .ck-widget.ck-placeholder {
opacity: 1;
}
/*
* Code Blocks
*/
.attachment-content-wrapper pre,
:root .ck-content pre {
border: 0;
border-radius: 6px;
box-shadow: var(--code-block-box-shadow);
margin-top: 2px !important;
}
.include-note.extended-code-block {
--_include-note-top-border-radius: 6px;
--_include-note-bottom-border-radius: 6px;
box-shadow: var(--code-block-box-shadow);
}
.attachment-content-wrapper pre {
border-radius: var(--dropdown-border-radius);
}
:root .ck-content pre:has(> code) {
padding: 0;
}
:root .ck-content pre {
--icon-button-size: 1.8em;
--copy-button-width: var(--icon-button-size);
/* The margin of the copy button is computed so the button will appear vertically centered
* for single-line code blocks */
--copy-button-margin-size: calc((1em * 1.5 + var(--padding-size) * 2 - var(--icon-button-size)) / 2);
/* Where: │ └ Line height
* └───────── Font size
*/
overflow: unset;
}
pre button.copy-button.icon-action {
font-size: 1em; /* Workaround: --icon-button-size does not work properly with em units */
}
:root pre:has(> button.copy-button) {
padding-inline-end: calc(var(--icon-button-size) + (var(--copy-button-margin-size) * 2));
}
:root .include-note-content.type-extendedCodeBlock .code-embed-content {
--_copy-button-size: 1.8em;
/* Centers the button on the first line: 1.4 is CodeMirror's line height, 1em the padding of
`.cm-content` in style.css. */
--_copy-button-inset: calc((1.4em + 1em * 2 - var(--_copy-button-size)) / 2);
> button.copy-button.icon-action {
--icon-button-size: var(--_copy-button-size);
font-size: 1em;
}
}
/* Child combinator: as a descendant one it also hit first-children nested inside a block, stacking a pixel per level. */
html .note-detail-editable-text > :first-child:not(figure, .include-note, hr) {
/* Create some space for the top-side shadow */
margin-top: 1px !important;
}
/* Round the player, not the card: clipping the card would crop the insert-paragraph buttons. */
.include-note-content.type-video .video-preview-wrapper:not(:fullscreen) {
border-radius: 0 0 var(--_include-note-bottom-border-radius, 8px)
var(--_include-note-bottom-border-radius, 8px);
overflow: hidden;
}
.include-note:has(> figcaption) .include-note-content.type-video .video-preview-wrapper {
border-radius: 0;
}
.ck.ck-editor__editable pre[data-language]::after {
--ck-color-code-block-label-background: rgba(128, 128, 128, 0.5);
border-radius: 0 0 5px 5px;
padding: 0px 10px;
letter-spacing: 0.5px;
font-weight: bold;
top: 0;
}
.attachment-content-wrapper pre code,
:root .ck-content pre code {
display: block;
padding: var(--padding-size, 1em);
overflow: auto;
}
.ck-content pre code {
--scrollbar-thumb-color: gray;
--scrollbar-thumb-hover-color: gray;
}
.ck-content pre code::-webkit-scrollbar-track,
::-webkit-scrollbar-thumb {
cursor: default;
}
.ck-content blockquote {
background: var(--card-background-color);
border: 1px solid var(--card-border-color) !important;
box-shadow: var(--card-box-shadow);
border-radius: 10px;
padding: 1em 2.5em;
position: relative;
font-style: unset !important;
}
.ck-content blockquote p:last-of-type {
margin-bottom: 0 !important;
}
.ck-content blockquote:before,
.ck-content blockquote:after {
position: absolute;
top: 0;
font-size: 48px;
opacity: 0.1;
}
.ck-content blockquote:before {
content: "“";
inset-inline-start: 0.2em;
}
.ck-content blockquote:after {
content: "”";
inset-inline-end: 0.35em;
}
/* `:where(:not(.excalidraw *))` leaves out the UI of an embedded canvas drawing. */
.ck-content h1:where(:not(.excalidraw *)),
.ck-content h2:where(:not(.excalidraw *)),
.ck-content h3:where(:not(.excalidraw *)),
.ck-content h4:where(:not(.excalidraw *)),
.ck-content h5:where(:not(.excalidraw *)),
.ck-content h6:where(:not(.excalidraw *)) {
font-weight: 300;
}
.ck-content strong {
font-weight: 600;
}
/* `:where(:not(.excalidraw *))` leaves out the menus of an embedded canvas drawing. */
:root .ck-content hr:where(:not(.excalidraw *)) {
margin-block: 5px;
height: 0;
border: thin solid var(--main-border-color);
opacity: 1;
}
.ck-content:not(.word-wrap) pre code {
white-space: pre;
}
:root .ck-content td pre {
--padding-size: 0.5em;
}
:root .ck-content td pre code {
white-space: pre-wrap;
overflow-wrap: break-word;
}
.code-sample-wrapper .hljs {
transition: background-color linear 100ms;
}
.ck-content .footnote-section {
border: 0 !important;
border-top: 1px solid var(--main-border-color) !important;
}
/*
* Captions
*/
/* A caption takes the corners of its widget on the edge it sits on. */
.ck-content :is(.image, .include-note) > figcaption {
border-bottom-left-radius: inherit;
border-bottom-right-radius: inherit;
}
.ck-content .table > figcaption {
border-top-left-radius: inherit;
border-top-right-radius: inherit;
background: var(--accented-background-color);
color: var(--main-text-color);
}
/* The states of the `.tn-input-field` text box in forms.css, with the outline drawn inside. */
:root .ck-content :is(.image, .table, .include-note) > figcaption.ck-editor__nested-editable {
outline: 3px solid transparent;
outline-offset: 3px;
border-color: transparent;
&:hover {
/* Outranks the `!important` background of the image caption in style.css. */
background: var(--input-hover-background) !important;
}
&:is(.ck-editor__nested-editable_focused, :focus) {
box-shadow: none;
outline: 3px solid var(--input-focus-outline-color);
outline-offset: -3px;
border-color: transparent;
background: var(--input-focus-background) !important;
transition:
outline-color 50ms linear,
outline-offset 200ms ease-out;
}
}
/* Links */
.ck-content a.ck-widget {
outline: none;
}
.ck-content a.ck-widget.ck-widget_selected,
.ck-content a.ck-link_selected {
outline: none;
box-shadow: 0 0 0 2px var(--link-selection-outline-color);
background: var(--link-hover-background);
}
/* Anchors */
.ck-content .ck-bookmark.ck-widget {
--ck-bookmark-icon-hover-fill-color: var(--quick-search-result-highlight-color);
--ck-bookmark-icon-selected-fill-color: var(--quick-search-result-highlight-color);
.ck-bookmark__icon .ck-icon__fill {
fill: var(--quick-search-result-highlight-color);
}
}
/* Reference link */
.ck-content a.reference-link,
.ck-content a.reference-link:hover {
/* Apply underline only to the span inside the link so it can follow the
* target note's user defined color */
text-decoration: none;
}
.ck-content a.reference-link > span.use-note-color {
color: var(--custom-color, inherit);
}
.ck-content a.reference-link:hover > span {
text-decoration: underline;
}
.ck-content a.reference-link small {
margin-left: 0.25em;
opacity: 0.5;
>span {
font-size: 0.7em;
}
}
/*
* Read-only text content
*/
.note-detail-readonly-text:focus-visible {
outline: 2px solid var(--input-focus-outline-color);
border-radius: 4px;
}
.note-list-widget {
outline: 0 !important;
}