mirror of
https://github.com/JoshiCodes/knock.git
synced 2026-12-04 15:29:40 +01:00
Skeleton, REST core, variables and JSON editor (M0–M2)
- knock-core: YAML collection format with unknown-field round trip, variable resolution across scopes with secrets and dynamic values, HTTP engine with manual redirects, cookie jar and large-body spill, basic/bearer/API key auth with debug output, assertions and extracts - Tauri app: collection commands, file watcher, SQLite history, keyring-backed secrets - Svelte UI: sidebar tree, tabs, request editor, response viewer, JSON form/code editor with schema hints, environments, settings
This commit is contained in:
+263
@@ -0,0 +1,263 @@
|
||||
@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.75;
|
||||
}
|
||||
|
||||
.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;
|
||||
}
|
||||
button {
|
||||
cursor: default;
|
||||
}
|
||||
}
|
||||
|
||||
/* 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;
|
||||
}
|
||||
Reference in New Issue
Block a user