Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
design_tokens.hpp
Go to the documentation of this file.
1#pragma once
2
7
9#include <pulp/view/theme.hpp>
10// parse_w3c_tokens / export_w3c_tokens live in their own always-compiled TU
11// (reached at runtime by the WidgetBridge theme API); re-exported here so
12// existing includers of this header still see them.
14#include <optional>
15#include <string>
16#include <unordered_map>
17#include <vector>
18
19namespace pulp::view {
20
21// ── W3C Design Tokens ───────────────────────────────────────────────────
22// parse_w3c_tokens / export_w3c_tokens are declared in <pulp/view/w3c_tokens.hpp>
23// (included above) — they are runtime-needed and not gated by
24// PULP_ENABLE_DESIGN_IMPORT.
25
36std::string export_css_variables(const Theme& theme);
37
43std::string token_css_var(const std::string& token_name);
44
61 std::vector<std::string>* unresolved_widget_tokens = nullptr);
62
68std::optional<ImportDiagnostic> unmapped_widget_token_diagnostic(
69 const std::vector<std::string>& unresolved);
70
73
74// ── External tool token sync ────────────────────────────────────────────
75
79Theme parse_figma_variables(const std::string& json);
80
83std::string export_figma_variables(const Theme& theme);
84
87Theme parse_stitch_design_system(const std::string& json);
88
91std::string export_stitch_design_system(const Theme& theme);
92
93} // namespace pulp::view
Normalized intermediate representation (IR) for imported designs: the IR value model (style,...
Hover-cursor tracking for platform window hosts.
Definition fwd.hpp:27
Theme parse_stitch_design_system(const std::string &json)
Parse a Stitch Design System JSON (from MCP list_design_systems/get_screen) into a Pulp Theme.
IRTokens theme_to_ir_tokens(const Theme &theme)
Convert a Pulp Theme to W3C-compatible IR tokens.
std::string export_css_variables(const Theme &theme)
Export a Pulp Theme to CSS custom properties (variables).
Theme ir_tokens_to_theme(const IRTokens &tokens, std::vector< std::string > *unresolved_widget_tokens=nullptr)
Convert IR tokens to a Pulp Theme.
std::string export_stitch_design_system(const Theme &theme)
Export a Pulp Theme as Stitch Design System-compatible JSON.
std::string token_css_var(const std::string &token_name)
The CSS custom-property id a token binds through: -- + the token name with its trailing ....
Theme parse_figma_variables(const std::string &json)
Parse Figma Variables JSON (from MCP get_variable_defs) into a Pulp Theme.
std::string export_figma_variables(const Theme &theme)
Export a Pulp Theme as Figma Variables-compatible JSON.
std::optional< ImportDiagnostic > unmapped_widget_token_diagnostic(const std::vector< std::string > &unresolved)
The diagnostic naming the widget keys a design supplied no colour for, or nothing when it supplied th...
Design token collection (W3C-compatible).
Definition design_ir.hpp:782
Definition theme.hpp:32
W3C Design Tokens <-> Pulp Theme conversion (runtime-needed subset).