Decodal/site/decodal-site/src/style.css
2026-06-18 23:42:53 +09:00

468 lines
7.6 KiB
CSS

:root {
color-scheme: light;
font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
--bg: #f7f7f8;
--surface: #ffffff;
--text: #1f2328;
--heading: #111827;
--muted: #4b5563;
--subtle: #64748b;
--border: #e5e7eb;
--link: #2563eb;
--topbar-bg: #111827;
--topbar-text: #ffffff;
--topbar-link: #dbeafe;
--active-bg: #dbeafe;
--active-text: #1d4ed8;
--nav-number: #94a3b8;
--shadow: 0 8px 24px rgb(15 23 42 / 0.05);
--inline-code-bg: #eef2ff;
--inline-code-text: #3730a3;
--editor-bg: #0f172a;
--editor-text: #e5e7eb;
--danger: #b91c1c;
--error: #fecaca;
--selection: rgb(59 130 246 / 0.35);
}
@media (prefers-color-scheme: dark) {
:root {
color-scheme: dark;
--bg: #0b1120;
--surface: #111827;
--text: #d1d5db;
--heading: #f9fafb;
--muted: #9ca3af;
--subtle: #94a3b8;
--border: #334155;
--link: #60a5fa;
--topbar-bg: #020617;
--topbar-text: #f8fafc;
--topbar-link: #bfdbfe;
--active-bg: #1e3a8a;
--active-text: #bfdbfe;
--nav-number: #64748b;
--shadow: 0 8px 24px rgb(0 0 0 / 0.25);
--inline-code-bg: #1e293b;
--inline-code-text: #bfdbfe;
--danger: #fca5a5;
}
}
body {
background: var(--bg);
color: var(--text);
margin: 0;
}
a {
color: var(--link);
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
.topbar {
align-items: center;
background: var(--topbar-bg);
color: var(--topbar-text);
display: flex;
height: 56px;
justify-content: space-between;
padding: 0 24px;
}
.brand {
color: var(--topbar-text);
font-size: 20px;
font-weight: 700;
}
.topnav {
display: flex;
gap: 18px;
}
.topnav a {
color: var(--topbar-link);
}
.layout {
display: grid;
grid-template-columns: 300px minmax(0, 1fr);
min-height: calc(100vh - 56px);
}
.playground-layout {
display: block;
}
.sidebar {
background: var(--surface);
border-right: 1px solid var(--border);
overflow: auto;
padding: 22px 18px;
}
.sidebar-title {
color: var(--heading);
display: block;
font-weight: 700;
margin-bottom: 12px;
}
.nav-tree {
list-style: none;
margin: 0;
padding-left: 0;
}
.nav-tree .nav-tree {
margin: 4px 0 6px 12px;
}
.nav-tree a {
border-radius: 6px;
color: var(--text);
display: flex;
font-size: 14px;
gap: 6px;
line-height: 1.35;
padding: 4px 8px;
}
.nav-number {
color: var(--nav-number);
flex: 0 0 auto;
font-variant-numeric: tabular-nums;
}
.nav-tree a.active {
background: var(--active-bg);
color: var(--active-text);
font-weight: 600;
}
.nav-tree a.active .nav-number {
color: var(--link);
}
main {
min-width: 0;
padding: 36px;
}
main.playground {
padding: 10px;
}
.markdown {
background: var(--surface);
border: 1px solid var(--border);
border-radius: 12px;
box-shadow: var(--shadow);
margin: 0 auto;
max-width: 920px;
padding: 24px 36px 42px;
}
.markdown h1,
.markdown h2,
.markdown h3 {
color: var(--heading);
}
.markdown pre,
.output-pane pre {
background: var(--editor-bg);
border-radius: 10px;
color: var(--editor-text);
overflow: auto;
padding: 14px;
}
.markdown code {
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}
.markdown :not(pre) > code {
background: var(--inline-code-bg);
border-radius: 4px;
color: var(--inline-code-text);
padding: 1px 4px;
}
.markdown table {
border-collapse: collapse;
display: block;
margin: 20px 0;
overflow-x: auto;
width: 100%;
}
.markdown th,
.markdown td {
border: 1px solid var(--border);
padding: 8px 10px;
text-align: left;
vertical-align: top;
}
.markdown th {
background: var(--inline-code-bg);
color: var(--heading);
font-weight: 700;
}
.markdown tr:nth-child(even) td {
background: color-mix(in srgb, var(--surface) 92%, var(--border));
}
.tok-keyword {
color: #93c5fd;
font-weight: 700;
}
.tok-type {
color: #67e8f9;
}
.tok-literal,
.tok-number {
color: #fbbf24;
}
.tok-string,
.tok-regex {
color: #86efac;
}
.tok-comment {
color: var(--nav-number);
font-style: italic;
}
.tok-operator {
color: #f9a8d4;
}
.playground-page {
height: calc(100vh - 76px);
}
.playground-header {
align-items: center;
display: flex;
gap: 16px;
justify-content: space-between;
margin-bottom: 8px;
}
.playground-header h1 {
font-size: 20px;
margin: 0 0 2px;
}
.playground-header p {
color: var(--muted);
font-size: 13px;
margin: 0;
}
.playground-header code {
background: var(--inline-code-bg);
border-radius: 4px;
color: var(--inline-code-text);
padding: 1px 4px;
}
.playground-actions {
align-items: center;
display: flex;
gap: 12px;
}
button {
background: var(--link);
border: 0;
border-radius: 8px;
color: var(--topbar-text);
cursor: pointer;
font-weight: 700;
padding: 8px 14px;
}
button:disabled {
cursor: not-allowed;
opacity: 0.5;
}
.playground-shell {
display: grid;
gap: 10px;
grid-template-columns: 220px minmax(360px, 1.25fr) minmax(320px, 1fr);
height: calc(100% - 52px);
min-height: 0;
}
.file-panel,
.pane {
background: var(--surface);
border: 1px solid var(--border);
border-radius: 10px;
display: flex;
flex-direction: column;
min-height: 0;
overflow: hidden;
}
.panel-header,
.pane > span {
align-items: center;
border-bottom: 1px solid var(--border);
color: var(--text);
display: flex;
font-size: 13px;
font-weight: 700;
justify-content: space-between;
min-height: 38px;
padding: 0 10px;
text-transform: uppercase;
}
.panel-header button {
font-size: 12px;
padding: 5px 8px;
text-transform: none;
}
.file-tree {
flex: 1;
min-height: 0;
overflow: auto;
padding: 8px;
}
.file-tree ul {
list-style: none;
margin: 0;
padding-left: 12px;
}
.file-tree > ul {
padding-left: 0;
}
.file-tree li {
margin: 2px 0;
}
.file-tree .folder {
color: var(--subtle);
display: block;
font-size: 13px;
font-weight: 700;
padding: 4px 6px;
}
.file-tree .file {
background: transparent;
border-radius: 6px;
color: var(--text);
display: block;
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
font-size: 13px;
font-weight: 500;
padding: 5px 7px;
text-align: left;
width: 100%;
}
.file-tree .file:hover,
.file-tree .file.active {
background: var(--active-bg);
color: var(--active-text);
text-decoration: none;
}
.danger-button {
background: transparent;
border-top: 1px solid var(--border);
border-radius: 0;
color: var(--danger);
padding: 9px 10px;
text-align: left;
}
.editor-wrap {
background: var(--editor-bg);
flex: 1;
min-height: 0;
position: relative;
}
.editor-wrap pre,
.editor-wrap textarea {
border: 0;
box-sizing: border-box;
font: 14px/1.5 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
inset: 0;
margin: 0;
overflow: auto;
padding: 12px;
position: absolute;
tab-size: 2;
white-space: pre;
}
.editor-wrap pre {
color: var(--editor-text);
pointer-events: none;
}
.editor-wrap textarea {
background: transparent;
caret-color: var(--editor-text);
color: transparent;
outline: none;
resize: none;
width: 100%;
}
.editor-wrap textarea::selection {
background: var(--selection);
}
.output-pane pre {
border-radius: 0;
flex: 1;
margin: 0;
}
.output-pane pre.error {
color: var(--error);
}
.status {
color: var(--muted);
font-size: 13px;
margin: 0;
white-space: nowrap;
}
@media (max-width: 900px) {
.layout {
grid-template-columns: 1fr;
}
.sidebar {
border-bottom: 1px solid var(--border);
border-right: 0;
max-height: 260px;
}
.playground-shell {
grid-template-columns: 1fr;
}
}