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
html,
body {
margin: 0;
padding: 0;
width: 100vw;
height: 100vh;
}
body.setup {
margin: 0;
padding: 0;
&>.setup-outer-wrapper {
width: 100dvw;
height: 100dvh;
body:not(.electron) & {
@media (min-width: 700px) {
background:
radial-gradient(ellipse at 20% 50%, rgba(99, 102, 241, 0.3) 0%, transparent 50%),
radial-gradient(ellipse at 80% 20%, rgba(168, 85, 247, 0.25) 0%, transparent 50%),
radial-gradient(ellipse at 60% 80%, rgba(59, 130, 246, 0.25) 0%, transparent 50%),
var(--left-pane-background-color);
display: flex;
justify-content: center;
align-items: center;
padding: 2em;
}
}
.setup-container {
background-color: var(--main-background-color);
border-radius: 16px;
padding: 2em;
flex-direction: column;
gap: 2rem;
position: relative;
height: 100%;
body.electron & {
border-radius: 0;
}
@media (min-width: 700px) {
display: flex;
width: 750px;
height: 650px;
max-height: 100%;
top: unset;
overflow: hidden;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}
.setup-options {
display: flex;
flex-direction: column;
justify-content: center;
gap: 1rem;
body.desktop & {
gap: 0.75rem;
}
}
.setup-option-card {
display: flex;
align-items: center;
gap: 1rem;
padding: .75em 1.5em;
cursor: pointer;
&.disabled {
cursor: not-allowed;
opacity: 0.5;
background-color: transparent;
border-color: var(--main-border-color)
}
&:not(.disabled):hover {
background-color: var(--card-background-hover-color);
filter: contrast(105%);
transition: background-color .2s ease-out;
}
.tn-icon {
font-size: 2.5em;
color: var(--muted-text-color);
/* A box of its own rather than whatever width the glyph happens to have, so
every title and description in the list starts on the same line however
large the icon beside it is drawn. One em at this size is 2.5em of the card,
which is the measure the quieter card below matches itself to. */
width: 1em;
flex-shrink: 0;
text-align: center;
}
h3 {
margin-bottom: 4px;
font-size: 1.15em;
font-weight: normal;
body.desktop & {
font-size: 1.3em;
}
}
p:last-of-type {
margin-bottom: 0;
font-size: .85em;
color: var(--muted-text-color);
}
}
/* Apart from the four below, which all replace the knowledge base, and quieter than
them: this is the one that changes nothing. */
.setup-keep-card {
margin-bottom: 0.5rem;
background-color: transparent;
.tn-icon {
font-size: 1.75em;
/* Drawn smaller, but taking the same room: 2.5em of the card, written in this
icon's own units. Without it the smaller glyph pulls its title left and the
item stops lining up with the four below. */
width: calc(2.5em / 1.75);
}
h3 {
font-size: 1em;
body.desktop & {
font-size: 1.05em;
}
}
}
}
.page {
--page-padding-inline: 2em;
--page-padding-block: 2em;
display: flex;
flex-direction: column;
height: 100%;
padding-top: calc(var(--page-padding-block) + env(titlebar-area-height, 0px) + var(--safe-area-inset-top, env(safe-area-inset-top)));
padding-bottom: calc(var(--page-padding-block) + var(--safe-area-inset-bottom, env(safe-area-inset-bottom)));
padding-left: calc(var(--page-padding-inline) + var(--safe-area-inset-left, env(safe-area-inset-left)));
padding-right: calc(var(--page-padding-inline) + var(--safe-area-inset-right, env(safe-area-inset-right)));
overflow: auto;
body.electron & {
--page-padding-block: 1em;
}
>.back-button {
/* `.page` scrolls (not `.setup-container`), so sticky is required here, not
absolute, to stay in flow and follow the scroll. */
position: sticky;
top: 0;
inset-inline-start: 0;
align-self: flex-start;
z-index: 1;
color: var(--muted-text-color);
/* Sticky content still scrolls in underneath; an opaque fill stops it showing
through, same technique `.page > footer` below already uses. */
background: var(--main-background-color);
body.background-effects & {
background: transparent;
}
.tn-icon {
margin-inline-end: 0.4em;
}
body[dir=rtl] & .tn-icon {
transform: scaleX(-1);
}
}
>main {
flex: 1;
display: flex;
flex-direction: column;
padding-top: 2em;
body.desktop & {
padding-top: 1em;
}
}
&.contentless {
justify-content: center;
align-items: center;
}
>footer {
background: var(--main-background-color);
position: sticky;
bottom: calc(-1 * var(--page-padding-block));
left: 0;
right: 0;
display: flex;
justify-content: flex-end;
gap: 0.5rem;
border-top: 1px solid var(--main-border-color);
padding-top: 1rem;
padding-bottom: var(--page-padding-block);
margin-inline: calc(-1 * var(--page-padding-inline));
margin-bottom: calc(-1 * var(--page-padding-block));
padding-inline: var(--page-padding-inline);
body.background-effects & {
background: transparent;
}
}
>.page-error {
position: absolute;
top: 0;
inset-inline: 0;
background: color-mix(in srgb, var(--accent-color) 15%, var(--main-background-color));
z-index: 1;
margin: 0;
border-radius: 0;
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
padding-top: calc(1em + var(--safe-area-inset-top, env(safe-area-inset-top)));
padding-inline-end: 2.5em;
user-select: text;
body:not(.electron) & {
@media (min-width: 700px) {
border-radius: 16px 16px 0 0;
}
}
button {
position: absolute;
top: 0.5em;
inset-inline-end: 0.5em;
}
}
}
form {
display: flex;
flex-direction: column;
gap: 1rem;
width: 100%;
margin-inline: auto;
@media (min-width: 700px) {
width: 80%;
}
.form-group {
margin-bottom: 0;
}
.admonition {
margin: 0;
}
}
.form-item-with-icon {
display: flex;
align-items: center;
gap: 0.5rem;
.tn-icon {
font-size: 1.5em;
color: var(--muted-text-color);
}
}
}
.sync-illustration {
display: flex;
justify-content: center;
margin-top: 1.5em;
margin-bottom: 1.5rem;
padding-block: 2em;
body.desktop & {
padding-block: 1em;
}
.tn-icon {
font-size: 3em;
color: var(--muted-text-color);
}
>div {
display: flex;
flex-direction: column;
text-align: center;
gap: 0.5rem;
line-height: 1;
font-size: 0.85rem;
}
.sync-illustration-arrows {
width: 60px;
height: 3em;
position: relative;
&::after {
content: "";
position: absolute;
border: 2px dashed var(--main-border-color);
top: 1.5em;
left: 0;
right: 0;
}
}
}
.illustration-icon {
font-size: 4em;
text-align: center;
color: var(--muted-text-color);
opacity: 0.6;
}
.illustration-logo {
--size: 128px;
width: var(--size);
height: var(--size);
margin: auto;
body.desktop & {
--size: 96px;
}
}
.illustration-icon,
.illustration-logo {
margin: 3rem auto 1rem auto;
body.desktop & {
margin-top: 1rem;
}
}
h1 {
font-size: 1.4em;
text-align: center;
}
h1 + p {
text-align: center;
color: var(--muted-text-color);
margin-bottom: 0;
}
.tooltip {
z-index: 15 !important;
}
}
body.setup.background-effects,
body.setup.background-effects .setup-container {
background: transparent;
}
/* The band the window controls are drawn in, which drags the window in place of the title bar. */
body.setup.electron {
.drag-region {
position: absolute;
top: 0;
left: 0;
right: 0;
height: env(titlebar-area-height, 40px);
-webkit-app-region: drag;
z-index: 10;
}
.back-button {
-webkit-app-region: no-drag;
z-index: 11;
}
/* The error's header shares the band with the window controls: it drags the window and stays
clear of the controls on either side. Stacked above `.drag-region` so the dismiss button
receives clicks. */
.page > .page-error {
z-index: 11;
padding-top: 0;
.admonition-header {
height: env(titlebar-area-height, 40px);
margin-block-end: 0;
padding-left: max(0px, calc(env(titlebar-area-x, 0px) - 1em));
padding-right: calc(100vw - env(titlebar-area-x, 0px) - env(titlebar-area-width, 100vw));
-webkit-app-region: drag;
}
button {
top: calc(env(titlebar-area-height, 40px) / 2);
right: calc(100vw - env(titlebar-area-x, 0px) - env(titlebar-area-width, 100vw) + 0.5em);
transform: translateY(-50%);
-webkit-app-region: no-drag;
}
/* Without a header, the content starts below the band and the banner stays under
`.drag-region`, so the band still drags the window. */
&.no-title {
z-index: 1;
padding-top: calc(env(titlebar-area-height, 40px) + 1em);
button {
top: calc(env(titlebar-area-height, 40px) + 0.5em);
right: 0.5em;
transform: none;
}
}
}
}
@keyframes lds-ring {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
/* Stepped rather than linear: a continuously-animating element forces the browser to render
at full display refresh rate (90+ fps on some phones) for as long as the spinner is visible.
Setup spinners stay on screen for the entire initial sync — measured at ~40% of a CPU core
on mobile — so cap them at ~6 frames/s, which looks the same at icon size. Scoped to setup
because other in-app animations may want the smoother framerate. */
body.setup .bx-spin {
animation-timing-function: steps(12);
}
/* Slide transitions */
.page.select-language {
main {
min-height: 0;
}
.tn-card {
width: 100%;
margin: 0 auto 2em;
height: 100%;
box-sizing: border-box;
min-height: 0;
overflow: hidden;
body.desktop & {
width: 80%;
}
}
.tn-card-body {
height: 100%;
}
.tn-card-section {
overflow: auto;
padding: 0.5em 0;
}
}
.page.sync-from-desktop {
.card-columns {
display: flex;
flex-direction: column;
gap: 1.5rem;
@media (min-width: 700px) {
flex-direction: row;
/* `container-type: inline-size` on `.tn-card` (Card.css) zeroes a flex item's
own width contribution; give this card an explicit share of the row. */
> :first-child {
flex: 1;
}
}
}
.sync-from-desktop-waiting {
margin-top: 2rem;
text-align: center;
.main {
font-size: 1.35em;
}
.subtle {
color: var(--muted-text-color);
}
}
.ip-addresses {
min-width: 250px;
display: flex;
flex-direction: column;
font-family: var(--monospace-font-family);
font-size: 0.9em;
.tn-card-body {
overflow: auto;
padding-bottom: 0.5em;
user-select: text;
> :first-child {
font-weight: bold;
}
}
}
.sync-from-desktop-unreachable .unreachable-actions {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 0.75rem;
margin-top: 1rem;
}
}
.page.sync-in-progress {
.sync-progress {
margin-top: 0.5rem;
display: flex;
align-items: center;
gap: 0.5rem;
.tn-progress-bar {
flex: 1;
}
span {
font-size: 0.85rem;
color: var(--muted-text-color);
min-width: 2.5em;
text-align: end;
}
}
}
.page.sync-failed {
.admonition-body pre {
/* Sync errors embed full request URLs — wrap instead of overflowing the card. */
white-space: pre-wrap;
word-break: break-word;
margin: 0 0 0.5rem;
/* The error is meant to be copied into bug reports — opt back out of the
app-wide `body { user-select: none }`. */
user-select: text;
}
.admonition-body p {
margin: 0;
color: var(--muted-text-color);
font-size: 0.9em;
}
}