mirror of
https://github.com/zadam/trilium.git
synced 2026-01-12 09:34:26 +01:00
238 lines
6.3 KiB
CSS
238 lines
6.3 KiB
CSS
/**
|
|
* Math equation editor dialog styles
|
|
*/
|
|
|
|
/* ============================================================================
|
|
Main Dialog Container
|
|
========================================================================= */
|
|
|
|
.ck.ck-math-form {
|
|
display: flex;
|
|
flex-direction: column;
|
|
padding: var(--ck-spacing-standard);
|
|
box-sizing: border-box;
|
|
max-width: 80vw;
|
|
max-height: 80vh;
|
|
overflow: hidden;
|
|
}
|
|
|
|
/* Mobile responsiveness */
|
|
@media screen and (max-width: 600px) {
|
|
.ck.ck-math-form {
|
|
flex-wrap: wrap;
|
|
}
|
|
}
|
|
|
|
/* ============================================================================
|
|
Content Layout
|
|
========================================================================= */
|
|
|
|
.ck-math-view {
|
|
display: flex;
|
|
flex-direction: column;
|
|
flex: 1 1 auto;
|
|
gap: var(--ck-spacing-standard);
|
|
min-height: 0;
|
|
min-width: 0;
|
|
width: 100%;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.ck-math-button-row {
|
|
display: flex;
|
|
flex-shrink: 0;
|
|
gap: var(--ck-spacing-standard);
|
|
margin-top: var(--ck-spacing-standard);
|
|
width: fit-content;
|
|
max-width: 100%;
|
|
flex-wrap: wrap;
|
|
}
|
|
|
|
/* ============================================================================
|
|
Shared Styles for Input Fields
|
|
========================================================================= */
|
|
|
|
/* Base styling for both MathLive fields and textareas */
|
|
.ck.ck-math-form math-field,
|
|
.ck.ck-math-form textarea {
|
|
box-sizing: border-box;
|
|
font-size: var(--ck-font-size-base);
|
|
color: var(--ck-color-input-text, inherit);
|
|
background: transparent !important;
|
|
border: none !important;
|
|
border-radius: 0;
|
|
padding: 0;
|
|
margin: 0;
|
|
box-shadow: none !important;
|
|
outline: none !important;
|
|
outline-offset: 0 !important;
|
|
transition: none !important;
|
|
animation: none !important;
|
|
}
|
|
|
|
.ck.ck-math-input .ck-textarea,
|
|
.ck.ck-math-input .ck-textarea:focus,
|
|
.ck.ck-math-input .ck-textarea:hover {
|
|
transition: none !important;
|
|
box-shadow: none !important;
|
|
animation: none !important;
|
|
}
|
|
|
|
.ck.ck-math-form math-field:focus-within,
|
|
.ck.ck-math-form textarea:focus {
|
|
outline: none !important;
|
|
outline-offset: 0 !important;
|
|
box-shadow: none !important;
|
|
transition: none !important;
|
|
}
|
|
|
|
/* MathLive-specific configuration */
|
|
.ck.ck-math-form math-field {
|
|
display: block !important;
|
|
width: 100%;
|
|
max-width: 100%;
|
|
overflow-x: auto !important;
|
|
|
|
/* MathLive theme customization */
|
|
--selection-background-color: rgba(33, 150, 243, 0.2);
|
|
--selection-color: inherit;
|
|
--contains-highlight-background-color: rgba(0, 0, 0, 0.05);
|
|
}
|
|
|
|
/* ============================================================================
|
|
MathLive Configuration
|
|
========================================================================= */
|
|
|
|
/* Configure MathLive shadow DOM layout */
|
|
.ck.ck-math-form math-field::part(container),
|
|
.ck.ck-math-form math-field::part(content),
|
|
.ck.ck-math-form math-field::part(field) {
|
|
display: flex;
|
|
flex-direction: column;
|
|
flex: 1 1 auto;
|
|
height: 100%;
|
|
align-items: flex-start;
|
|
justify-content: flex-start;
|
|
}
|
|
|
|
/* Position MathLive UI controls */
|
|
.ck.ck-math-form math-field::part(virtual-keyboard-toggle),
|
|
.ck.ck-math-form math-field::part(menu-toggle) {
|
|
position: absolute;
|
|
top: 8px;
|
|
}
|
|
|
|
.ck.ck-math-form math-field::part(virtual-keyboard-toggle) {
|
|
right: 40px;
|
|
}
|
|
|
|
.ck.ck-math-form math-field::part(menu-toggle) {
|
|
right: 8px;
|
|
display: flex !important;
|
|
visibility: visible !important;
|
|
}
|
|
|
|
/* ============================================================================
|
|
Combined Math Input (MathLive + LaTeX Textarea)
|
|
========================================================================= */
|
|
|
|
.ck.ck-math-input {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: var(--ck-spacing-standard);
|
|
width: 100%;
|
|
flex: 1 1 auto;
|
|
min-height: 0;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.ck.ck-math-input .ck-mathlive-container {
|
|
display: flex;
|
|
width: 100%;
|
|
min-height: 50px;
|
|
flex-shrink: 0;
|
|
padding: var(--ck-spacing-small);
|
|
border: 1px solid var(--ck-color-input-border, #ccc);
|
|
border-radius: var(--ck-border-radius, 6px);
|
|
background: var(--ck-color-input-background) !important;
|
|
transition: border-color 120ms ease;
|
|
}
|
|
|
|
.ck.ck-math-input .ck-mathlive-container:focus-within {
|
|
border-color: var(--ck-color-focus-border, #1a73e8);
|
|
}
|
|
|
|
.ck.ck-math-input .ck-latex-wrapper {
|
|
display: flex;
|
|
flex-direction: column;
|
|
width: 100%;
|
|
min-height: 60px;
|
|
flex: 1 1 auto;
|
|
padding: var(--ck-spacing-small);
|
|
border: 1px solid var(--ck-color-input-border, #ccc);
|
|
border-radius: var(--ck-border-radius, 6px);
|
|
background: var(--ck-color-input-background) !important;
|
|
transition: border-color 120ms ease;
|
|
}
|
|
|
|
.ck.ck-math-input .ck-latex-wrapper:focus-within {
|
|
border-color: var(--ck-color-focus-border, #1a73e8);
|
|
}
|
|
|
|
.ck.ck-math-input .ck-latex-label {
|
|
display: block;
|
|
font-size: 12px;
|
|
font-weight: 600;
|
|
color: var(--ck-color-text, #333);
|
|
opacity: 0.8;
|
|
margin: 0 0 var(--ck-spacing-small) 0;
|
|
}
|
|
|
|
.ck.ck-math-input .ck-latex-textarea {
|
|
display: block;
|
|
width: 100%;
|
|
min-width: 100%;
|
|
min-height: 60px;
|
|
max-height: 100%;
|
|
flex: 1 1 auto;
|
|
resize: both;
|
|
overflow: auto;
|
|
font-family: monospace;
|
|
background: transparent !important;
|
|
border: none !important;
|
|
padding: 0;
|
|
box-shadow: none !important;
|
|
transition: none !important;
|
|
animation: none !important;
|
|
}
|
|
|
|
.ck.ck-math-input .ck-latex-textarea:focus {
|
|
outline: none;
|
|
box-shadow: none !important;
|
|
transition: none !important;
|
|
}
|
|
|
|
/* ============================================================================
|
|
Error State
|
|
========================================================================= */
|
|
|
|
.ck-math-render-error {
|
|
color: var(--ck-color-error-text, #db1d1d);
|
|
padding: var(--ck-spacing-small);
|
|
font-style: italic;
|
|
font-size: 0.9em;
|
|
border: 1px dashed var(--ck-color-error-text, #db1d1d);
|
|
border-radius: 2px;
|
|
background: var(--ck-color-base-background, #fff);
|
|
}
|
|
|
|
/* ============================================================================
|
|
Preview Section (always at bottom)
|
|
========================================================================= */
|
|
|
|
.ck-math-preview {
|
|
flex-shrink: 0;
|
|
overflow-x: auto;
|
|
overflow-y: hidden;
|
|
}
|