philemonchiro_obsidian-note.../styles.css
Philemon Chiro 06b3bd4a35 Initial release: Notekeeper 0.1.0
A Google Keep-style masonry card view for Obsidian. Quick capture, inline
edit, pin, color, archive, multi-select, lazy infinite scroll, smart
search, three densities, and a markdown-rendered preview modal.
2026-04-29 15:28:42 +02:00

1021 lines
19 KiB
CSS

/* ========== root ========== */
.keep-cards-root {
padding: 0 !important;
height: 100%;
display: flex;
flex-direction: column;
overflow: hidden;
position: relative;
}
/* ========== header ========== */
.keep-cards-header {
display: flex;
flex-direction: column;
gap: 14px;
flex-shrink: 0;
background: var(--background-primary);
padding: 12px 16px 12px;
border-bottom: 1px solid var(--background-modifier-border);
}
.keep-cards-header-top {
display: flex;
gap: 12px;
align-items: center;
}
.keep-cards-header-capture {
display: flex;
justify-content: center;
}
/* search */
.keep-cards-search-wrap {
flex: 1;
display: flex;
align-items: center;
border-radius: 8px;
border: 1px solid var(--background-modifier-border);
background: var(--background-secondary);
overflow: hidden;
height: 36px;
transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.keep-cards-search-wrap:focus-within {
border-color: var(--text-accent);
}
.keep-cards-search-icon {
display: inline-flex;
align-items: center;
justify-content: center;
padding: 0 10px 0 12px;
color: var(--text-faint);
}
.keep-cards-search-icon svg,
.keep-cards-search-icon .svg-icon {
width: 15px;
height: 15px;
}
.keep-cards-search {
flex: 1;
padding: 0 12px 0 0;
border: none;
background: transparent;
color: var(--text-normal);
font-size: 13px;
height: 100%;
outline: none;
}
/* sort button */
.keep-cards-sort-btn {
background: var(--background-secondary);
border: 1px solid var(--background-modifier-border);
color: var(--text-muted);
width: 36px;
height: 36px;
border-radius: 8px;
cursor: pointer;
display: inline-flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
padding: 0;
transition: background 0.12s ease, color 0.12s ease;
}
.keep-cards-sort-btn:hover {
background: var(--background-modifier-hover);
color: var(--text-normal);
}
.keep-cards-sort-btn.is-active {
background: var(--background-modifier-hover);
color: var(--text-accent);
border-color: var(--text-accent);
}
/* active filter chip */
.keep-cards-active-filter {
display: inline-flex;
align-items: center;
gap: 2px;
padding: 0 4px 0 12px;
height: 28px;
background: var(--background-modifier-hover);
border: 1px solid var(--background-modifier-border);
border-radius: 14px;
color: var(--text-normal);
font-size: 12px;
flex-shrink: 0;
}
.keep-cards-active-filter-label {
white-space: nowrap;
max-width: 180px;
overflow: hidden;
text-overflow: ellipsis;
}
.keep-cards-active-filter-x {
background: transparent;
border: none;
color: var(--text-muted);
width: 20px;
height: 20px;
border-radius: 50%;
cursor: pointer;
display: inline-flex;
align-items: center;
justify-content: center;
padding: 0;
margin-left: 2px;
}
.keep-cards-active-filter-x:hover {
background: var(--background-modifier-active-hover, var(--background-modifier-border));
color: var(--text-normal);
}
.keep-cards-active-filter-x svg,
.keep-cards-active-filter-x .svg-icon {
width: 12px;
height: 12px;
}
.keep-cards-sort-btn svg,
.keep-cards-sort-btn .svg-icon {
width: 16px;
height: 16px;
}
/* toolbar — segmented control */
.keep-cards-toolbar {
display: inline-flex;
align-items: stretch;
border: 1px solid var(--background-modifier-border);
border-radius: 8px;
overflow: hidden;
background: var(--background-secondary);
height: 36px;
flex-shrink: 0;
}
.keep-cards-tb-btn {
background: transparent;
border: none;
color: var(--text-muted);
width: 38px;
height: 100%;
border-radius: 0;
cursor: pointer;
display: inline-flex;
align-items: center;
justify-content: center;
padding: 0;
border-right: 1px solid var(--background-modifier-border);
transition: background 0.12s ease, color 0.12s ease;
}
.keep-cards-tb-btn:last-child {
border-right: none;
}
.keep-cards-tb-btn:hover {
background: var(--background-modifier-hover);
color: var(--text-normal);
}
.keep-cards-tb-btn.is-active {
background: var(--background-modifier-hover);
color: var(--text-accent);
}
.keep-cards-tb-btn svg,
.keep-cards-tb-btn .svg-icon {
width: 16px;
height: 16px;
}
/* capture */
.keep-cards-capture-wrap {
width: 100%;
max-width: 600px;
display: flex;
align-items: stretch;
border-radius: 10px;
border: 1px solid var(--background-modifier-border);
background: var(--background-secondary);
overflow: hidden;
transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.keep-cards-capture-wrap:focus-within {
border-color: var(--background-modifier-border-hover, var(--background-modifier-border));
box-shadow: 0 1px 6px rgba(0, 0, 0, 0.25);
}
.keep-cards-capture {
flex: 1;
padding: 12px 16px;
border: none;
background: transparent;
color: var(--text-normal);
font-size: 14px;
resize: none;
font-family: inherit;
line-height: 1.5;
outline: none;
}
.keep-cards-capture::placeholder {
color: var(--text-faint);
}
/* shared icon sizing across buttons */
.keep-card-action svg,
.keep-card-action .svg-icon,
.keep-cards-bulk-btn svg,
.keep-cards-bulk-btn .svg-icon,
.keep-modal-action-btn svg,
.keep-modal-action-btn .svg-icon,
.keep-sidebar-icon svg,
.keep-sidebar-icon .svg-icon,
.keep-sidebar-edit svg,
.keep-sidebar-edit .svg-icon,
.keep-sidebar-more svg,
.keep-sidebar-more .svg-icon,
.keep-card-backlinks-icon svg,
.keep-card-backlinks-icon .svg-icon,
.keep-empty-icon svg,
.keep-empty-icon .svg-icon {
width: 16px;
height: 16px;
}
.keep-empty-icon svg,
.keep-empty-icon .svg-icon {
width: 32px;
height: 32px;
}
/* ========== body row ========== */
.keep-cards-body {
display: flex;
gap: 16px;
align-items: stretch;
flex: 1;
min-height: 0;
overflow: hidden;
padding: 12px 16px 16px;
}
/* ========== sidebar ========== */
.keep-cards-sidebar {
width: 220px;
flex-shrink: 0;
display: flex;
flex-direction: column;
gap: 2px;
padding-top: 4px;
padding-bottom: 12px;
overflow-y: auto;
overflow-x: hidden;
align-self: stretch;
min-height: 0;
}
.keep-sidebar-item {
display: flex;
align-items: center;
gap: 10px;
padding: 8px 12px;
border-radius: 0 24px 24px 0;
cursor: pointer;
color: var(--text-muted);
font-size: 13px;
user-select: none;
position: relative;
}
.keep-sidebar-item:hover {
background: var(--background-modifier-hover);
}
.keep-sidebar-item.is-active {
background: var(--background-modifier-active-hover, var(--background-modifier-hover));
color: var(--text-normal);
font-weight: 600;
}
.keep-sidebar-item.is-drop-target {
outline: 2px dashed var(--text-accent);
outline-offset: -2px;
}
.keep-sidebar-icon {
display: inline-flex;
width: 16px;
height: 16px;
}
.keep-sidebar-color-dot {
width: 8px;
height: 8px;
border-radius: 50%;
flex-shrink: 0;
}
.keep-sidebar-label {
flex: 1;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.keep-sidebar-more {
background: transparent;
border: none;
color: var(--text-muted);
padding: 0;
width: 22px;
height: 22px;
border-radius: 4px;
cursor: pointer;
display: inline-flex;
align-items: center;
justify-content: center;
opacity: 0;
}
.keep-sidebar-item:hover .keep-sidebar-more {
opacity: 1;
}
.keep-sidebar-more:hover {
background: var(--background-modifier-hover);
color: var(--text-normal);
}
.keep-sidebar-divider {
height: 1px;
background: var(--background-modifier-border);
margin: 8px 0;
}
.keep-sidebar-heading {
font-size: 11px;
text-transform: uppercase;
letter-spacing: 0.05em;
color: var(--text-faint);
padding: 4px 12px;
display: flex;
align-items: center;
justify-content: space-between;
}
.keep-sidebar-edit {
background: transparent;
border: none;
color: var(--text-faint);
padding: 0;
width: 18px;
height: 18px;
border-radius: 4px;
cursor: pointer;
}
.keep-sidebar-edit:hover {
color: var(--text-muted);
background: var(--background-modifier-hover);
}
/* ========== grid + sections ========== */
.keep-cards-grid {
flex: 1;
min-width: 0;
display: flex;
flex-direction: column;
gap: 24px;
overflow-y: auto;
align-self: stretch;
min-height: 0;
padding-bottom: 12px;
}
.keep-section {
display: flex;
flex-direction: column;
gap: 10px;
}
.keep-section-header {
font-size: 11px;
letter-spacing: 0.08em;
color: var(--text-faint);
text-transform: uppercase;
padding-left: 4px;
}
.keep-section-cols {
display: flex;
gap: 16px;
align-items: flex-start;
}
.keep-col {
flex: 1;
display: flex;
flex-direction: column;
gap: 16px;
min-width: 0;
}
/* ========== card ========== */
.keep-card {
position: relative;
border-radius: 10px;
border: 1px solid var(--background-modifier-border);
background: var(--background-secondary);
cursor: pointer;
transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
overflow: hidden;
display: flex;
flex-direction: column;
}
.keep-card:hover {
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}
.keep-card.is-focused {
outline: 2px solid var(--text-accent);
outline-offset: 2px;
}
.keep-card.is-selected {
outline: 2px solid var(--text-accent);
outline-offset: 2px;
}
.keep-card.is-dragging {
opacity: 0.4;
}
.keep-card.is-drop-target {
border-color: var(--text-accent);
box-shadow: 0 0 0 2px var(--text-accent);
}
.keep-card--pinned {
border-color: var(--text-accent);
}
.keep-card-checkbox {
position: absolute;
top: 8px;
left: 8px;
z-index: 2;
opacity: 0;
margin: 0;
cursor: pointer;
}
.keep-card:hover .keep-card-checkbox,
.keep-card.is-selected .keep-card-checkbox {
opacity: 1;
}
.keep-card-image {
width: 100%;
max-height: 220px;
object-fit: cover;
display: block;
}
.keep-card-title {
font-weight: 600;
font-size: 15px;
padding: 12px 14px 4px;
color: var(--text-normal);
word-wrap: break-word;
}
.keep-card-body {
padding: 0 14px 8px;
font-size: 13px;
color: var(--text-muted);
line-height: 1.5;
word-wrap: break-word;
overflow: hidden;
}
.keep-card-body p {
margin: 0 0 8px;
}
.keep-card-body p:last-child { margin-bottom: 0; }
.keep-card-body ul,
.keep-card-body ol {
margin: 0 0 8px;
padding-left: 20px;
}
.keep-card-body h1,
.keep-card-body h2,
.keep-card-body h3,
.keep-card-body h4 {
margin: 8px 0 4px;
font-size: 14px;
color: var(--text-normal);
}
.keep-card-body code {
font-size: 12px;
}
.keep-card-body pre {
font-size: 12px;
overflow-x: auto;
max-height: 120px;
}
.keep-card-body img {
max-width: 100%;
height: auto;
}
.keep-card-body a.tag {
cursor: pointer;
}
.keep-card-body input[type="checkbox"] {
cursor: pointer;
}
.keep-card-tags {
margin-top: 4px;
padding: 0 14px 8px;
display: flex;
flex-wrap: wrap;
gap: 6px;
}
.keep-card-tag {
font-size: 11px;
padding: 2px 8px;
border-radius: 12px;
background: var(--background-modifier-hover);
color: var(--text-muted);
cursor: pointer;
}
.keep-card-tag:hover {
background: var(--background-modifier-active-hover, var(--background-modifier-hover));
color: var(--text-normal);
}
.keep-card-meta {
padding: 0 14px;
display: flex;
gap: 8px;
font-size: 11px;
color: var(--text-faint);
align-items: center;
min-height: 0;
}
.keep-card-backlinks {
display: inline-flex;
align-items: center;
gap: 4px;
}
.keep-card-backlinks-icon {
display: inline-flex;
width: 12px;
height: 12px;
}
.keep-card-actions {
display: flex;
gap: 2px;
padding: 4px 6px 6px;
opacity: 0;
transition: opacity 0.12s ease;
justify-content: flex-start;
}
.keep-card:hover .keep-card-actions,
.keep-card.is-focused .keep-card-actions {
opacity: 1;
}
.keep-card-action {
background: transparent;
border: none;
color: var(--text-muted);
width: 28px;
height: 28px;
border-radius: 50%;
cursor: pointer;
display: inline-flex;
align-items: center;
justify-content: center;
padding: 0;
}
.keep-card-action:hover {
background: var(--background-modifier-hover);
color: var(--text-normal);
}
/* ========== inline editor ========== */
.keep-card-editor {
width: 100%;
margin: 0;
padding: 0 14px 8px;
border: none;
background: transparent;
color: var(--text-normal);
font-family: inherit;
font-size: 13px;
line-height: 1.5;
resize: none;
outline: none;
min-height: 60px;
box-sizing: border-box;
}
.keep-card.is-editing-card {
cursor: default;
outline: 2px solid var(--text-accent);
outline-offset: 2px;
}
/* ========== color picker ========== */
.keep-color-picker {
position: absolute;
bottom: 44px;
left: 6px;
display: grid;
grid-template-columns: repeat(6, 1fr);
gap: 6px;
padding: 8px;
border-radius: 10px;
background: var(--background-primary);
border: 1px solid var(--background-modifier-border);
box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
z-index: 5;
}
.keep-color-swatch {
width: 22px;
height: 22px;
border-radius: 50%;
cursor: pointer;
border: 1px solid var(--background-modifier-border);
}
.keep-color-swatch:hover {
outline: 2px solid var(--text-accent);
outline-offset: 1px;
}
.keep-color-swatch--default {
background:
linear-gradient(45deg, transparent 45%, var(--text-muted) 45%, var(--text-muted) 55%, transparent 55%),
var(--background-primary);
}
/* ========== skeleton shimmer ========== */
.keep-card.is-skeleton .keep-card-body {
display: flex;
flex-direction: column;
gap: 8px;
padding: 6px 14px 14px;
}
.keep-shimmer {
height: 10px;
border-radius: 4px;
background: linear-gradient(
90deg,
var(--background-modifier-border) 0%,
var(--background-modifier-hover) 50%,
var(--background-modifier-border) 100%
);
background-size: 200% 100%;
animation: keep-shimmer 1.6s infinite;
}
.keep-shimmer:nth-child(2) { width: 80%; }
.keep-shimmer:nth-child(3) { width: 60%; }
@keyframes keep-shimmer {
0% { background-position: 200% 0; }
100% { background-position: -200% 0; }
}
/* ========== empty state ========== */
.keep-cards-empty {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 80px 16px;
color: var(--text-muted);
text-align: center;
gap: 8px;
}
.keep-empty-icon {
display: inline-flex;
width: 48px;
height: 48px;
color: var(--text-faint);
margin-bottom: 8px;
}
.keep-empty-title {
font-size: 16px;
color: var(--text-normal);
font-weight: 600;
}
.keep-empty-sub {
font-size: 13px;
}
/* ========== bulk actions bar ========== */
.keep-cards-bulk {
position: fixed;
bottom: 24px;
left: 50%;
transform: translateX(-50%);
background: var(--background-primary);
border: 1px solid var(--background-modifier-border);
border-radius: 32px;
padding: 6px 12px;
display: flex;
align-items: center;
gap: 6px;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
z-index: 100;
}
.keep-cards-bulk-count {
padding: 0 8px;
color: var(--text-normal);
font-size: 13px;
font-weight: 600;
}
.keep-cards-bulk-btn {
background: transparent;
border: none;
width: 32px;
height: 32px;
border-radius: 50%;
color: var(--text-muted);
cursor: pointer;
display: inline-flex;
align-items: center;
justify-content: center;
}
.keep-cards-bulk-btn:hover {
background: var(--background-modifier-hover);
color: var(--text-normal);
}
/* ========== undo toast ========== */
.keep-undo-toast {
position: fixed;
bottom: 24px;
right: 24px;
background: var(--background-primary);
border: 1px solid var(--background-modifier-border);
border-radius: 8px;
padding: 10px 14px;
display: flex;
align-items: center;
gap: 12px;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
color: var(--text-normal);
z-index: 100;
font-size: 13px;
}
.keep-undo-btn {
background: transparent;
border: none;
color: var(--text-accent);
cursor: pointer;
font-size: 13px;
font-weight: 600;
padding: 0;
}
/* ========== density: list ========== */
.density-list .keep-section-cols {
flex-direction: column;
gap: 8px;
}
.density-list .keep-col {
flex-direction: column;
gap: 8px;
}
.density-list .keep-card {
flex-direction: row;
align-items: stretch;
max-height: 120px;
}
.density-list .keep-card-image {
width: 120px;
height: auto;
max-height: 120px;
flex-shrink: 0;
}
.density-list .keep-card-body {
-webkit-line-clamp: 3;
display: -webkit-box;
-webkit-box-orient: vertical;
overflow: hidden;
}
.density-list .keep-card-actions {
flex-direction: column;
padding: 4px;
}
/* ========== density: compact ========== */
.density-compact .keep-card-title {
font-size: 13px;
padding: 8px 10px 2px;
}
.density-compact .keep-card-body {
font-size: 12px;
padding: 0 10px 6px;
}
.density-compact .keep-card-tags {
padding: 0 10px 6px;
}
.density-compact .keep-card-image {
max-height: 140px;
}
/* ========== reduced motion ========== */
@media (prefers-reduced-motion: reduce) {
.keep-card,
.keep-card-actions,
.keep-shimmer {
transition: none !important;
animation: none !important;
}
}
/* ========== note preview modal ========== */
.keep-note-modal {
width: min(900px, 92vw);
max-height: 88vh;
}
.keep-note-modal .modal-title {
margin-bottom: 8px;
}
.keep-modal-titlerow {
display: flex;
align-items: center;
gap: 12px;
width: 100%;
}
.keep-modal-title {
flex: 1;
font-size: 18px;
font-weight: 600;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
text-align: left;
}
.keep-modal-actions {
display: flex;
gap: 2px;
flex-shrink: 0;
}
.keep-modal-action-btn {
background: transparent;
border: none;
color: var(--text-muted);
width: 30px;
height: 30px;
border-radius: 50%;
cursor: pointer;
display: inline-flex;
align-items: center;
justify-content: center;
padding: 0;
}
.keep-modal-action-btn:hover {
background: var(--background-modifier-hover);
color: var(--text-normal);
}
.keep-modal-tags {
display: flex;
flex-wrap: wrap;
gap: 6px;
margin-bottom: 12px;
}
.keep-modal-body {
max-height: 65vh;
overflow-y: auto;
padding: 4px 4px 8px;
}
.keep-modal-md {
font-size: 14px;
line-height: 1.6;
color: var(--text-normal);
}
.keep-modal-md p { margin: 0 0 12px; }
.keep-modal-md p:last-child { margin-bottom: 0; }
.keep-modal-md h1, .keep-modal-md h2, .keep-modal-md h3 { margin-top: 16px; }
.keep-modal-md ul, .keep-modal-md ol { padding-left: 24px; margin: 0 0 12px; }
.keep-modal-md img { max-width: 100%; border-radius: 6px; }
.keep-modal-md pre { padding: 10px; border-radius: 6px; background: var(--background-secondary); overflow-x: auto; }
.keep-modal-md blockquote { border-left: 3px solid var(--background-modifier-border); padding-left: 12px; margin: 0 0 12px; color: var(--text-muted); }
.keep-modal-meta {
display: flex;
gap: 16px;
align-items: center;
margin-top: 16px;
padding-top: 12px;
border-top: 1px solid var(--background-modifier-border);
font-size: 11px;
color: var(--text-faint);
}
.keep-modal-path {
font-family: var(--font-monospace);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
flex: 1;
}
.keep-modal-editor {
width: 100%;
min-height: 60vh;
padding: 14px;
border: 1px solid var(--background-modifier-border);
border-radius: 6px;
background: var(--background-primary);
color: var(--text-normal);
font-family: inherit;
font-size: 14px;
line-height: 1.6;
resize: vertical;
outline: none;
box-sizing: border-box;
}
.keep-modal-editor:focus {
border-color: var(--text-accent);
}
/* ========== batch sentinel ========== */
.keep-batch-sentinel {
height: 1px;
width: 100%;
pointer-events: none;
}
/* ========== narrow widths ========== */
@media (max-width: 700px) {
.keep-cards-sidebar { display: none; }
.keep-cards-search { width: 160px; }
}