INNER CODE UNIT · Python
save_custom_styles
ChenShuo2004/cs-board · webapp/server.py:301
def save_custom_styles(items: list[dict[str, Any]]) -> None:
STATE_DIR.mkdir(exist_ok=True)
atomic_write_json(STYLES_PATH, items)
def builtin_style_record(definition: dict[str, str]) -> dict[str, Any]:
return {
"id": definition["id"],
"name": definition["name"],
"aliases": [],
"description": definition["description"],
"recipe": STYLE_PRESETS[definition["name"]],
"image_filename": "",
"deleted": False,
"builtin": True,
"created_at": 0.0,
"updated_at": 0.0,
}