uthvah_sync-embeds/styles.css

471 lines
10 KiB
CSS
Raw Permalink Normal View History

2025-11-17 22:28:28 +00:00
/* === SYNC CONTAINER === */
2025-09-18 01:17:09 +00:00
.sync-container {
border: 1px solid var(--background-modifier-border);
border-radius: 8px;
background: var(--background-primary);
margin: 12px 0;
display: flex;
flex-direction: column;
2025-11-17 22:28:28 +00:00
gap: var(--sync-gap, 16px);
padding: 16px;
2025-09-18 01:17:09 +00:00
}
2025-11-17 22:28:28 +00:00
/* === EMBED WRAPPER === */
2025-09-18 01:17:09 +00:00
.sync-embed {
border: none !important; /* Normal embeds get no border */
2025-09-18 01:17:09 +00:00
margin: 0 !important;
padding: 0 !important;
background: transparent !important;
box-shadow: none !important;
2025-11-17 22:28:28 +00:00
height: var(--sync-embed-height, auto);
max-height: var(--sync-max-height, none);
overflow-y: auto;
overflow-x: hidden;
2025-11-17 22:28:28 +00:00
position: relative;
}
/* Callout view applies the border to the embed container */
.sync-embed.is-callout-style {
border: 1px solid var(--background-modifier-border) !important;
border-radius: 4px; /* Optional rounding for callouts */
}
/* === UNIFIED UI HEADER === */
.sync-embed-header {
font-size: var(--inline-title-size, var(--h1-size, 2em));
font-weight: var(--inline-title-weight, var(--h1-weight, 700));
line-height: var(--inline-title-line-height, var(--h1-line-height, 1.3));
color: var(--inline-title-color, var(--h1-color, var(--text-normal)));
font-family: var(--inline-title-font, var(--h1-font, var(--font-text)));
font-variant: var(--h1-variant, normal);
letter-spacing: var(--h1-letter-spacing, normal);
/* Matches body content padding */
padding-top: 14px !important;
padding-left: 16px !important;
padding-right: 16px !important;
margin-bottom: 0;
user-select: none !important;
cursor: default !important;
background: transparent !important;
border: none !important;
box-shadow: none !important;
outline: none !important;
}
.theme-dark .sync-embed-header,
.theme-light .sync-embed-header {
color: var(--inline-title-color, var(--h1-color, var(--text-normal)));
}
/* === STICKY CALLOUT HEADER VARIANT === */
.sync-embed-header.is-sticky {
position: sticky;
top: 0;
z-index: 1000;
background-color: var(--background-primary) !important;
/* ALIGNMENT: 16px left to match body, 40px right for fold icon */
padding: 8px 40px 8px 16px !important;
font-size: var(--inline-title-size);
display: flex !important;
align-items: center !important;
gap: 8px !important;
box-shadow: 0 1px 2px rgba(0,0,0,0.05);
cursor: pointer;
border-bottom: 1px solid var(--background-modifier-border) !important;
}
.sync-embed-header.is-sticky:hover {
background-color: var(--background-primary-alt) !important;
}
.sync-embed-header.is-sticky a.internal-link {
text-decoration: none;
color: var(--text-accent) !important;
font-weight: 600 !important;
display: block;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.sync-embed-header.is-sticky a.internal-link:hover {
text-decoration: underline;
color: var(--text-accent-hover) !important;
}
/* === FOLD ICON === */
.sync-embed-fold {
display: flex;
align-items: center;
justify-content: center;
transition: transform 0.2s ease-in-out;
}
.sync-embed-fold svg {
color: var(--text-muted);
}
/* === COLLAPSED STATE === */
.sync-embed.is-collapsed {
height: auto !important;
min-height: 0 !important;
max-height: none !important;
overflow: hidden !important;
}
/* Hide everything except header when collapsed */
.sync-embed.is-collapsed .view-content,
.sync-embed.is-collapsed .markdown-source-view {
display: none !important;
}
/* Remove bottom border of header when collapsed */
.sync-embed.is-collapsed .sync-embed-header.is-sticky {
border-bottom: none !important;
}
/* Rotate fold icon when collapsed */
.sync-embed.is-collapsed .sync-embed-fold {
transform: rotate(-90deg);
2025-11-17 22:28:28 +00:00
}
/* Gap between embeds */
.sync-embed-gap {
padding-top: var(--sync-gap, 16px);
border-top: 1px solid var(--background-modifier-border-hover);
2025-09-18 01:17:09 +00:00
}
/* === PADDING SYSTEM === */
2025-09-18 01:17:09 +00:00
.sync-embed .view-header {
display: none !important;
}
2025-11-17 22:28:28 +00:00
.sync-embed .view-content {
background-color: transparent !important;
padding: 0 !important;
}
2025-09-18 01:17:09 +00:00
.sync-embed .markdown-source-view,
.sync-embed .cm-editor,
.sync-embed .cm-scroller {
background-color: transparent !important;
padding: 0 !important;
margin: 0 !important;
}
/* 16px padding creates a flush left edge */
2025-11-17 22:28:28 +00:00
.sync-embed .cm-content {
background-color: transparent !important;
/* padding-top: 12px !important; */
padding-bottom: 12px !important;
padding-left: 16px !important;
padding-right: 16px !important;
max-width: none !important;
margin-left: 0 !important;
margin-right: 0 !important;
2025-11-17 22:28:28 +00:00
}
/* Applying general padding to the container keeps both line numbers and content vertically aligned */
.sync-embed .cm-contentContainer {
padding-top: 12px !important;
padding-left: 0 !important;
padding-right: 0 !important;
}
2025-09-18 01:17:09 +00:00
.sync-embed .markdown-source-view.mod-cm6 .cm-editor {
2025-09-18 21:28:14 +00:00
width: 100%;
2025-09-18 01:17:09 +00:00
}
2025-11-17 22:28:28 +00:00
.sync-embed .cm-sizer {
padding: 0 !important;
max-width: none !important;
}
/* Neutralize readable-line-width margin applied per-line by Obsidian */
.sync-embed .markdown-source-view.mod-cm6 .cm-contentContainer > .cm-content > div.cm-line {
margin-inline: 0 !important;
max-width: none !important;
width: auto !important;
2025-09-18 01:17:09 +00:00
}
/* === HIDE NATIVE INLINE TITLE COMPLETELY === */
2025-11-17 22:28:28 +00:00
.sync-embed .inline-title {
display: none !important;
}
/* === PROPERTIES/FRONTMATTER === */
/* Scoped properly to prevent affecting parent note */
.sync-embed .metadata-container {
/* ALIGNMENT: Matches header and body padding */
padding-left: 16px !important;
padding-right: 16px !important;
margin-block-end: 0;
2025-09-22 12:26:55 +00:00
}
2025-11-17 22:28:28 +00:00
.metadata-container.is-collapsed .metadata-content {
display: none;
}
/* === SECTION EMBEDS === */
.sync-embed .cm-header-1,
.sync-embed .HyperMD-header-1 {
color: var(--h1-color, var(--text-normal)) !important;
}
.sync-embed .cm-header-2,
.sync-embed .HyperMD-header-2 {
color: var(--h2-color, var(--text-normal)) !important;
}
.sync-embed .cm-header-3,
.sync-embed .HyperMD-header-3 {
color: var(--h3-color, var(--text-normal)) !important;
}
.sync-embed .cm-header-4,
.sync-embed .HyperMD-header-4 {
color: var(--h4-color, var(--text-normal)) !important;
}
.sync-embed .cm-header-5,
.sync-embed .HyperMD-header-5 {
color: var(--h5-color, var(--text-normal)) !important;
}
.sync-embed .cm-header-6,
.sync-embed .HyperMD-header-6 {
color: var(--h6-color, var(--text-normal)) !important;
}
.sync-embed .cm-scroller {
overflow-x: hidden !important;
scroll-behavior: smooth;
}
/* === LOADING STATE === */
.sync-embed-loading {
min-height: 100px;
display: flex;
align-items: center;
justify-content: center;
}
.sync-embed-placeholder {
padding: 20px;
text-align: center;
color: var(--text-muted);
font-style: italic;
animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
0%, 100% { opacity: 0.6; }
50% { opacity: 1; }
}
/* === ERROR STATE === */
2025-09-18 01:17:09 +00:00
.sync-empty {
padding: 20px;
text-align: center;
color: var(--text-muted);
font-style: italic;
}
.sync-embed-error {
2025-11-17 22:28:28 +00:00
padding: 12px 16px;
2025-09-18 01:17:09 +00:00
background: var(--background-modifier-error);
border: 1px solid var(--background-modifier-border);
border-radius: 4px;
color: var(--text-error);
2025-11-17 22:28:28 +00:00
margin: 4px 0;
font-size: 0.9em;
}
/* === FOCUS HIGHLIGHT === */
.sync-embed {
outline: 2px solid transparent;
outline-offset: 2px;
border-radius: 4px;
transition: outline-color 0.1s ease;
}
.sync-embed:focus-within {
outline-color: var(--interactive-accent);
}
body.sync-embeds-no-focus-highlight .sync-embed:focus-within {
outline-color: transparent;
}
body.sync-embeds-hide-linked-mentions .sync-embed .embedded-backlinks {
display: none !important;
}
2025-11-17 22:28:28 +00:00
/* === SCROLLBAR === */
.sync-embed::-webkit-scrollbar {
width: 8px;
height: 8px;
}
.sync-embed::-webkit-scrollbar-track {
background: transparent;
}
.sync-embed::-webkit-scrollbar-thumb {
background: var(--background-modifier-border);
border-radius: 4px;
transition: background 0.2s ease;
}
.sync-embed::-webkit-scrollbar-thumb:hover {
background: var(--background-modifier-border-hover);
}
.sync-embed {
scrollbar-width: thin;
scrollbar-color: var(--background-modifier-border) transparent;
}
/* === HELP SECTION === */
.sync-embeds-help {
background: var(--background-secondary);
padding: 16px;
border-radius: 8px;
margin-top: 12px;
line-height: 1.6;
}
.sync-embeds-help h4 {
margin-top: 12px;
margin-bottom: 8px;
color: var(--text-normal);
}
.sync-embeds-help ul {
margin-left: 20px;
margin-top: 8px;
margin-bottom: 12px;
}
.sync-embeds-help li {
margin-bottom: 4px;
}
.sync-embeds-help code {
background: var(--background-primary-alt);
padding: 2px 6px;
border-radius: 3px;
font-family: var(--font-monospace);
font-size: 0.9em;
color: var(--code-normal);
}
.sync-embeds-help pre {
background: var(--background-primary-alt);
padding: 12px;
border-radius: 4px;
margin-top: 8px;
margin-bottom: 12px;
overflow-x: auto;
}
.sync-embeds-help pre code {
background: transparent;
padding: 0;
}
.sync-embeds-help p {
margin: 8px 0;
}
.sync-embeds-help em {
color: var(--text-muted);
font-size: 0.9em;
}
.sync-embeds-help strong {
color: var(--text-normal);
}
/* === RESPONSIVE === */
@media (max-width: 768px) {
.sync-container {
padding: 12px;
gap: 12px;
}
.sync-embed-gap {
padding-top: 12px;
}
.sync-embed-header {
2025-11-17 22:28:28 +00:00
font-size: calc(var(--inline-title-size, var(--h1-size, 2em)) * 0.85);
}
}
/* === THEME COMPATIBILITY === */
.theme-light .sync-embed,
.theme-dark .sync-embed {
color: var(--text-normal);
}
.sync-embed .cm-link,
.sync-embed .cm-hmd-internal-link {
color: var(--link-color, var(--text-accent)) !important;
}
.sync-embed .cm-url {
color: var(--link-external-color, var(--text-accent)) !important;
}
/* === ACCESSIBILITY === */
@media (prefers-contrast: high) {
.sync-container {
border-width: 2px;
}
.sync-embed:focus-within {
outline-width: 3px;
}
.sync-embed-error {
border-width: 2px;
}
}
@media (prefers-reduced-motion: reduce) {
.sync-embed-placeholder {
animation: none;
opacity: 0.8;
}
.sync-embed,
.sync-embed::-webkit-scrollbar-thumb {
transition: none;
}
.sync-embed .cm-scroller {
scroll-behavior: auto;
}
}
/* === PRINT === */
@media print {
.sync-container {
border: 1px solid #cccccc;
2025-11-17 22:28:28 +00:00
page-break-inside: avoid;
}
.sync-embed {
max-height: none !important;
overflow: visible !important;
}
.metadata-container.is-collapsed .metadata-content {
display: block;
}
2025-09-18 01:17:09 +00:00
}