core/panel/styles/CodePreview.module.css

162 lines
2.9 KiB
CSS
Raw Normal View History

2025-06-30 18:25:26 +00:00
.codePreview {
position: relative;
padding-left: 50px !important;
background-color: #2d2d2d;
color: #f8f8f2;
tab-size: 2;
2025-07-01 06:10:32 +00:00
line-height: 1.4;
2025-06-30 18:25:26 +00:00
border-radius: 4px;
overflow: hidden;
2025-07-01 06:10:32 +00:00
font-size: 12px;
2025-06-30 18:25:26 +00:00
}
.lineNumber {
2025-07-01 06:10:32 +00:00
display: block;
padding: 0 8px;
2025-06-30 18:25:26 +00:00
text-align: right;
2025-07-01 06:10:32 +00:00
color: #555;
background: #1e1e1e;
2025-06-30 18:25:26 +00:00
user-select: none;
2025-07-01 06:10:32 +00:00
font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
font-size: 11px;
line-height: 1.4;
min-height: 16.8px; /* 12px * 1.4 line-height */
2025-06-30 18:25:26 +00:00
border-right: 1px solid rgba(255, 255, 255, 0.1);
2025-07-01 06:10:32 +00:00
opacity: 0.7;
pointer-events: none;
}
.lineNumbersContainer {
overflow: hidden;
}
.lineNumbersContainer .lineNumber {
border-right: none;
2025-06-30 18:25:26 +00:00
}
.code {
display: block;
overflow-x: auto;
}
.languageBadge {
position: absolute;
top: 8px;
right: 8px;
font-size: 0.7em;
background-color: rgba(0,0,0,0.7);
color: #fff;
padding: 2px 6px;
border-radius: 4px;
z-index: 100;
}
/* Стили для EditableCodePreview */
.editableCodeContainer {
position: relative;
background-color: #2d2d2d;
border-radius: 6px;
overflow: hidden;
2025-07-01 06:10:32 +00:00
height: 100%;
display: flex;
flex-direction: column;
2025-06-30 18:25:26 +00:00
}
.editorControls {
display: flex;
justify-content: flex-end;
padding: 8px 12px;
background-color: #1e1e1e;
2025-07-01 06:10:32 +00:00
border-top: 1px solid rgba(255, 255, 255, 0.1);
border-bottom: none;
order: 2; /* Перемещаем вниз */
2025-06-30 18:25:26 +00:00
}
.editingControls {
display: flex;
gap: 8px;
}
.editButton {
background: rgba(0, 122, 204, 0.8);
color: white;
border: none;
padding: 6px 12px;
border-radius: 4px;
cursor: pointer;
font-size: 12px;
transition: background-color 0.2s;
}
.editButton:hover {
background: rgba(0, 122, 204, 1);
}
.saveButton {
background: rgba(40, 167, 69, 0.8);
color: white;
border: none;
padding: 6px 12px;
border-radius: 4px;
cursor: pointer;
font-size: 12px;
transition: background-color 0.2s;
}
.saveButton:hover {
background: rgba(40, 167, 69, 1);
}
.cancelButton {
background: rgba(220, 53, 69, 0.8);
color: white;
border: none;
padding: 6px 12px;
border-radius: 4px;
cursor: pointer;
font-size: 12px;
transition: background-color 0.2s;
}
.cancelButton:hover {
background: rgba(220, 53, 69, 1);
}
.editorWrapper {
position: relative;
overflow: hidden;
background-color: #2d2d2d;
transition: border 0.2s;
2025-07-01 06:10:32 +00:00
flex: 1;
order: 1; /* Основной контент вверху */
2025-06-30 18:25:26 +00:00
}
.syntaxHighlight {
width: 100%;
height: 100%;
tab-size: 2;
2025-07-01 06:10:32 +00:00
font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
font-size: 12px;
line-height: 1.4;
2025-06-30 18:25:26 +00:00
}
.editorArea {
resize: none;
border: none;
width: 100%;
height: 100%;
tab-size: 2;
2025-07-01 06:10:32 +00:00
font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
font-size: 12px;
line-height: 1.4;
2025-06-30 18:25:26 +00:00
}
.editorArea:focus {
outline: none;
}
.placeholder {
pointer-events: none;
user-select: none;
}