mirror of
https://github.com/JoshiCodes/knock.git
synced 2026-12-04 15:09:41 +01:00
- Welcome screen: the mark as a peephole and actions as plain lines instead of a card grid and key chips - Title bar: search as a small button, documentation (F1) next to it; help entries in the command palette - The vertical cyan rule marks what needs attention (redirect URI, inactive environment, banners) instead of nested framed boxes - JSON form: fixed key column so types and values line up at any depth, type glyphs in the code view's colours, row actions float on hover - Crisper corners; Send carries the mark; Saved instead of a disabled Save button - Open tabs are restored after a restart again
298 lines
6.4 KiB
CSS
298 lines
6.4 KiB
CSS
@import 'tailwindcss';
|
|
@import '@joshicodes/cock/theme.css';
|
|
@import '@fontsource/space-grotesk/500.css';
|
|
@import '@fontsource/space-grotesk/700.css';
|
|
@import '@fontsource/jetbrains-mono/500.css';
|
|
|
|
@source './';
|
|
|
|
/* Brand tokens from DESIGN.md. Dark is the reference; light keeps the same
|
|
roles with values that hold contrast on paper. */
|
|
:root,
|
|
[data-ck-theme='light'] {
|
|
--knock-cyan: #2ec4f1;
|
|
--knock-cyan-deep: #0b7fad;
|
|
--on-accent: #101318;
|
|
|
|
--k-titlebar: #e8eaee;
|
|
--k-sidebar: #f2f3f5;
|
|
--k-panel: #ffffff;
|
|
--k-input: #f2f3f5;
|
|
--k-hover: #e6e8ec;
|
|
--k-line: #dcdfe5;
|
|
|
|
--k-text-strong: #101318;
|
|
--k-text: #1e222a;
|
|
--k-text-soft: #3a404b;
|
|
--k-text-muted: #5b6270;
|
|
--k-text-subtle: #6b7280;
|
|
|
|
--method-get: #0b7fad;
|
|
--method-post: #9a5b00;
|
|
--method-put: #5b3fd9;
|
|
--method-patch: #b0307a;
|
|
--method-delete: #c62828;
|
|
--status-ok: #1b7f3b;
|
|
|
|
--ck-bg: #ffffff;
|
|
--ck-fg: #1e222a;
|
|
--ck-accent: #0b7fad;
|
|
--ck-accent-hover: #096e96;
|
|
--ck-accent-fg: #ffffff;
|
|
--ck-tint: 0%;
|
|
--ck-danger: #c62828;
|
|
--ck-success: #1b7f3b;
|
|
--ck-warning: #9a5b00;
|
|
--ck-font-sans: 'Space Grotesk', system-ui, sans-serif;
|
|
--ck-font-mono: 'JetBrains Mono', ui-monospace, monospace;
|
|
--ck-radius-scale: 0.5;
|
|
}
|
|
|
|
.dark,
|
|
[data-ck-theme='dark'] {
|
|
--k-titlebar: #0e1014;
|
|
--k-sidebar: #111419;
|
|
--k-panel: #15181e;
|
|
--k-input: #1e222a;
|
|
--k-hover: #232833;
|
|
--k-line: #232833;
|
|
|
|
--k-text-strong: #f4f6f8;
|
|
--k-text: #e3e7ec;
|
|
--k-text-soft: #c9ced6;
|
|
--k-text-muted: #a9b0bc;
|
|
--k-text-subtle: #8a93a2;
|
|
|
|
--method-get: #2ec4f1;
|
|
--method-post: #f5b85c;
|
|
--method-put: #b8a1ff;
|
|
--method-patch: #f59fd0;
|
|
--method-delete: #ff5c5c;
|
|
--status-ok: #7cf29a;
|
|
|
|
--ck-bg: #15181e;
|
|
--ck-fg: #e3e7ec;
|
|
--ck-accent: #2ec4f1;
|
|
--ck-accent-hover: #5ad2f5;
|
|
--ck-accent-fg: #101318;
|
|
--ck-tint: 0%;
|
|
--ck-danger: #ff5c5c;
|
|
--ck-success: #7cf29a;
|
|
--ck-warning: #f5b85c;
|
|
--ck-code-bg: #1e222a;
|
|
--ck-code-line: #232833;
|
|
}
|
|
|
|
/* Cock derives surfaces by mixing; Knock has exact layers, so pin them. */
|
|
:root,
|
|
.dark,
|
|
[data-ck-theme] {
|
|
--ck-canvas: var(--k-panel);
|
|
--ck-surface: var(--k-input);
|
|
--ck-muted: var(--k-hover);
|
|
--ck-fg-muted: var(--k-text-muted);
|
|
--ck-fg-subtle: var(--k-text-subtle);
|
|
}
|
|
|
|
@theme inline {
|
|
--color-titlebar: var(--k-titlebar);
|
|
--color-sidebar: var(--k-sidebar);
|
|
--color-panel: var(--k-panel);
|
|
--color-input: var(--k-input);
|
|
--color-hover: var(--k-hover);
|
|
--color-line: var(--k-line);
|
|
--color-strong: var(--k-text-strong);
|
|
--color-soft: var(--k-text-soft);
|
|
--color-get: var(--method-get);
|
|
--color-post: var(--method-post);
|
|
--color-put: var(--method-put);
|
|
--color-patch: var(--method-patch);
|
|
--color-delete: var(--method-delete);
|
|
--color-ok: var(--status-ok);
|
|
--color-cyan: var(--knock-cyan);
|
|
--color-cyan-deep: var(--knock-cyan-deep);
|
|
}
|
|
|
|
@layer base {
|
|
html,
|
|
body,
|
|
#app {
|
|
height: 100%;
|
|
overflow: hidden;
|
|
}
|
|
body {
|
|
font-size: 13px;
|
|
font-weight: 500;
|
|
user-select: none;
|
|
-webkit-user-select: none;
|
|
cursor: default;
|
|
}
|
|
input,
|
|
textarea,
|
|
[contenteditable],
|
|
.selectable,
|
|
.cm-editor {
|
|
user-select: text;
|
|
-webkit-user-select: text;
|
|
}
|
|
code,
|
|
pre,
|
|
.mono {
|
|
font-family: var(--ck-font-mono);
|
|
font-weight: 500;
|
|
}
|
|
/* Everything clickable shows the hand; disabled controls say so. */
|
|
button,
|
|
a[href],
|
|
select,
|
|
summary,
|
|
[role='button'],
|
|
[role='tab'],
|
|
[role='treeitem'],
|
|
[role='radio'],
|
|
[role='switch'],
|
|
[role='menuitem'],
|
|
[role='option'],
|
|
input[type='checkbox'],
|
|
input[type='radio'],
|
|
label:has(> input[type='checkbox']),
|
|
label:has(> input[type='radio']) {
|
|
cursor: pointer;
|
|
}
|
|
button:disabled,
|
|
select:disabled,
|
|
input:disabled,
|
|
[aria-disabled='true'] {
|
|
cursor: not-allowed;
|
|
}
|
|
input:not([type='checkbox']):not([type='radio']),
|
|
textarea {
|
|
cursor: text;
|
|
}
|
|
button,
|
|
[role='tab'],
|
|
[role='treeitem'] {
|
|
transition:
|
|
background-color 90ms ease,
|
|
color 90ms ease,
|
|
border-color 90ms ease,
|
|
opacity 90ms ease;
|
|
}
|
|
}
|
|
|
|
/* Section label: COLLECTIONS, HEADERS, … */
|
|
.k-label {
|
|
font-size: 10.5px;
|
|
letter-spacing: 0.08em;
|
|
text-transform: uppercase;
|
|
color: var(--k-text-subtle);
|
|
font-weight: 700;
|
|
}
|
|
|
|
/* Plain inline field used inside tables and bars. Cock's Input is used for
|
|
forms; dense editors need something with less chrome. */
|
|
.k-field {
|
|
width: 100%;
|
|
min-width: 0;
|
|
background: transparent;
|
|
color: var(--k-text);
|
|
font-family: var(--ck-font-mono);
|
|
font-size: 12.5px;
|
|
padding: 4px 6px;
|
|
border-radius: 3px;
|
|
outline: none;
|
|
border: 1px solid transparent;
|
|
}
|
|
.k-field:hover {
|
|
border-color: var(--k-line);
|
|
}
|
|
.k-field:focus {
|
|
border-color: var(--knock-cyan-deep);
|
|
background: var(--k-input);
|
|
}
|
|
.k-field::placeholder {
|
|
color: var(--k-text-subtle);
|
|
}
|
|
|
|
.k-scroll {
|
|
overflow: auto;
|
|
scrollbar-width: thin;
|
|
scrollbar-color: var(--k-hover) transparent;
|
|
}
|
|
|
|
/* CodeMirror chrome follows the panel, not Cock's code panel. */
|
|
.cm-editor {
|
|
height: 100%;
|
|
font-size: 12.5px;
|
|
background: transparent;
|
|
}
|
|
.cm-editor .cm-scroller {
|
|
font-family: var(--ck-font-mono);
|
|
line-height: 1.55;
|
|
}
|
|
.cm-editor.cm-focused {
|
|
outline: none;
|
|
}
|
|
.cm-gutters {
|
|
background: transparent !important;
|
|
border-right: 1px solid var(--k-line) !important;
|
|
color: var(--k-text-subtle) !important;
|
|
}
|
|
.cm-activeLine,
|
|
.cm-activeLineGutter {
|
|
background: color-mix(in oklab, var(--k-hover) 55%, transparent) !important;
|
|
}
|
|
.cm-tooltip {
|
|
background: var(--k-input) !important;
|
|
border: 1px solid var(--k-line) !important;
|
|
color: var(--k-text);
|
|
}
|
|
.cm-tooltip-autocomplete ul li[aria-selected] {
|
|
background: var(--ck-accent-soft) !important;
|
|
color: var(--k-text-strong) !important;
|
|
}
|
|
.cm-var {
|
|
color: var(--knock-cyan);
|
|
background: color-mix(in oklab, var(--knock-cyan) 12%, transparent);
|
|
border-radius: 3px;
|
|
padding: 0 1px;
|
|
}
|
|
:where([data-ck-theme='light']) .cm-var,
|
|
:root:not(.dark) .cm-var {
|
|
color: var(--knock-cyan-deep);
|
|
}
|
|
.cm-var-missing {
|
|
color: var(--method-delete);
|
|
background: color-mix(in oklab, var(--method-delete) 12%, transparent);
|
|
text-decoration: underline wavy color-mix(in oklab, var(--method-delete) 60%, transparent);
|
|
text-underline-offset: 3px;
|
|
}
|
|
.cm-selectionBackground,
|
|
.cm-content ::selection {
|
|
background: color-mix(in oklab, var(--knock-cyan) 22%, transparent) !important;
|
|
}
|
|
|
|
.k-var-tip {
|
|
padding: 6px 9px;
|
|
max-width: 420px;
|
|
font-size: 12px;
|
|
}
|
|
.k-var-tip-name {
|
|
font-family: var(--ck-font-mono);
|
|
color: var(--k-text-subtle);
|
|
font-size: 11px;
|
|
}
|
|
.k-var-tip-value {
|
|
font-family: var(--ck-font-mono);
|
|
color: var(--k-text-strong);
|
|
word-break: break-all;
|
|
margin: 2px 0;
|
|
}
|
|
.k-var-tip-value.missing {
|
|
color: var(--method-delete);
|
|
}
|
|
.k-var-tip-meta {
|
|
color: var(--k-text-muted);
|
|
font-size: 11px;
|
|
}
|