Files
notebook-snapshot-extension/style/base.css
T
tao.chenandClaude 263232bea4 feat: replace text buttons with icons (tooltip on hover)
Replaces the two visible 'button-like' affordances with LabIcon glyphs
so the sidebar and toolbar stay compact; the explanatory text moves
to the hover tooltip.

Changes:
- Toolbar 'Save Snapshot' button: text label -> saveIcon (floppy),
  tooltip '保存当前 notebook 为快照'
- Sidebar panel '快照历史' text label -> saveIcon + caption='快照历史'
  (the panel tab is now icon-only)
- Sidebar refresh button: text -> refreshIcon with a 1s rotate animation
  while loading

Dependencies:
- Adds @jupyterlab/ui-components to package.json (source of the
  standard LabIcon set: saveIcon, refreshIcon, historyIcon)

Style:
- New .jp-snapshot-panel-refresh-button sizing (28x24 fixed box,
  centered icon) and .is-loading spin keyframes
- @keyframes jp-snapshot-spin applied to the icon's .jp-Icon element

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-21 18:41:01 +08:00

257 lines
4.8 KiB
CSS

/*
See the JupyterLab Developer Guide for useful CSS Patterns:
https://jupyterlab.readthedocs.io/en/stable/developer/css.html
*/
/* snapshot extension */
.jp-snapshot-panel {
padding: 8px;
overflow-y: auto;
height: 100%;
box-sizing: border-box;
}
.jp-snapshot-panel-container {
display: flex;
flex-direction: column;
height: 100%;
}
.jp-snapshot-panel-toolbar {
display: flex;
justify-content: flex-end;
margin-bottom: 6px;
}
.jp-snapshot-panel-refresh-button {
display: inline-flex;
align-items: center;
justify-content: center;
width: 28px;
height: 24px;
padding: 0;
border: 1px solid var(--jp-border-color2, #ccc);
border-radius: 3px;
background: var(--jp-layout-color2, #f5f5f5);
color: var(--jp-ui-font-color1, #333);
cursor: pointer;
line-height: 0;
}
.jp-snapshot-panel-refresh-button:hover:not(:disabled) {
background: var(--jp-layout-color3, #e8e8e8);
}
.jp-snapshot-panel-refresh-button:disabled {
opacity: 0.6;
cursor: not-allowed;
}
.jp-snapshot-panel-refresh-button.is-loading svg,
.jp-snapshot-panel-refresh-button.is-loading .jp-Icon {
animation: jp-snapshot-spin 1s linear infinite;
}
@keyframes jp-snapshot-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
.jp-snapshot-panel-empty {
color: var(--jp-ui-font-color2, #555);
padding: 12px;
text-align: center;
}
.jp-snapshot-panel-hint {
font-size: 0.85em;
margin-top: 8px;
color: var(--jp-ui-font-color2, #888);
}
.jp-snapshot-panel-list {
list-style: none;
margin: 0;
padding: 0;
}
.jp-snapshot-panel-item {
border: 1px solid var(--jp-border-color2, #ddd);
border-radius: 4px;
padding: 8px;
margin-bottom: 8px;
background: var(--jp-layout-color1, #fff);
}
.jp-snapshot-panel-item-header {
display: flex;
justify-content: space-between;
align-items: center;
gap: 8px;
}
.jp-snapshot-panel-name {
font-weight: 600;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.jp-snapshot-panel-size {
font-size: 0.8em;
color: var(--jp-ui-font-color2, #888);
white-space: nowrap;
}
.jp-snapshot-panel-desc {
font-size: 0.9em;
color: var(--jp-ui-font-color2, #555);
margin: 4px 0;
white-space: pre-wrap;
}
.jp-snapshot-panel-time {
font-size: 0.8em;
color: var(--jp-ui-font-color2, #888);
margin-bottom: 6px;
}
.jp-snapshot-panel-actions {
display: flex;
gap: 4px;
}
.jp-snapshot-panel-button {
flex: 1;
padding: 4px 8px;
font-size: 0.85em;
border: 1px solid var(--jp-border-color2, #ccc);
border-radius: 3px;
background: var(--jp-layout-color2, #f5f5f5);
cursor: pointer;
}
.jp-snapshot-panel-button:hover {
background: var(--jp-layout-color3, #e8e8e8);
}
/* commit dialog */
.jp-snapshot-commit-dialog {
display: flex;
flex-direction: column;
gap: 6px;
padding: 8px;
min-width: 320px;
}
.jp-snapshot-commit-dialog label {
font-weight: 600;
font-size: 0.9em;
}
.jp-snapshot-commit-dialog-name,
.jp-snapshot-commit-dialog-desc {
font-family: inherit;
font-size: 1em;
padding: 4px 6px;
border: 1px solid var(--jp-border-color2, #ccc);
border-radius: 3px;
box-sizing: border-box;
width: 100%;
}
.jp-snapshot-commit-dialog-desc {
resize: vertical;
}
/* diff widget */
.jp-snapshot-diff-widget {
padding: 8px;
overflow-y: auto;
height: 100%;
box-sizing: border-box;
}
.jp-snapshot-diff-container {
display: flex;
flex-direction: column;
gap: 8px;
}
.jp-snapshot-diff-row {
border: 1px solid var(--jp-border-color2, #ddd);
border-radius: 4px;
padding: 6px;
background: var(--jp-layout-color1, #fff);
}
.jp-snapshot-diff-added {
background: var(--jp-diff-added-color1, #e6ffed);
border-left: 3px solid #2cbe4e;
}
.jp-snapshot-diff-deleted {
background: var(--jp-diff-deleted-color1, #ffeef0);
border-left: 3px solid #cb2431;
}
.jp-snapshot-diff-modified {
background: var(--jp-diff-modified-color1, #fff5b1);
border-left: 3px solid #dfb700;
}
.jp-snapshot-diff-unchanged {
background: var(--jp-layout-color1, #fff);
border-left: 3px solid var(--jp-border-color2, #ddd);
}
.jp-snapshot-diff-badge {
display: inline-block;
font-size: 0.8em;
font-weight: 600;
padding: 1px 6px;
border-radius: 3px;
margin-right: 6px;
background: var(--jp-layout-color2, #eee);
}
.jp-snapshot-diff-cell-type {
display: inline-block;
font-size: 0.8em;
color: var(--jp-ui-font-color2, #888);
}
.jp-snapshot-diff-pre {
font-family: var(--jp-code-font-family, monospace);
font-size: 0.9em;
margin: 6px 0 0 0;
white-space: pre-wrap;
word-break: break-all;
}
.jp-snapshot-diff-line-added {
background: #ccffd8;
}
.jp-snapshot-diff-line-removed {
background: #ffd7d5;
}
.jp-snapshot-diff-line-context {
color: var(--jp-ui-font-color2, #555);
}
.jp-snapshot-diff-empty {
color: var(--jp-ui-font-color2, #888);
text-align: center;
padding: 16px;
}