Skip to content

Build your personal knowledge base with Trilium Notes

13.7 KB
Raw Blame
@import url(./buttons.css);

/*
 * Selectable cards (import/export pickers) — mirror the button-group look: borderless, a recessed
 * group background, and a raised "selected" chip with a subtle shadow. The base component styling
 * (SelectableCard.css) uses theme-agnostic tokens so the legacy theme keeps working; these Next-theme
 * tokens only exist here, so the override lives in the theme. The `:root` prefix matches the
 * button-group convention above and keeps these rules winning over the component's base rules.
 */
:root .selectable-card {
    border-color: transparent;
    background: var(--button-group-background-color);
    color: var(--cmd-button-text-color);
    transition: background-color 150ms ease-in-out, color 150ms ease-in-out, box-shadow 150ms ease-in-out;
}

:root .selectable-card:hover {
    border-color: transparent;
    background: var(--cmd-button-hover-background-color);
    color: var(--cmd-button-hover-text-color);
}

:root .selectable-card.selected {
    border-color: transparent;
    background: var(--button-group-active-button-background-color);
    color: var(--button-group-active-button-color);
    box-shadow: 1px 1px 1px var(--button-group-active-button-shadow-color);
}

/*
 * Input boxes
 */

input:disabled {
    opacity: 0.33;
}

/* Text boxes */

input:not([type]),
input[type="text"],
input[type="number"],
input[type="password"],
input[type="url"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
:root input.ck.ck-input-text,
:root input.ck.ck-input-number,
textarea.form-control,
textarea,
:root textarea.ck.ck-textarea,
:root .ck.ck-math-input > .ck-mathlive-container,
.tn-input-field {
    outline: 3px solid transparent;
    outline-offset: 6px;
    border: unset;
    border-radius: var(--bs-border-radius);
    background: var(--input-background-color);
    color: var(--input-text-color);
}

input:not([type]):hover,
input[type="text"]:hover,
input[type="number"]:hover,
input[type="password"]:hover,
input[type="url"]:hover,
input[type="email"]:hover,
input[type="tel"]:hover,
input[type="date"]:hover,
input[type="time"]:hover,
input[type="datetime-local"]:hover,
:root input.ck.ck-input-text:not([readonly="true"]):hover,
:root input.ck.ck-input-number:not([readonly="true"]):hover,
textarea.form-control:hover,
textarea:hover,
:root textarea.ck.ck-textarea:hover,
:root .ck.ck-math-input > .ck-mathlive-container:hover,
.tn-input-field:hover {
    background: var(--input-hover-background);
    color: var(--input-hover-color);
}

input:not([type]):focus,
input[type="text"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
input[type="url"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="datetime-local"]:focus,
:root input.ck.ck-input-text:not([readonly="true"]):focus,
:root input.ck.ck-input-number:not([readonly="true"]):focus,
textarea.form-control:focus,
textarea:focus,
:root textarea.ck.ck-textarea:focus,
:root .ck.ck-math-input > .ck-mathlive-container:focus-within,
.tn-input-field:focus,
.tn-input-field:focus-within {
    box-shadow: unset;
    outline: 3px solid var(--input-focus-outline-color);
    outline-offset: 0;
    background: var(--input-focus-background);
    color: var(--input-focus-color);
    transition:
        outline-color 50ms linear,
        outline-offset 200ms ease-out;
}

input::placeholder,
.form-control::placeholder {
    --muted-text-color: var(--input-placeholder-color);
}

input::selection,
.form-control::selection {
    background: var(--input-selection-background);
    color: var(--input-selection-text-color);
}

.form-text {
    color: var(--main-text-color);
    opacity: 0.8;
}

.form-text.text-danger {
    /* Bootstrap's `.text-danger` sets its color with `!important`. */
    color: var(--form-error-text-color) !important;
    opacity: 1;
}

/* Input groups */

.input-group,
:root .ck.ck-input-color {
    /* Named rather than written into the padding alone, so that a field drawing an indicator of its
       own can place it against the group's edge — which is this much further out than the field's. */
    --input-group-padding-inline-end: 8px;

    outline: 3px solid transparent;
    outline-offset: 6px;
    background: var(--input-background-color);
    border-radius: 6px;
    padding-inline-end: var(--input-group-padding-inline-end);
    color: var(--quick-search-color);
    flex-wrap: nowrap;
}

.input-group:hover,
:root .ck.ck-input-color:hover {
    background: var(--input-hover-background);
}

.input-group:focus-within,
:root .ck.ck-input-color:focus-within {
    outline: 3px solid var(--input-focus-outline-color);
    outline-offset: 0;
    background: var(--input-focus-background);
    transition:
        outline-color 50ms linear,
        outline-offset 200ms ease-out;
}

.input-group input .input-group input:hover,
.input-group input:focus,
.input-group .form-control,
.input-group .form-control:hover,
.input-group .form-control:focus,
:root .ck.ck-input-color > input.ck.ck-input-text {
    /* Ignore the focus outline for the inputs that are children of an input group */
    outline: unset;

    background: transparent;
}

.input-group button,
.input-group a {
    display: flex;
    align-items: center;
    --bs-border-width: 0;
    --accented-background-color: transparent;
    background: transparent;
    padding: 0 4px;

    /* Workaround to set the "color" property. */
    --muted-text-color: var(--input-action-button-color);
}

.input-group button:hover,
.input-group a:hover {
    --muted-text-color: var(--input-action-button-hover);
    color: var(--input-action-button-hover);
}

.input-group button:focus-visible,
.input-group a:focus-visible:not(.dropdown-item) {
    box-shadow: unset;
    outline: transparent;
    border: transparent;
    text-shadow: 0 0 3px var(--input-action-button-hover);
}

.input-group button:active {
    background: transparent !important;
}

.input-group a.disabled {
    opacity: 0.5;
    /* Workaround to set the "background" property. */
    --button-disabled-background-color: transparent;
    --button-disabled-text-color: var(--input-action-button-color);
}

.input-group .input-clearer-button {
    background: transparent !important;
}

.input-group .input-group-text {
    /* Background color hijack */
    --accented-background-color: transparent;

    border: none;
    color: var(--input-placeholder-color);
    user-select: none;
    cursor: default;
}

.input-group .input-group-text:not(button):not(a):not(.bx) {
    font-style: italic;
}

:root .input-group > pre[aria-hidden="true"] {
    margin: 0;
    padding: 0;
}

/* Combo box-like dropdown buttons */

.select-button.dropdown-toggle::after {
    /* Remove the original arrow */
    content: unset;
}

/* Combo boxes and combo box-like dropdown buttons */

select,
select.form-select,
select.form-control,
.select-button.dropdown-toggle.btn,
:root .ck.ck-labeled-field-view__input-wrapper > .ck.ck-dropdown > button.ck.ck-dropdown__button,
:root .ck.ck-emoji__skin-tone > .ck.ck-dropdown > button.ck.ck-dropdown__button {
    --dropdown-arrow: var(--select-arrow-svg) right 0.75rem center/15px 20px no-repeat;

    outline: 3px solid transparent;
    outline-offset: 6px;
    padding-inline-end: calc(15px + 1.5rem);
    background: var(--input-background-color) var(--dropdown-arrow);;
    color: var(--input-text-color);
    border: unset;
    border-radius: 0.375rem;
}

body[dir=rtl] select,
body[dir=rtl] select.form-select,
body[dir=rtl] select.form-control,
body[dir=rtl] .select-button.dropdown-toggle.btn,
:root body[dir=rtl] .ck.ck-labeled-field-view__input-wrapper > .ck.ck-dropdown
    > button.ck.ck-dropdown__button,
:root body[dir=rtl] .ck.ck-emoji__skin-tone > .ck.ck-dropdown > button.ck.ck-dropdown__button {
    background-position: left 0.75rem center;
}

select:hover,
select.form-select:hover,
select.form-control:hover,
.select-button.dropdown-toggle.btn:hover,
:root .ck.ck-labeled-field-view__input-wrapper > .ck.ck-dropdown
    > button.ck.ck-dropdown__button:hover,
:root .ck.ck-emoji__skin-tone > .ck.ck-dropdown > button.ck.ck-dropdown__button:hover {
    background: var(--input-hover-background) var(--dropdown-arrow,);
    color: var(--input-hover-color);
}

button.select-button.dropdown-toggle.btn:active,
:root .ck.ck-labeled-field-view__input-wrapper > .ck.ck-dropdown
    > button.ck.ck-dropdown__button:active,
:root .ck.ck-emoji__skin-tone > .ck.ck-dropdown > button.ck.ck-dropdown__button:active {
    background-color: transparent;
    color: var(--select-focus-text-color);
}

select:focus,
select.form-select:focus,
select.form-control:focus,
.select-button.dropdown-toggle.btn:focus,
.select-button.focus-outline:focus,
:root .ck.ck-labeled-field-view__input-wrapper > .ck.ck-dropdown
    > button.ck.ck-dropdown__button:is(:focus, .ck-on),
:root .ck.ck-emoji__skin-tone > .ck.ck-dropdown
    > button.ck.ck-dropdown__button:is(:focus, .ck-on) {
    box-shadow: unset;
    outline: 3px solid var(--input-focus-outline-color);
    outline-offset: 0;
    background: var(--select-focus-background) var(--dropdown-arrow);
    color: var(--select-focus-text-color);
    transition:
        outline-color 50ms linear,
        outline-offset 200ms ease-out;
}

select:disabled,
select.form-select:disabled,
select.form-control:disabled,
:root .ck.ck-labeled-field-view__input-wrapper > .ck.ck-dropdown
    > button.ck.ck-dropdown__button.ck-disabled,
:root .ck.ck-emoji__skin-tone > .ck.ck-dropdown > button.ck.ck-dropdown__button.ck-disabled {
    background: var(--input-background-color) var(--dropdown-arrow);
    color: var(--input-text-color);
    opacity: 0.65;
}

option {
    color: var(--select-dropdown-text-color);
}

optgroup {
    color: var(--select-group-heading-text-color);
    font-size: 0.75em;
    font-weight: normal;
    font-style: normal;
    line-height: 40px;
}

/*
 * File input
 *
 * <label class="tn-file-input tn-input-field">
 *     <input type="file" />
 * </label>
 */

.tn-file-input {
    position: relative;
    padding: 0.375rem 2.25rem 0.375rem 0.75rem;
}

.tn-file-input input[type="file"] {
    background: transparent;
}

.tn-file-input input[type="file"]::file-selector-button {
    /* Hide the "Browse..." button */
    display: none;
}

.tn-file-input:hover input[type="file"] {
    color: var(--input-hover-color);
}

.tn-file-input input[type="file"]:focus,
.tn-file-input input[type="file"]:active {
    outline: none;
    color: var(--input-focus-color);
}

/* The browse icon */
.tn-file-input::before {
    display: flex;
    position: absolute;
    justify-content: center;
    align-items: center;
    content: "\eae1";
    width: 2em;
    height: 100%;
    inset-inline-end: 0;
    top: 0;
    font-size: 1.2em;
    font-family: boxicons;
}

/* Switches */

.switch-widget.component {
    --icon-button-size: 28px;
}

div.switch-widget,
:root .ck.ck-switchbutton {
    --switch-off-track-background: var(--cmd-button-background-color);
    --switch-on-track-background: var(--cmd-button-text-color);

    --switch-off-thumb-background: var(--cmd-button-text-color);
    --switch-on-thumb-background: var(--main-background-color);
}

/* Links. `:where(:not(.excalidraw *))` leaves out the menus of an embedded canvas drawing. */

body a.tn-link,
body a.tn-link:visited,
.use-tn-links a:where(:not(.excalidraw *)),
.use-tn-links a:visited:where(:not(.excalidraw *)) {
    --background: transparent;

    box-shadow: 0 0 0 0 var(--background);
    border-radius: 4px;
    background: var(--background);
    color: var(--link-color);
    font-weight: 500;
    text-decoration: none;

    transition:
        background-color 200ms ease-out,
        box-shadow 200ms ease-out,
        color 300ms ease-out;
}

body a.tn-link:focus-visible,
.use-tn-links a:focus-visible:where(:not(.excalidraw *)) {
    outline: 2px solid var(--input-focus-outline-color);
    outline-offset: 2px;
}

body a.tn-link:hover,
.use-tn-links a:hover:where(:not(.excalidraw *)),
.use-tn-links a.ck-widget_selected {
    box-shadow: 0 0 0 4px var(--link-hover-background);
    --background: var(--link-hover-background);
    color: var(--link-hover-color);
    text-decoration: underline;

    transition:
        background-color 100ms ease-in,
        box-shadow 100ms ease-in,
        color 150ms ease-in;
}

a.tn-link.external:not(.no-arrow)::after,
a.tn-link[href^="http://"]:not(.no-arrow)::after,
a.tn-link[href^="https://"]:not(.no-arrow)::after,
.use-tn-links a.external:not(.no-arrow):where(:not(.excalidraw *))::after,
.use-tn-links a[href^="http://"]:not(.no-arrow):where(:not(.excalidraw *))::after,
.use-tn-links a[href^="https://"]:not(.no-arrow):where(:not(.excalidraw *))::after
{
    display: inline-block;
    opacity: 0.5;
}

@keyframes link-arrow-blink {
    from {
        opacity: 1;
    }
    to {
        opacity: 0.5;
    }
}

a.tn-link:hover.external:not(.no-arrow)::after,
a.tn-link:hover[href^="http://"]:not(.no-arrow)::after,
a.tn-link:hover[href^="https://"]:not(.no-arrow)::after,
.use-tn-links a:hover.external:not(.no-arrow):where(:not(.excalidraw *))::after,
.use-tn-links a:hover[href^="http://"]:not(.no-arrow):where(:not(.excalidraw *))::after,
.use-tn-links a:hover[href^="https://"]:not(.no-arrow):where(:not(.excalidraw *))::after
{
    animation: link-arrow-blink 500ms linear alternate infinite;
}

/*
 * Range inputs (sliders)
 */

input[type="range"] {
    background: transparent;
}

/*
 * Centered forms
 */

.tn-centered-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20vh;
}

.tn-centered-form .form-group {
    text-align: center;
    color: var(--muted-text-color);
}

.tn-centered-form .form-icon {
    font-size: 140px;
    color: var(--main-border-color);
}

.tn-centered-form .protected-session-password {
    margin-inline: auto;
    max-width: 350px;
    text-align: center;
}

.tn-centered-form .input-group,
.tn-centered-form button {
    margin-top: 12px;
}