csv-blocks/styles.css
exe.dev user 4ca6f224c9 Add double-quote aware CSV parsing and column copy button
- CsvParser._parseRow() now handles quoted fields: commas inside
  double quotes are treated as literal, and "" is an escaped quote.
- Empty lines are filtered out during parsing.
- Each header cell gets a copy button (clipboard icon) that appears
  on hover, right-aligned. Clicking it copies the entire column
  (header + all data rows) joined by newlines to the clipboard.
- Styling: button is absolutely positioned, fades in on header hover,
  uses Obsidian CSS variables for theming.

Co-authored-by: Shelley <shelley@exe.dev>
2026-02-27 02:59:53 +00:00

48 lines
751 B
CSS

div.csv-table-wrapper {
max-height: 300px;
overflow-y: auto;
}
.csv-table {
border-collapse: collapse;
}
.csv-table thead td {
font-weight: bold;
}
.csv-table td {
border: 1px solid var(--background-modifier-border);
padding: 4px 8px;
}
.csv-table-header {
position: relative;
padding-right: 28px !important;
}
.csv-copy-btn {
position: absolute;
right: 4px;
top: 50%;
transform: translateY(-50%);
background: none;
border: none;
cursor: pointer;
padding: 2px;
border-radius: 4px;
line-height: 0;
color: var(--text-muted);
opacity: 0;
transition: opacity 0.15s ease;
}
.csv-table-header:hover .csv-copy-btn {
opacity: 1;
}
.csv-copy-btn:hover {
background: var(--background-modifier-hover);
color: var(--text-normal);
}