istefox_obsidian-bookmarker/styles.css
steffer 9e33bf91d4
feat(board): add hide-bookmarks toolbar toggle and context-menu action (#44)
Extend BookmarkItem with a `hidden` frontmatter flag and an in-memory
`showHidden` toggle (default off) that gates filtered(), category counts,
the card grid, and the count label.

- Toolbar: "Hidden" chip reveals hidden cards dimmed with a badge;
  "Hide selected" button appears only when the selection is non-empty.
- Context menu: per-card Hide/Unhide writes or removes the `hidden`
  key via processFrontMatter.
- Bulk: hideSelected() sets hidden on all selected notes, then re-renders.
- CSS: bookmarker-card--hidden dimming and badge; broken-badge offset
  when both badges show. No inline style assignments.
2026-06-16 23:03:01 +02:00

603 lines
12 KiB
CSS

.bookmarker-url-input {
width: 100%;
}
.bookmarker-setting-warning {
color: var(--text-warning);
font-size: var(--font-ui-smaller);
margin: 0 0 var(--size-4-3) 0;
}
.bookmarker-modal-error {
color: var(--text-error);
font-size: var(--font-ui-smaller);
min-height: 1.2em;
}
.bookmarker-preview {
display: block;
max-width: 100%;
max-height: 200px;
object-fit: cover;
border-radius: var(--radius-m);
margin-bottom: var(--size-4-3);
}
.bookmarker-wide-input {
width: 100%;
}
.bookmarker-tags {
display: flex;
flex-wrap: wrap;
gap: var(--size-2-2);
}
.bookmarker-tags-empty {
color: var(--text-muted);
font-size: var(--font-ui-smaller);
}
.bookmarker-tag-chip {
display: inline-flex;
align-items: center;
gap: var(--size-2-1);
padding: 3px 10px;
background: var(--tag-background);
color: var(--tag-color);
border-radius: var(--radius-s);
font-size: var(--font-ui-smaller);
line-height: 1.4;
}
/* Uniform-size toolbar buttons — match the tag-chip height. */
.bookmarker-toolbar-btn {
padding: 3px 10px;
font-size: var(--font-ui-smaller);
line-height: 1.4;
height: auto;
cursor: pointer;
}
.bookmarker-delete-broken {
color: var(--text-error);
border-color: var(--background-modifier-error-hover);
}
.bookmarker-hidden {
display: none;
}
.bookmarker-tag-remove {
cursor: pointer;
opacity: 0.7;
}
.bookmarker-tag-remove:hover {
opacity: 1;
}
.bookmarker-tag-edit {
cursor: pointer;
opacity: 0.5;
font-size: var(--font-ui-smaller);
}
.bookmarker-tag-edit:hover {
opacity: 1;
}
.bookmarker-confidence {
color: var(--text-muted);
font-size: var(--font-ui-smaller);
margin: var(--size-4-2) 0 0 0;
}
.bookmarker-domain-notice {
color: var(--text-muted);
font-size: var(--font-ui-smaller);
margin-bottom: var(--size-4-2);
}
.bookmarker-domain-link {
cursor: pointer;
text-decoration: underline;
}
.bookmarker-preview-empty {
display: flex;
align-items: center;
justify-content: center;
height: 120px;
background: var(--background-secondary);
color: var(--text-muted);
font-size: var(--font-ui-smaller);
}
.bookmarker-covers {
display: flex;
flex-wrap: wrap;
gap: var(--size-2-2);
justify-content: flex-end;
}
.bookmarker-cover-option {
width: 72px;
height: 48px;
object-fit: cover;
border-radius: var(--radius-s);
border: 2px solid transparent;
cursor: pointer;
}
.bookmarker-cover-none {
display: flex;
align-items: center;
justify-content: center;
background: var(--background-secondary);
color: var(--text-muted);
font-size: var(--font-ui-smaller);
}
.bookmarker-cover-selected {
border-color: var(--interactive-accent);
}
/* --- Bookmarks board (grid view) --- */
.bookmarker-board {
padding: var(--size-4-3);
overflow-y: auto;
}
.bookmarker-toolbar {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: var(--size-2-3);
margin-bottom: var(--size-4-2);
}
.bookmarker-search {
flex: 1 1 180px;
}
.bookmarker-count {
color: var(--text-muted);
font-size: var(--font-ui-smaller);
margin-left: auto;
}
.bookmarker-tag-section {
margin-bottom: var(--size-4-3);
}
.bookmarker-tag-header {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: var(--size-2-2);
margin-bottom: var(--size-2-2);
}
.bookmarker-tag-toggle {
cursor: pointer;
user-select: none;
color: var(--text-muted);
font-size: var(--font-ui-smaller);
}
.bookmarker-tag-toggle:hover {
color: var(--text-normal);
}
.bookmarker-tag-search {
width: 100%;
margin-bottom: var(--size-2-2);
}
.bookmarker-tag-sort {
font-size: var(--font-ui-smaller);
margin-left: auto;
}
.bookmarker-tag-filter {
display: flex;
flex-wrap: wrap;
gap: var(--size-2-2);
/* Cap the height so a vault with hundreds of tags never buries the cards. */
max-height: 8.5rem;
overflow-y: auto;
}
.bookmarker-tag-active {
outline: 2px solid var(--interactive-accent);
}
.bookmarker-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(var(--bm-card-min, 220px), 1fr));
gap: var(--size-4-3);
/* Cards have a fixed height per size (--bm-card-h); start keeps rows top-aligned. */
align-items: start;
}
.bookmarker-board-title {
font-weight: var(--font-semibold);
font-size: var(--font-ui-medium);
}
.bookmarker-category-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(var(--bm-card-min, 220px), 1fr));
gap: var(--size-4-3);
}
.bookmarker-category-tile {
position: relative;
display: flex;
align-items: center;
gap: var(--size-4-2);
padding: var(--size-4-3);
border: 1px solid var(--background-modifier-border);
border-left: 4px solid var(--bm-cat-color, var(--background-modifier-border));
border-radius: var(--radius-m);
background: var(--background-secondary);
cursor: pointer;
transition: border-color 0.1s ease;
}
.bookmarker-category-tile:hover {
border-color: var(--interactive-accent);
}
.bookmarker-category-icon {
display: flex;
align-items: center;
justify-content: center;
width: 24px;
height: 24px;
font-size: 20px;
line-height: 1;
color: var(--bm-cat-color, var(--text-normal));
}
.bookmarker-category-icon svg {
width: 22px;
height: 22px;
}
.bookmarker-category-body {
display: flex;
flex-direction: column;
min-width: 0;
}
.bookmarker-category-name {
font-weight: var(--font-semibold);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.bookmarker-category-count {
color: var(--text-muted);
font-size: var(--font-ui-smaller);
}
.bookmarker-category-edit {
position: absolute;
top: var(--size-2-2);
right: var(--size-2-2);
cursor: pointer;
opacity: 0.5;
font-size: var(--font-ui-smaller);
}
.bookmarker-category-edit:hover {
opacity: 1;
}
.bookmarker-category-preview {
display: flex;
justify-content: center;
margin-bottom: var(--size-4-3);
}
.bookmarker-category-preview .bookmarker-category-icon {
width: 40px;
height: 40px;
font-size: 34px;
}
.bookmarker-category-preview .bookmarker-category-icon svg {
width: 36px;
height: 36px;
}
.bookmarker-color-swatches {
display: flex;
flex-wrap: wrap;
gap: var(--size-2-2);
align-items: center;
}
.bookmarker-color-swatch {
width: 22px;
height: 22px;
border-radius: 50%;
background: var(--bm-swatch);
cursor: pointer;
border: 2px solid transparent;
}
.bookmarker-color-swatch.is-selected {
border-color: var(--text-normal);
}
.bookmarker-color-none {
width: auto;
height: auto;
padding: 2px 8px;
border-radius: var(--radius-s);
background: var(--background-modifier-border);
color: var(--text-muted);
font-size: var(--font-ui-smaller);
}
.bookmarker-icon-filter {
width: 100%;
margin-top: var(--size-4-2);
}
.bookmarker-icon-palette {
display: flex;
flex-wrap: wrap;
gap: var(--size-2-1);
margin-top: var(--size-2-2);
max-height: 12rem;
overflow-y: auto;
}
.bookmarker-icon-option {
display: flex;
align-items: center;
justify-content: center;
width: 32px;
height: 32px;
border-radius: var(--radius-s);
cursor: pointer;
color: var(--text-muted);
}
.bookmarker-icon-option:hover {
background: var(--background-modifier-hover);
color: var(--text-normal);
}
.bookmarker-icon-option.is-selected {
background: var(--background-modifier-hover);
color: var(--interactive-accent);
outline: 1px solid var(--interactive-accent);
}
.bookmarker-icon-option svg {
width: 18px;
height: 18px;
}
.bookmarker-card {
position: relative;
display: flex;
flex-direction: column;
/* Small strip of card background above the cover so the checkbox and star
aren't glued to the image's top edge. */
padding-top: 10px;
/* Fixed height per size so every card in a mode is identical; content clips. */
height: var(--bm-card-h, 320px);
border: 1px solid var(--background-modifier-border);
border-radius: var(--radius-m);
overflow: hidden;
cursor: pointer;
background: var(--background-secondary);
transition: border-color 0.1s ease;
}
.bookmarker-card:hover {
border-color: var(--interactive-accent);
}
.bookmarker-card-cover {
position: relative;
height: var(--bm-card-cover-h, 132px);
flex: 0 0 auto;
overflow: hidden;
background: var(--background-primary);
}
.bookmarker-card-star {
position: absolute;
top: 4px;
right: 6px;
cursor: pointer;
color: rgba(255, 255, 255, 0.85);
text-shadow: 0 0 3px rgba(0, 0, 0, 0.7);
font-size: 18px;
line-height: 1;
}
.bookmarker-card-star-on {
color: var(--color-yellow, gold);
}
.bookmarker-card-type {
position: absolute;
bottom: 4px;
left: 6px;
padding: 1px 6px;
border-radius: var(--radius-s);
background: rgba(0, 0, 0, 0.6);
color: #fff;
font-size: var(--font-ui-smaller);
text-transform: uppercase;
}
.bookmarker-card-broken {
position: absolute;
bottom: 4px;
right: 6px;
padding: 1px 6px;
border-radius: var(--radius-s);
background: var(--text-error);
color: #fff;
font-size: var(--font-ui-smaller);
text-transform: uppercase;
}
.bookmarker-card--hidden {
--bm-hidden-badge-w: 54px;
opacity: 0.45;
}
.bookmarker-card-hidden-badge {
position: absolute;
bottom: 4px;
right: 6px;
padding: 1px 6px;
border-radius: var(--radius-s);
background: var(--background-modifier-cover);
color: var(--text-muted);
font-size: var(--font-ui-smaller);
text-transform: uppercase;
}
.bookmarker-card--hidden .bookmarker-card-broken {
right: calc(6px + var(--bm-hidden-badge-w));
}
.bookmarker-hide-selected {
color: var(--text-muted);
}
.bookmarker-card-cover img {
width: 100%;
height: 100%;
object-fit: cover;
display: block;
}
.bookmarker-card-cover-empty {
display: flex;
align-items: center;
justify-content: center;
color: var(--text-muted);
font-size: var(--font-ui-smaller);
}
.bookmarker-card-title {
font-weight: var(--font-semibold);
font-size: var(--bm-card-title, 1em);
padding: var(--size-4-2) var(--size-4-2) 0;
line-height: 1.3;
flex: 0 0 auto;
/* Always reserve exactly two lines so 1- and 2-line titles take the same space. */
height: calc(2 * 1.3em + var(--size-4-2));
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
.bookmarker-card-domain {
color: var(--text-muted);
font-size: var(--font-ui-smaller);
padding: var(--size-2-1) var(--size-4-2) 0;
flex: 0 0 auto;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.bookmarker-card-tags {
display: flex;
flex-wrap: wrap;
align-content: flex-start;
gap: var(--size-2-1);
padding: var(--size-2-2) var(--size-4-2) var(--size-4-2);
/* Fill the remaining space and clip extra tag rows instead of growing the card. */
flex: 1 1 auto;
overflow: hidden;
}
.bookmarker-card-tags .bookmarker-tag-chip {
font-size: var(--bm-card-tag, var(--font-ui-smaller));
}
.bookmarker-empty {
color: var(--text-muted);
padding: var(--size-4-4);
text-align: center;
}
.bookmarker-organize-controls {
display: flex;
gap: var(--size-2-2);
margin-bottom: var(--size-4-2);
}
.bookmarker-organize-list {
max-height: 50vh;
overflow-y: auto;
border: 1px solid var(--background-modifier-border);
border-radius: var(--radius-m);
}
.bookmarker-organize-row {
display: flex;
align-items: flex-start;
gap: var(--size-2-3);
padding: var(--size-2-2) var(--size-4-2);
border-bottom: 1px solid var(--background-modifier-border);
}
.bookmarker-organize-row:last-child {
border-bottom: none;
}
.bookmarker-organize-row input[type="checkbox"] {
margin-top: var(--size-2-1);
}
.bookmarker-organize-row-destructive {
background: var(--background-modifier-error-hover);
}
.bookmarker-organize-body {
display: flex;
flex-direction: column;
gap: var(--size-2-1);
min-width: 0;
flex: 1;
}
.bookmarker-organize-label {
font-weight: var(--font-semibold);
word-break: break-word;
}
.bookmarker-organize-detail {
color: var(--text-muted);
font-size: var(--font-ui-smaller);
word-break: break-word;
}
.bookmarker-organize-select {
margin-top: var(--size-2-1);
align-self: flex-start;
}
.bookmarker-card-select {
position: absolute;
top: var(--size-2-2);
left: var(--size-2-2);
z-index: 1;
}