Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion SLASHED-for-WP/admin-app/.vendored-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"frameworkRepo": "https://github.com/codeslash-dev/SLASHED",
"configuratorSrc": "configurator/src/",
"source": "local",
"syncedAt": "2026-07-01T18:41:55.013Z"
"syncedAt": "2026-07-02T16:31:02.085Z"
},
"vendoredFiles": [
{
Expand Down
19 changes: 16 additions & 3 deletions SLASHED-for-WP/admin-app/framework-css/core/layout.css
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
/* SLASHED — core/layout.css
@layer slashed.layout
Layout primitives: section, container, stack, cluster, grid, sidebar, switcher, frame.
Prefix: .sf-*; local rhythm via --sf-*-gap / sizing tokens. */
Prefix: .sf-*; local rhythm via --sf-*-gap / sizing tokens.
SL-005: every @container query in this file hardcodes its breakpoint
instead of referencing a --sf-* token — var() is not allowed inside an
@container condition per the CSS spec. This applies framework-wide to
every @container site below; not re-explained at each one. */

@layer slashed.layout {


/* Section */
.sf-section { padding-block: var(--sf-section-pad); }
.sf-section--xs { --sf-section-pad: var(--sf-section-pad--xs); }
.sf-section--s { --sf-section-pad: var(--sf-section-pad--s); }
Expand Down Expand Up @@ -52,6 +56,7 @@
}


/* Container */
.sf-container {
container: sf-layout / inline-size;
width: 100%;
Expand All @@ -71,6 +76,7 @@
}


/* Stack & gap */
.sf-stack {
display: flex;
flex-direction: column;
Expand All @@ -96,12 +102,14 @@
.sf-gap--2xl { gap: var(--sf-space-2xl); }


/* Box */
.sf-box {
padding: var(--sf-box-padding);
outline: var(--sf-box-border-width) solid var(--sf-box-border-color);
}


/* Center */
.sf-center {
box-sizing: content-box;
width: auto;
Expand All @@ -117,6 +125,7 @@
}


/* Cluster */
.sf-cluster {
display: flex;
flex-wrap: wrap;
Expand All @@ -137,6 +146,7 @@
.sf-cluster--between { justify-content: space-between; }


/* Sidebar */
.sf-sidebar {
display: flex;
flex-wrap: wrap;
Expand Down Expand Up @@ -169,6 +179,7 @@
.sf-sidebar--wide { --sf-sidebar-width: 26rem; }


/* Switcher */
.sf-switcher {
display: flex;
flex-wrap: wrap;
Expand All @@ -184,6 +195,7 @@
.sf-switcher--vertical { flex-direction: column; }


/* Grid & icon */
.sf-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(min(var(--sf-grid-min), 100%), 1fr));
Expand Down Expand Up @@ -229,6 +241,7 @@
}


/* Cover */
.sf-cover {
display: flex;
flex-direction: column;
Expand All @@ -247,6 +260,7 @@
.sf-cover--padding-l { padding-block: var(--sf-space-4xl); }


/* Frame */
.sf-frame {
aspect-ratio: var(--sf-frame-ratio);
overflow: hidden;
Expand Down Expand Up @@ -395,7 +409,6 @@
container: sf-grid / inline-size;
}

/* Cannot use var() inside @container per CSS spec — breakpoints hardcoded. */
@container (min-width: 30em) {
.sf-grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
.sf-grid-cols-6 { grid-template-columns: repeat(3, 1fr); }
Expand Down
7 changes: 6 additions & 1 deletion SLASHED-for-WP/admin-app/framework-css/core/themes.css
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,12 @@

/* SECTION-LEVEL THEMING */
/* light-dark() bakes at :root declaration time; re-declarations on [data-theme]
elements are required for section-level theming to work. */
elements are required for section-level theming to work.
SL-001: the clamp() derivation formula below is the same one used inside
tokens.css's "Resolved color tokens — auto-switch via light-dark()"
block (search core/tokens.css for that comment) — duplicated here, not
shared, because this file needs flat values outside light-dark().
Keep both copies in sync if the formula ever changes. */
@supports (color: oklch(from red l c h)) {

:root {
Expand Down
22 changes: 16 additions & 6 deletions SLASHED-for-WP/admin-app/framework-css/core/tokens.css
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,20 @@
--sf-color-danger: var(--sf-color-danger-source-light);
}

/* Mode flag — drives formula direction for non-color dark overrides.
Set by themes.css via [data-theme="dark"] and the prefers-color-scheme
media query. Do not set directly. */
/* Mode flag — INTERNAL, not a public hook (SL-003: same "--sf-is-*" naming
pattern as the public flags below, opposite contract — read here, don't
set). Drives formula direction for non-color dark overrides. Set only by
themes.css via [data-theme="dark"] and the prefers-color-scheme media
query; every other read site (core/tokens.css, the configurator's power
knobs) only reads it inside calc() expressions. Setting it directly
desyncs it from color-scheme/[data-theme] and produces an inconsistent
theme. */
@property --sf-is-dark { syntax: "<integer>"; inherits: true; initial-value: 0; }

/* @property — INTERACTION STATE FLAGS */
/* Public hooks for Style Queries. Allow components to react to states
toggled on ancestors via .is-* classes. */
/* PUBLIC hooks for Style Queries — safe to set from consumer code, unlike
--sf-is-dark above. Allow components to react to states toggled on
ancestors via .is-* classes. */
@property --sf-is-active { syntax: "<integer>"; inherits: true; initial-value: 0; }
@property --sf-is-current { syntax: "<integer>"; inherits: true; initial-value: 0; }
@property --sf-is-pressed { syntax: "<integer>"; inherits: true; initial-value: 0; }
Expand Down Expand Up @@ -366,7 +372,11 @@
Dark auto-derivation formula (brand + status):
clamp(0.65, 0.95 - l*0.5, 0.88) lightens dark-mode value relative to the light source.
Surface inverts: clamp(0.16, 1.18 - l, 0.24) — near-white flips to near-dark.
Override any --sf-color-X-dark to take full per-mode control. */
Override any --sf-color-X-dark to take full per-mode control.
SL-001: this same clamp() formula is re-declared flat in themes.css
(SECTION-LEVEL THEMING) so [data-theme] overrides on non-:root elements
still resolve correctly — light-dark() only bakes at :root. Keep both
copies in sync if the formula ever changes. */
--sf-color-primary: light-dark(var(--sf-color-primary-source-light), var(--sf-color-primary-source-dark, oklch(from var(--sf-color-primary-source-light) clamp(0.65, calc(0.95 - l * 0.5), 0.88) calc(c * 0.9) h)));
--sf-color-secondary: light-dark(var(--sf-color-secondary-source-light), var(--sf-color-secondary-source-dark, oklch(from var(--sf-color-secondary-source-light) clamp(0.65, calc(0.95 - l * 0.5), 0.88) calc(c * 0.9) h)));
--sf-color-tertiary: light-dark(var(--sf-color-tertiary-source-light), var(--sf-color-tertiary-source-dark, oklch(from var(--sf-color-tertiary-source-light) clamp(0.65, calc(0.95 - l * 0.5), 0.88) calc(c * 0.9) h)));
Expand Down
16 changes: 8 additions & 8 deletions SLASHED-for-WP/admin-app/src/App.svelte
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<script lang="ts">
import { onMount, untrack } from 'svelte';
import { SlidersHorizontal, Eye, RotateCcw } from 'lucide-svelte';
import type { PreviewTemplate, SlashedToken } from './types';
import { SlidersHorizontal, Eye, RotateCcw } from '@lucide/svelte';
import type { PreviewTemplate, SlashedToken, ApiIndex } from './types';
import StudioHeader from './components/shell/StudioHeader.svelte';
import SidebarNav from './components/shell/SidebarNav.svelte';
import StatusBar from './components/shell/StatusBar.svelte';
import PreviewPanel from './components/shell/PreviewPanel.svelte';
import DomainPanel from './components/DomainPanel.svelte';
import { fa } from './lib/codec';
import { generateCSS } from './lib/codec';
import { loadInitialOverrides, injectLivePreview, saveOverrides, hasWpBoot } from './lib/persistence';
import { domainOf } from './lib/domains';
import tokensRaw from './data/api-index.generated.json';
import CommandPalette from './components/CommandPalette.svelte';

const ALL_TOKENS = ((tokensRaw as any).tokens ?? tokensRaw) as SlashedToken[];
const ALL_TOKENS = ((tokensRaw as ApiIndex).tokens ?? tokensRaw) as SlashedToken[];

const DOMAIN_LABELS: Record<string, string> = {
home: "Home", colors: "Colors", typography: "Typography", spacing: "Spacing",
Expand Down Expand Up @@ -79,7 +79,7 @@

// Save state — hasPendingChanges is derived so undo/redo update it automatically.
let lastSavedOverrides = $state<Record<string, string>>(untrack(() => ({ ...overrides })));
let saveState = $state<'idle' | 'saving' | 'saved'>('idle');
let saveState = $state<'idle' | 'saving' | 'saved' | 'error'>('idle');
let hasPendingChanges = $derived(!shallowEq(overrides, lastSavedOverrides));
let saveStateTimer: ReturnType<typeof setTimeout> | null = null;

Expand All @@ -92,7 +92,7 @@
if (!shallowEq(prev, next)) {
past = [...past.slice(-49), prev];
future = [];
if (saveState === 'saved') saveState = 'idle';
if (saveState === 'saved' || saveState === 'error') saveState = 'idle';
}
overrides = next;
}
Expand All @@ -117,7 +117,7 @@
}
} catch (err) {
console.warn('slashed: save failed', err);
saveState = 'idle';
saveState = 'error';
}
}

Expand Down Expand Up @@ -219,7 +219,7 @@
}

function handleExport() {
const css = fa(overrides, { mode: "layer", banner: true });
const css = generateCSS(overrides, { mode: "layer", banner: true });
const blob = new Blob([css], { type: "text/css" });
const url = URL.createObjectURL(blob);
const a = document.createElement("a");
Expand Down
2 changes: 1 addition & 1 deletion SLASHED-for-WP/admin-app/src/components/DomainPanel.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import { SlidersHorizontal, List } from 'lucide-svelte';
import { SlidersHorizontal, List } from '@lucide/svelte';
import type { SlashedToken } from '../types';
import { DOMAIN_PATTERNS, domainOf } from '../lib/domains';
import HomePanel from './panels/HomePanel.svelte';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
<script lang="ts">
import classesData from '../../data/classes.generated.json';
import tokensData from '../../data/api-index.generated.json';
import { Copy, Check } from 'lucide-svelte';
import { Copy, Check } from '@lucide/svelte';
import type { SlashedClass } from '../../types';

const classes = classesData.classes;
const tokens = tokensData.tokens.filter((t: any) => t.tier === 'PUBLIC' || t.tier === 'PUBLIC-ADVANCED');
const tokens = tokensData.tokens.filter((t) => t.tier === 'PUBLIC' || t.tier === 'PUBLIC-ADVANCED');

let query = $state('');
let tab = $state<'classes' | 'tokens'>('classes');
Expand All @@ -17,7 +18,7 @@
let filteredClasses = $derived(() => {
const q = query.trim().toLowerCase();
if (!q) return classes;
return classes.filter((c: any) =>
return classes.filter((c: SlashedClass) =>
c.name.toLowerCase().includes(q) ||
c.selector?.toLowerCase().includes(q) ||
c.description?.toLowerCase().includes(q) ||
Expand All @@ -28,7 +29,7 @@
let filteredTokens = $derived(() => {
const q = query.trim().toLowerCase();
if (!q) return tokens;
return tokens.filter((t: any) =>
return tokens.filter((t) =>
t.name.toLowerCase().includes(q) ||
t.description?.toLowerCase().includes(q) ||
t.group?.toLowerCase().includes(q) ||
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import { Check, Copy, Download, Link } from 'lucide-svelte';
import { fa, qa } from '../../lib/codec';
import { Check, Copy, Download, Link } from '@lucide/svelte';
import { generateCSS, buildShareUrl } from '../../lib/codec';

let { overrides }: {
overrides: Record<string, string>;
Expand All @@ -10,7 +10,7 @@
let copied = $state(false);
let copiedLink = $state(false);

let css = $derived(fa(overrides, { mode: outputMode, banner: true }));
let css = $derived(generateCSS(overrides, { mode: outputMode, banner: true }));
let count = $derived(Object.keys(overrides).length);

async function handleCopy() {
Expand All @@ -23,7 +23,7 @@

async function handleCopyLink() {
try {
const url = qa(overrides);
const url = buildShareUrl(overrides);
await navigator.clipboard.writeText(url);
copiedLink = true;
setTimeout(() => { copiedLink = false; }, 2000);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import {
Sparkles, Palette, Type, Ruler, Layout, Square, Layers, Zap,
Puzzle, Blocks, SwatchBook, ShieldCheck, Package, BookOpen, Save,
} from 'lucide-svelte';
} from '@lucide/svelte';
import type { SavedSlot } from '../../types';
import { listSavedThemes, saveTheme } from '../../lib/savedThemes';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import { Save, Trash2, Check } from 'lucide-svelte';
import { Save, Trash2, Check } from '@lucide/svelte';
import type { SavedSlot } from '../../types';
import { listSavedThemes, saveTheme, deleteTheme } from '../../lib/savedThemes';

Expand Down
Loading