mirror of
https://github.com/raven-pensieve/obsidian-ace-code-editor.git
synced 2026-07-22 05:48:56 +00:00
136 lines
2.6 KiB
CSS
136 lines
2.6 KiB
CSS
.ace-embed-view {
|
|
position: relative;
|
|
margin: 0.7rem;
|
|
border: 1px dashed var(--background-modifier-border-focus);
|
|
border-radius: 8px;
|
|
|
|
.ace-embed-header {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
padding: 8px 12px;
|
|
border-bottom: 1px solid var(--background-modifier-border);
|
|
background: var(--background-secondary);
|
|
border-radius: 8px 8px 0 0;
|
|
}
|
|
|
|
.ace-embed-title {
|
|
font-size: 0.9rem;
|
|
font-weight: 500;
|
|
color: var(--text-normal);
|
|
margin: 0;
|
|
flex: 1;
|
|
}
|
|
|
|
.ace-embed-header-right {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
}
|
|
|
|
.ace-embed-language-label {
|
|
color: var(--text-muted);
|
|
font-size: 0.7rem;
|
|
font-weight: 500;
|
|
font-family: var(--font-monospace);
|
|
background: var(--background-primary);
|
|
padding: 2px 6px;
|
|
border-radius: 4px;
|
|
opacity: 0.8;
|
|
}
|
|
|
|
.ace-embed-link {
|
|
display: flex;
|
|
align-items: center;
|
|
cursor: pointer;
|
|
color: var(--text-muted);
|
|
transition: color 0.2s ease;
|
|
padding: 4px;
|
|
border-radius: 4px;
|
|
|
|
&:hover {
|
|
color: var(--text-normal);
|
|
background: var(--background-modifier-hover);
|
|
}
|
|
}
|
|
|
|
.ace-embed-editor {
|
|
width: 100%;
|
|
border-radius: 0 0 8px 8px;
|
|
overflow: hidden;
|
|
}
|
|
}
|
|
|
|
/* 行范围嵌入容器样式 */
|
|
.ace-embed-container {
|
|
display: block;
|
|
margin: 1rem 0;
|
|
}
|
|
|
|
/* ─── 远程代码嵌入样式 ─── */
|
|
|
|
/* 远程嵌入视图容器:使用 accent 色边框区分本地嵌入 */
|
|
.ace-embed-remote-view {
|
|
border-color: var(--interactive-accent);
|
|
|
|
&.mod-empty-attachment {
|
|
padding: 0rem;
|
|
}
|
|
}
|
|
|
|
/* 远程嵌入标题修饰:显示外链图标和 accent 色 */
|
|
.ace-embed-remote-title {
|
|
color: var(--text-accent);
|
|
font-style: italic;
|
|
|
|
&::before {
|
|
content: "\2197\00a0"; /* ↗ + nbsp */
|
|
opacity: 0.6;
|
|
}
|
|
}
|
|
|
|
/* ─── 加载状态 ─── */
|
|
.ace-embed-loading {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
padding: 2rem;
|
|
color: var(--text-muted);
|
|
font-size: 0.9rem;
|
|
gap: 8px;
|
|
|
|
&::before {
|
|
content: "";
|
|
width: 16px;
|
|
height: 16px;
|
|
border: 2px solid var(--background-modifier-border);
|
|
border-top-color: var(--interactive-accent);
|
|
border-radius: 50%;
|
|
animation: ace-embed-spin 0.8s linear infinite;
|
|
}
|
|
}
|
|
|
|
@keyframes ace-embed-spin {
|
|
to {
|
|
transform: rotate(360deg);
|
|
}
|
|
}
|
|
|
|
/* ─── 错误状态 ─── */
|
|
.ace-embed-error {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
justify-content: center;
|
|
padding: 1.5rem;
|
|
color: var(--text-error);
|
|
font-size: 0.85rem;
|
|
gap: 4px;
|
|
|
|
.ace-embed-error-msg {
|
|
font-family: var(--font-monospace);
|
|
font-size: 0.8rem;
|
|
color: var(--text-muted);
|
|
word-break: break-all;
|
|
}
|
|
}
|