mirror of
https://github.com/kunalja/VariantEditor.git
synced 2026-07-22 13:00:32 +00:00
234 lines
5.2 KiB
CSS
234 lines
5.2 KiB
CSS
/* Variant Editor Plugin Styles */
|
|
|
|
/* Dimmed lines */
|
|
.markdown-source-view .cm-line.fh-dim,
|
|
.cm-line.fh-dim {
|
|
opacity: 0.25;
|
|
}
|
|
|
|
/* Active line (contains the selected text) */
|
|
.markdown-source-view .cm-line.fh-active {
|
|
opacity: 1 !important;
|
|
position: relative;
|
|
z-index: 1;
|
|
background-color: var(--background-primary);
|
|
border-radius: 2px;
|
|
box-shadow: 0 0 0 1px var(--background-modifier-border);
|
|
}
|
|
|
|
/* When in sentence mode, make the active line more subtle */
|
|
.markdown-source-view .cm-line.fh-active:not(.fh-dim) {
|
|
background-color: var(--background-primary);
|
|
box-shadow: none;
|
|
}
|
|
|
|
/* Highlighted text */
|
|
.fh-highlight {
|
|
background-color: var(--text-highlight-bg);
|
|
color: var(--text-normal) !important;
|
|
/* Use the same styling approach as native selection */
|
|
padding: 0;
|
|
margin: 0;
|
|
border-radius: 0;
|
|
z-index: 1;
|
|
position: relative;
|
|
box-shadow: none;
|
|
}
|
|
|
|
/* Make highlighted text stand out even when selected */
|
|
.cm-line .cm-selectionBackground ~ .fh-highlight,
|
|
.cm-line .cm-selectionBackground + .fh-highlight,
|
|
.cm-line .fh-highlight.cm-selectionBackground {
|
|
background-color: rgba(255, 207, 64, 0.6) !important; /* Lighter yellow that shows through selection */
|
|
mix-blend-mode: normal;
|
|
opacity: 1;
|
|
}
|
|
|
|
/* Variant indicator styles */
|
|
.variant-indicator {
|
|
background-color: rgba(121, 184, 255, 0.2);
|
|
border-bottom: 1px dashed #79b8ff;
|
|
border-radius: 2px;
|
|
position: relative;
|
|
}
|
|
|
|
/* Hide variant syntax parts */
|
|
.variant-syntax-start,
|
|
.variant-syntax-end,
|
|
.variant-inactive-option {
|
|
display: inline;
|
|
color: transparent;
|
|
font-size: 0;
|
|
position: relative;
|
|
pointer-events: auto;
|
|
cursor: text;
|
|
}
|
|
|
|
/* Show a small indicator for hidden parts when hovered */
|
|
.variant-syntax-start:hover,
|
|
.variant-syntax-end:hover,
|
|
.variant-inactive-option:hover {
|
|
background-color: rgba(121, 184, 255, 0.3);
|
|
}
|
|
|
|
/* Active variant option */
|
|
.variant-active-option {
|
|
display: inline;
|
|
background-color: rgba(121, 184, 255, 0.2);
|
|
border-bottom: 1px dashed #79b8ff;
|
|
border-radius: 2px;
|
|
position: relative;
|
|
pointer-events: auto;
|
|
cursor: text;
|
|
z-index: 5;
|
|
}
|
|
|
|
/* Modal styles */
|
|
.variant-editor-container {
|
|
margin-bottom: 15px;
|
|
max-height: 300px;
|
|
overflow-y: auto;
|
|
padding-right: 5px;
|
|
}
|
|
|
|
.variant-editor-row {
|
|
display: flex;
|
|
align-items: center;
|
|
margin-bottom: 8px;
|
|
padding: 6px;
|
|
border-radius: 4px;
|
|
background-color: var(--background-primary-alt);
|
|
}
|
|
|
|
.variant-editor-radio-container {
|
|
margin-right: 8px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
|
|
.variant-editor-radio {
|
|
width: 16px;
|
|
height: 16px;
|
|
cursor: pointer;
|
|
accent-color: var(--interactive-accent);
|
|
}
|
|
|
|
.variant-editor-label {
|
|
width: 80px;
|
|
font-weight: 500;
|
|
color: var(--text-normal);
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.variant-editor-input {
|
|
flex-grow: 1;
|
|
padding: 6px 10px;
|
|
border-radius: 4px;
|
|
border: 1px solid var(--background-modifier-border);
|
|
background-color: var(--background-primary);
|
|
font-family: var(--font-text);
|
|
}
|
|
|
|
.variant-editor-input:focus {
|
|
border-color: var(--interactive-accent);
|
|
box-shadow: 0 0 0 2px rgba(var(--interactive-accent-rgb), 0.2);
|
|
outline: none;
|
|
}
|
|
|
|
.variant-editor-delete-button {
|
|
margin-left: 8px;
|
|
width: 24px;
|
|
height: 24px;
|
|
border-radius: 50%;
|
|
background-color: var(--background-modifier-error-rgb);
|
|
color: white;
|
|
border: none;
|
|
cursor: pointer;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
font-size: 16px;
|
|
padding: 0;
|
|
line-height: 1;
|
|
}
|
|
|
|
.variant-editor-delete-button:hover {
|
|
background-color: var(--text-error);
|
|
}
|
|
|
|
.variant-editor-add-container {
|
|
margin-bottom: 15px;
|
|
}
|
|
|
|
.variant-editor-add-button {
|
|
background-color: var(--interactive-accent) !important;
|
|
color: var(--text-on-accent) !important;
|
|
padding: 4px 12px !important;
|
|
}
|
|
|
|
.variant-editor-buttons {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
margin-top: 20px;
|
|
gap: 10px;
|
|
}
|
|
|
|
.variant-editor-button {
|
|
flex: 1;
|
|
padding: 8px 12px !important;
|
|
}
|
|
|
|
.variant-editor-commit-button {
|
|
background-color: var(--color-green) !important;
|
|
color: var(--text-on-accent) !important;
|
|
}
|
|
|
|
.variant-editor-original-text {
|
|
margin-bottom: 15px;
|
|
font-weight: 500;
|
|
color: var(--text-normal);
|
|
padding: 8px;
|
|
background-color: var(--background-secondary);
|
|
border-radius: 4px;
|
|
}
|
|
|
|
.variant-editor-hint {
|
|
margin-top: 10px;
|
|
margin-bottom: 10px;
|
|
color: var(--text-muted);
|
|
font-size: 0.9em;
|
|
}
|
|
|
|
/* Style the variant editor modal */
|
|
.variant-editor-modal {
|
|
width: 400px !important;
|
|
max-width: 90vw !important;
|
|
max-height: 80vh !important;
|
|
overflow-y: auto !important;
|
|
box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15) !important;
|
|
border: 1px solid var(--background-modifier-border) !important;
|
|
}
|
|
|
|
/* When modal is positioned above the highlighted line, make it grow upward */
|
|
.variant-editor-modal-above .variant-editor-flex-container {
|
|
display: flex !important;
|
|
flex-direction: column-reverse !important;
|
|
}
|
|
|
|
.variant-editor-flex-container {
|
|
display: flex;
|
|
flex-direction: column;
|
|
}
|
|
|
|
/* Remove background dimming for variant editor modal */
|
|
.variant-editor-no-dim ~ .modal-bg {
|
|
background-color: transparent !important;
|
|
backdrop-filter: none !important;
|
|
}
|
|
|
|
.variant-editor-textarea:focus {
|
|
outline: none;
|
|
border-color: var(--interactive-accent);
|
|
box-shadow: 0 0 0 2px rgba(var(--interactive-accent-rgb), 0.2);
|
|
}
|