返回 CodeWhale
sync.js
1 // Generated from Codewhale design 5.5.0; sha256 b154b28c796626428f20b38db59ee6449aa876831ae04d4ddceb3cb1fce8185c. Do not edit.
2 const PAYLOAD = {
3 "version": "5.5.0",
4 "textStyles": [
5 {
6 "name": "CW 5/Caption",
7 "family": "Geist",
8 "style": "Regular",
9 "size": 11.5,
10 "line": 16
11 },
12 {
13 "name": "CW 5/Label",
14 "family": "Geist",
15 "style": "Regular",
16 "size": 12.5,
17 "line": 18
18 },
19 {
20 "name": "CW 5/Control",
21 "family": "Geist",
22 "style": "Regular",
23 "size": 13,
24 "line": 20
25 },
26 {
27 "name": "CW 5/Body",
28 "family": "Geist",
29 "style": "Regular",
30 "size": 14,
31 "line": 22
32 },
33 {
34 "name": "CW 5/Reading",
35 "family": "Geist",
36 "style": "Regular",
37 "size": 15,
38 "line": 25
39 },
40 {
41 "name": "CW 5/Prose",
42 "family": "Geist",
43 "style": "Regular",
44 "size": 16,
45 "line": 27
46 },
47 {
48 "name": "CW 5/Heading",
49 "family": "Geist",
50 "style": "SemiBold",
51 "size": 15,
52 "line": 22
53 },
54 {
55 "name": "CW 5/Subheading",
56 "family": "Geist",
57 "style": "SemiBold",
58 "size": 17,
59 "line": 26
60 },
61 {
62 "name": "CW 5/Title",
63 "family": "Geist",
64 "style": "SemiBold",
65 "size": 22,
66 "line": 28
67 },
68 {
69 "name": "CW 5/Display",
70 "family": "Geist",
71 "style": "SemiBold",
72 "size": 28,
73 "line": 34
74 },
75 {
76 "name": "CW 5/Code",
77 "family": "Geist Mono",
78 "style": "Regular",
79 "size": 13,
80 "line": 20
81 }
82 ],
83 "collections": [
84 {
85 "name": "CW 5 \u00b7 Color",
86 "modes": [
87 "Dark",
88 "Light"
89 ],
90 "variables": [
91 {
92 "name": "outside",
93 "type": "COLOR",
94 "scopes": [
95 "FRAME_FILL",
96 "SHAPE_FILL"
97 ],
98 "web": "var(--outside)",
99 "values": {
100 "Dark": {
101 "hex": "0f131c",
102 "alpha": 1
103 },
104 "Light": {
105 "hex": "fcfdfe",
106 "alpha": 1
107 }
108 }
109 },
110 {
111 "name": "surface",
112 "type": "COLOR",
113 "scopes": [
114 "FRAME_FILL",
115 "SHAPE_FILL"
116 ],
117 "web": "var(--surface)",
118 "values": {
119 "Dark": {
120 "hex": "05070b",
121 "alpha": 1
122 },
123 "Light": {
124 "hex": "f4f7fc",
125 "alpha": 1
126 }
127 }
128 },
129 {
130 "name": "panel",
131 "type": "COLOR",
132 "scopes": [
133 "FRAME_FILL",
134 "SHAPE_FILL"
135 ],
136 "web": "var(--panel)",
137 "values": {
138 "Dark": {
139 "hex": "080b11",
140 "alpha": 1
141 },
142 "Light": {
143 "hex": "fefeff",
144 "alpha": 1
145 }
146 }
147 },
148 {
149 "name": "text",
150 "type": "COLOR",
151 "scopes": [
152 "SHAPE_FILL",
153 "TEXT_FILL",
154 "STROKE_COLOR"
155 ],
156 "web": "var(--text)",
157 "values": {
158 "Dark": {
159 "hex": "edf1f7",
160 "alpha": 1
161 },
162 "Light": {
163 "hex": "162230",
164 "alpha": 1
165 }
166 }
167 },
168 {
169 "name": "muted",
170 "type": "COLOR",
171 "scopes": [
172 "SHAPE_FILL",
173 "TEXT_FILL",
174 "STROKE_COLOR"
175 ],
176 "web": "var(--muted)",
177 "values": {
178 "Dark": {
179 "hex": "b2bfcd",
180 "alpha": 1
181 },
182 "Light": {
183 "hex": "45515f",
184 "alpha": 1
185 }
186 }
187 },
188 {
189 "name": "subagent",
190 "type": "COLOR",
191 "scopes": [
192 "SHAPE_FILL",
193 "TEXT_FILL",
194 "STROKE_COLOR"
195 ],
196 "web": "var(--subagent)",
197 "values": {
198 "Dark": {
199 "hex": "bccad9",
200 "alpha": 1
201 },
202 "Light": {
203 "hex": "374553",
204 "alpha": 1
205 }
206 }
207 },
208 {
209 "name": "disabled",
210 "type": "COLOR",
211 "scopes": [
212 "SHAPE_FILL",
213 "TEXT_FILL",
214 "STROKE_COLOR"
215 ],
216 "web": "var(--disabled)",
217 "values": {
218 "Dark": {
219 "hex": "828f9e",
220 "alpha": 1
221 },
222 "Light": {
223 "hex": "68727f",
224 "alpha": 1
225 }
226 }
227 },
228 {
229 "name": "line",
230 "type": "COLOR",
231 "scopes": [
232 "FRAME_FILL",
233 "SHAPE_FILL",
234 "STROKE_COLOR"
235 ],
236 "web": "var(--line)",
237 "values": {
238 "Dark": {
239 "hex": "263040",
240 "alpha": 1
241 },
242 "Light": {
243 "hex": "d5dde8",
244 "alpha": 1
245 }
246 }
247 },
248 {
249 "name": "accent",
250 "type": "COLOR",
251 "scopes": [
252 "FRAME_FILL",
253 "SHAPE_FILL",
254 "TEXT_FILL",
255 "STROKE_COLOR"
256 ],
257 "web": "var(--accent)",
258 "values": {
259 "Dark": {
260 "hex": "94beff",
261 "alpha": 1
262 },
263 "Light": {
264 "hex": "1552c6",
265 "alpha": 1
266 }
267 }
268 },
269 {
270 "name": "button",
271 "type": "COLOR",
272 "scopes": [
273 "FRAME_FILL",
274 "SHAPE_FILL"
275 ],
276 "web": "var(--button)",
277 "values": {
278 "Dark": {
279 "hex": "0b4cc4",
280 "alpha": 1
281 },
282 "Light": {
283 "hex": "0b4cc4",
284 "alpha": 1
285 }
286 }
287 },
288 {
289 "name": "button-text",
290 "type": "COLOR",
291 "scopes": [
292 "SHAPE_FILL",
293 "TEXT_FILL",
294 "STROKE_COLOR"
295 ],
296 "web": "var(--button-text)",
297 "values": {
298 "Dark": {
299 "hex": "ffffff",
300 "alpha": 1
301 },
302 "Light": {
303 "hex": "ffffff",
304 "alpha": 1
305 }
306 }
307 },
308 {
309 "name": "attention",
310 "type": "COLOR",
311 "scopes": [
312 "SHAPE_FILL",
313 "TEXT_FILL",
314 "STROKE_COLOR"
315 ],
316 "web": "var(--attention)",
317 "values": {
318 "Dark": {
319 "hex": "f0be82",
320 "alpha": 1
321 },
322 "Light": {
323 "hex": "7b4b06",
324 "alpha": 1
325 }
326 }
327 },
328 {
329 "name": "hover",
330 "type": "COLOR",
331 "scopes": [
332 "FRAME_FILL",
333 "SHAPE_FILL"
334 ],
335 "web": "var(--hover)",
336 "values": {
337 "Dark": {
338 "hex": "202938",
339 "alpha": 1
340 },
341 "Light": {
342 "hex": "e2eaf4",
343 "alpha": 1
344 }
345 }
346 },
347 {
348 "name": "selected",
349 "type": "COLOR",
350 "scopes": [
351 "FRAME_FILL",
352 "SHAPE_FILL"
353 ],
354 "web": "var(--selected)",
355 "values": {
356 "Dark": {
357 "hex": "18202e",
358 "alpha": 1
359 },
360 "Light": {
361 "hex": "d6e1f0",
362 "alpha": 1
363 }
364 }
365 },
366 {
367 "name": "live",
368 "type": "COLOR",
369 "scopes": [
370 "SHAPE_FILL",
371 "TEXT_FILL",
372 "STROKE_COLOR"
373 ],
374 "web": "var(--live)",
375 "values": {
376 "Dark": {
377 "hex": "7fdfc8",
378 "alpha": 1
379 },
380 "Light": {
381 "hex": "146857",
382 "alpha": 1
383 }
384 }
385 },
386 {
387 "name": "live-peak",
388 "type": "COLOR",
389 "scopes": [
390 "SHAPE_FILL",
391 "TEXT_FILL",
392 "STROKE_COLOR"
393 ],
394 "web": "var(--live-peak)",
395 "values": {
396 "Dark": {
397 "hex": "e3fcf4",
398 "alpha": 1
399 },
400 "Light": {
401 "hex": "0b3f33",
402 "alpha": 1
403 }
404 }
405 },
406 {
407 "name": "danger",
408 "type": "COLOR",
409 "scopes": [
410 "SHAPE_FILL",
411 "TEXT_FILL",
412 "STROKE_COLOR"
413 ],
414 "web": "var(--danger)",
415 "values": {
416 "Dark": {
417 "hex": "f4a8a0",
418 "alpha": 1
419 },
420 "Light": {
421 "hex": "a42531",
422 "alpha": 1
423 }
424 }
425 },
426 {
427 "name": "border-strong",
428 "type": "COLOR",
429 "scopes": [
430 "STROKE_COLOR"
431 ],
432 "web": "var(--border-strong)",
433 "values": {
434 "Dark": {
435 "hex": "8a97a8",
436 "alpha": 1
437 },
438 "Light": {
439 "hex": "687381",
440 "alpha": 1
441 }
442 }
443 },
444 {
445 "name": "ocean-depth",
446 "type": "COLOR",
447 "scopes": [
448 "FRAME_FILL",
449 "SHAPE_FILL"
450 ],
451 "web": "var(--ocean-depth)",
452 "values": {
453 "Dark": {
454 "hex": "0b111c",
455 "alpha": 1
456 },
457 "Light": {
458 "hex": "f7f9fc",
459 "alpha": 1
460 }
461 }
462 },
463 {
464 "name": "diff-add",
465 "type": "COLOR",
466 "scopes": [
467 "FRAME_FILL",
468 "SHAPE_FILL"
469 ],
470 "web": "var(--diff-add)",
471 "values": {
472 "Dark": {
473 "hex": "1d352a",
474 "alpha": 1
475 },
476 "Light": {
477 "hex": "d2ebdd",
478 "alpha": 1
479 }
480 }
481 },
482 {
483 "name": "diff-remove",
484 "type": "COLOR",
485 "scopes": [
486 "FRAME_FILL",
487 "SHAPE_FILL"
488 ],
489 "web": "var(--diff-remove)",
490 "values": {
491 "Dark": {
492 "hex": "422b2c",
493 "alpha": 1
494 },
495 "Light": {
496 "hex": "f8e1dd",
497 "alpha": 1
498 }
499 }
500 },
501 {
502 "name": "card/fill",
503 "type": "COLOR",
504 "scopes": [
505 "FRAME_FILL",
506 "SHAPE_FILL"
507 ],
508 "web": "var(--card-fill)",
509 "values": {
510 "Dark": {
511 "hex": "ffffff",
512 "alpha": 0.04
513 },
514 "Light": {
515 "hex": "ffffff",
516 "alpha": 1
517 }
518 }
519 },
520 {
521 "name": "card/border",
522 "type": "COLOR",
523 "scopes": [
524 "STROKE_COLOR"
525 ],
526 "web": "var(--card-border)",
527 "values": {
528 "Dark": {
529 "hex": "ffffff",
530 "alpha": 0.095
531 },
532 "Light": {
533 "hex": "182838",
534 "alpha": 0.1
535 }
536 }
537 },
538 {
539 "name": "sheet/fill",
540 "type": "COLOR",
541 "scopes": [
542 "FRAME_FILL",
543 "SHAPE_FILL"
544 ],
545 "web": "var(--sheet-fill)",
546 "values": {
547 "Dark": {
548 "hex": "090c13",
549 "alpha": 0.8
550 },
551 "Light": {
552 "hex": "ffffff",
553 "alpha": 0.92
554 }
555 }
556 },
557 {
558 "name": "sheet/border",
559 "type": "COLOR",
560 "scopes": [
561 "STROKE_COLOR"
562 ],
563 "web": "var(--sheet-border)",
564 "values": {
565 "Dark": {
566 "hex": "ffffff",
567 "alpha": 0.075
568 },
569 "Light": {
570 "hex": "182838",
571 "alpha": 0.09
572 }
573 }
574 },
575 {
576 "name": "change-bar/fill",
577 "type": "COLOR",
578 "scopes": [
579 "FRAME_FILL",
580 "SHAPE_FILL"
581 ],
582 "web": "var(--change-bar-fill)",
583 "values": {
584 "Dark": {
585 "hex": "ffffff",
586 "alpha": 0.045
587 },
588 "Light": {
589 "hex": "1b2a35",
590 "alpha": 0.035
591 }
592 }
593 },
594 {
595 "name": "change-bar/border",
596 "type": "COLOR",
597 "scopes": [
598 "STROKE_COLOR"
599 ],
600 "web": "var(--change-bar-border)",
601 "values": {
602 "Dark": {
603 "hex": "ffffff",
604 "alpha": 0.1
605 },
606 "Light": {
607 "hex": "1f3340",
608 "alpha": 0.11
609 }
610 }
611 },
612 {
613 "name": "subagent-tag/fill",
614 "type": "COLOR",
615 "scopes": [
616 "FRAME_FILL",
617 "SHAPE_FILL"
618 ],
619 "web": "var(--subagent-tag-fill)",
620 "values": {
621 "Dark": {
622 "hex": "94beff",
623 "alpha": 0.09
624 },
625 "Light": {
626 "hex": "1b2a35",
627 "alpha": 0.055
628 }
629 }
630 },
631 {
632 "name": "subagent-tag/border",
633 "type": "COLOR",
634 "scopes": [
635 "STROKE_COLOR"
636 ],
637 "web": "var(--subagent-tag-border)",
638 "values": {
639 "Dark": {
640 "hex": "94beff",
641 "alpha": 0.24
642 },
643 "Light": {
644 "hex": "1f3340",
645 "alpha": 0.14
646 }
647 }
648 },
649 {
650 "name": "workbar/fill",
651 "type": "COLOR",
652 "scopes": [
653 "FRAME_FILL",
654 "SHAPE_FILL"
655 ],
656 "web": "var(--workbar-fill)",
657 "values": {
658 "Dark": {
659 "hex": "0e131d",
660 "alpha": 0.74
661 },
662 "Light": {
663 "hex": "eef3f8",
664 "alpha": 0.78
665 }
666 }
667 },
668 {
669 "name": "workbar/border",
670 "type": "COLOR",
671 "scopes": [
672 "STROKE_COLOR"
673 ],
674 "web": "var(--workbar-border)",
675 "values": {
676 "Dark": {
677 "hex": "ffffff",
678 "alpha": 0.09
679 },
680 "Light": {
681 "hex": "1f3340",
682 "alpha": 0.1
683 }
684 }
685 },
686 {
687 "name": "workbar/track",
688 "type": "COLOR",
689 "scopes": [
690 "FRAME_FILL",
691 "SHAPE_FILL"
692 ],
693 "web": "var(--workbar-track)",
694 "values": {
695 "Dark": {
696 "hex": "ffffff",
697 "alpha": 0.13
698 },
699 "Light": {
700 "hex": "1b2a35",
701 "alpha": 0.11
702 }
703 }
704 },
705 {
706 "name": "glass/clear-fill",
707 "type": "COLOR",
708 "scopes": [
709 "FRAME_FILL",
710 "SHAPE_FILL"
711 ],
712 "web": "var(--glass-clear-fill)",
713 "values": {
714 "Dark": {
715 "hex": "141a25",
716 "alpha": 0.42
717 },
718 "Light": {
719 "hex": "ffffff",
720 "alpha": 0.48
721 }
722 }
723 },
724 {
725 "name": "glass/frosted-fill",
726 "type": "COLOR",
727 "scopes": [
728 "FRAME_FILL",
729 "SHAPE_FILL"
730 ],
731 "web": "var(--glass-frosted-fill)",
732 "values": {
733 "Dark": {
734 "hex": "141a25",
735 "alpha": 0.64
736 },
737 "Light": {
738 "hex": "ffffff",
739 "alpha": 0.72
740 }
741 }
742 },
743 {
744 "name": "glass/solid-fill",
745 "type": "COLOR",
746 "scopes": [
747 "FRAME_FILL",
748 "SHAPE_FILL"
749 ],
750 "web": "var(--glass-solid-fill)",
751 "values": {
752 "Dark": {
753 "hex": "141a25",
754 "alpha": 1
755 },
756 "Light": {
757 "hex": "ffffff",
758 "alpha": 1
759 }
760 }
761 },
762 {
763 "name": "glass/border",
764 "type": "COLOR",
765 "scopes": [
766 "STROKE_COLOR"
767 ],
768 "web": "var(--glass-border)",
769 "values": {
770 "Dark": {
771 "hex": "ffffff",
772 "alpha": 0.1
773 },
774 "Light": {
775 "hex": "182838",
776 "alpha": 0.11
777 }
778 }
779 },
780 {
781 "name": "glass/highlight",
782 "type": "COLOR",
783 "scopes": [
784 "STROKE_COLOR"
785 ],
786 "web": "var(--glass-highlight)",
787 "values": {
788 "Dark": {
789 "hex": "ffffff",
790 "alpha": 0.16
791 },
792 "Light": {
793 "hex": "ffffff",
794 "alpha": 0.88
795 }
796 }
797 },
798 {
799 "name": "ombre/rise",
800 "type": "COLOR",
801 "scopes": [
802 "FRAME_FILL",
803 "SHAPE_FILL"
804 ],
805 "web": "var(--ombre-rise)",
806 "values": {
807 "Dark": {
808 "hex": "176fd0",
809 "alpha": 1
810 },
811 "Light": {
812 "hex": "176fd0",
813 "alpha": 1
814 }
815 }
816 },
817 {
818 "name": "ombre/deep",
819 "type": "COLOR",
820 "scopes": [
821 "FRAME_FILL",
822 "SHAPE_FILL"
823 ],
824 "web": "var(--ombre-deep)",
825 "values": {
826 "Dark": {
827 "hex": "0b4cc4",
828 "alpha": 1
829 },
830 "Light": {
831 "hex": "0b4cc4",
832 "alpha": 1
833 }
834 }
835 },
836 {
837 "name": "water/top",
838 "type": "COLOR",
839 "scopes": [
840 "FRAME_FILL"
841 ],
842 "web": "var(--water) \u00b7 top stop",
843 "values": {
844 "Dark": {
845 "hex": "0d1422",
846 "alpha": 1
847 },
848 "Light": {
849 "hex": "e2ebf7",
850 "alpha": 1
851 }
852 }
853 },
854 {
855 "name": "water/upper",
856 "type": "COLOR",
857 "scopes": [
858 "FRAME_FILL"
859 ],
860 "web": "var(--water) \u00b7 upper stop",
861 "values": {
862 "Dark": {
863 "hex": "090e19",
864 "alpha": 1
865 },
866 "Light": {
867 "hex": "e9f0f9",
868 "alpha": 1
869 }
870 }
871 },
872 {
873 "name": "water/lower",
874 "type": "COLOR",
875 "scopes": [
876 "FRAME_FILL"
877 ],
878 "web": "var(--water) \u00b7 lower stop",
879 "values": {
880 "Dark": {
881 "hex": "060910",
882 "alpha": 1
883 },
884 "Light": {
885 "hex": "eff4fb",
886 "alpha": 1
887 }
888 }
889 },
890 {
891 "name": "water/bottom",
892 "type": "COLOR",
893 "scopes": [
894 "FRAME_FILL"
895 ],
896 "web": "var(--water) \u00b7 bottom stop",
897 "values": {
898 "Dark": {
899 "hex": "05070b",
900 "alpha": 1
901 },
902 "Light": {
903 "hex": "f4f7fc",
904 "alpha": 1
905 }
906 }
907 },
908 {
909 "name": "surface-light/peak",
910 "type": "COLOR",
911 "scopes": [
912 "FRAME_FILL"
913 ],
914 "web": "var(--surface-light) \u00b7 peak stop",
915 "values": {
916 "Dark": {
917 "hex": "3b82f6",
918 "alpha": 0.18
919 },
920 "Light": {
921 "hex": "ffffff",
922 "alpha": 0.9
923 }
924 }
925 },
926 {
927 "name": "surface-light/mid",
928 "type": "COLOR",
929 "scopes": [
930 "FRAME_FILL"
931 ],
932 "web": "var(--surface-light) \u00b7 mid stop",
933 "values": {
934 "Dark": {
935 "hex": "0b48bb",
936 "alpha": 0.06
937 },
938 "Light": {
939 "hex": "ffffff",
940 "alpha": 0.32
941 }
942 }
943 },
944 {
945 "name": "surface-light/edge",
946 "type": "COLOR",
947 "scopes": [
948 "FRAME_FILL"
949 ],
950 "web": "var(--surface-light) \u00b7 edge stop",
951 "values": {
952 "Dark": {
953 "hex": "0b48bb",
954 "alpha": 0
955 },
956 "Light": {
957 "hex": "ffffff",
958 "alpha": 0
959 }
960 }
961 },
962 {
963 "name": "shadow/popover",
964 "type": "COLOR",
965 "scopes": [
966 "EFFECT_COLOR"
967 ],
968 "web": "var(--elevation-popover)",
969 "values": {
970 "Dark": {
971 "hex": "000000",
972 "alpha": 0.4
973 },
974 "Light": {
975 "hex": "000000",
976 "alpha": 0.16
977 }
978 }
979 },
980 {
981 "name": "shadow/dialog",
982 "type": "COLOR",
983 "scopes": [
984 "EFFECT_COLOR"
985 ],
986 "web": "var(--elevation-dialog)",
987 "values": {
988 "Dark": {
989 "hex": "000000",
990 "alpha": 0.5
991 },
992 "Light": {
993 "hex": "000000",
994 "alpha": 0.2
995 }
996 }
997 },
998 {
999 "name": "effort/fill",
1000 "type": "COLOR",
1001 "scopes": [
1002 "FRAME_FILL",
1003 "SHAPE_FILL"
1004 ],
1005 "web": "var(--tint-accent-fill)",
1006 "values": {
1007 "Dark": {
1008 "hex": "94beff",
1009 "alpha": 0.12
1010 },
1011 "Light": {
1012 "hex": "1552c6",
1013 "alpha": 0.12
1014 }
1015 }
1016 },
1017 {
1018 "name": "chip/accent-border",
1019 "type": "COLOR",
1020 "scopes": [
1021 "STROKE_COLOR"
1022 ],
1023 "web": "var(--tint-accent-border)",
1024 "values": {
1025 "Dark": {
1026 "hex": "94beff",
1027 "alpha": 0.35
1028 },
1029 "Light": {
1030 "hex": "1552c6",
1031 "alpha": 0.35
1032 }
1033 }
1034 },
1035 {
1036 "name": "tint/live-fill",
1037 "type": "COLOR",
1038 "scopes": [
1039 "FRAME_FILL",
1040 "SHAPE_FILL"
1041 ],
1042 "web": "var(--tint-live-fill)",
1043 "values": {
1044 "Dark": {
1045 "hex": "7fdfc8",
1046 "alpha": 0.1
1047 },
1048 "Light": {
1049 "hex": "146857",
1050 "alpha": 0.1
1051 }
1052 }
1053 },
1054 {
1055 "name": "tint/live-border",
1056 "type": "COLOR",
1057 "scopes": [
1058 "STROKE_COLOR"
1059 ],
1060 "web": "var(--tint-live-border)",
1061 "values": {
1062 "Dark": {
1063 "hex": "7fdfc8",
1064 "alpha": 0.42
1065 },
1066 "Light": {
1067 "hex": "146857",
1068 "alpha": 0.42
1069 }
1070 }
1071 },
1072 {
1073 "name": "tint/attention-fill",
1074 "type": "COLOR",
1075 "scopes": [
1076 "FRAME_FILL",
1077 "SHAPE_FILL"
1078 ],
1079 "web": "var(--tint-attention-fill)",
1080 "values": {
1081 "Dark": {
1082 "hex": "f0be82",
1083 "alpha": 0.1
1084 },
1085 "Light": {
1086 "hex": "7b4b06",
1087 "alpha": 0.1
1088 }
1089 }
1090 },
1091 {
1092 "name": "tint/attention-border",
1093 "type": "COLOR",
1094 "scopes": [
1095 "STROKE_COLOR"
1096 ],
1097 "web": "var(--tint-attention-border)",
1098 "values": {
1099 "Dark": {
1100 "hex": "f0be82",
1101 "alpha": 0.42
1102 },
1103 "Light": {
1104 "hex": "7b4b06",
1105 "alpha": 0.42
1106 }
1107 }
1108 },
1109 {
1110 "name": "tint/danger-fill",
1111 "type": "COLOR",
1112 "scopes": [
1113 "FRAME_FILL",
1114 "SHAPE_FILL"
1115 ],
1116 "web": "var(--tint-danger-fill)",
1117 "values": {
1118 "Dark": {
1119 "hex": "f4a8a0",
1120 "alpha": 0.1
1121 },
1122 "Light": {
1123 "hex": "a42531",
1124 "alpha": 0.1
1125 }
1126 }
1127 },
1128 {
1129 "name": "tint/danger-border",
1130 "type": "COLOR",
1131 "scopes": [
1132 "STROKE_COLOR"
1133 ],
1134 "web": "var(--tint-danger-border)",
1135 "values": {
1136 "Dark": {
1137 "hex": "f4a8a0",
1138 "alpha": 0.45
1139 },
1140 "Light": {
1141 "hex": "a42531",
1142 "alpha": 0.45
1143 }
1144 }
1145 },
1146 {
1147 "name": "count/fill",
1148 "type": "COLOR",
1149 "scopes": [
1150 "FRAME_FILL",
1151 "SHAPE_FILL"
1152 ],
1153 "web": "var(--tint-count-fill)",
1154 "values": {
1155 "Dark": {
1156 "hex": "edf1f7",
1157 "alpha": 0.08
1158 },
1159 "Light": {
1160 "hex": "162230",
1161 "alpha": 0.08
1162 }
1163 }
1164 },
1165 {
1166 "name": "tint/scrim",
1167 "type": "COLOR",
1168 "scopes": [
1169 "FRAME_FILL",
1170 "SHAPE_FILL"
1171 ],
1172 "web": "var(--tint-scrim)",
1173 "values": {
1174 "Dark": {
1175 "hex": "05070b",
1176 "alpha": 0.45
1177 },
1178 "Light": {
1179 "hex": "f4f7fc",
1180 "alpha": 0.45
1181 }
1182 }
1183 },
1184 {
1185 "name": "kbd/on-primary-border",
1186 "type": "COLOR",
1187 "scopes": [
1188 "STROKE_COLOR"
1189 ],
1190 "web": "var(--tint-on-primary-border)",
1191 "values": {
1192 "Dark": {
1193 "hex": "ffffff",
1194 "alpha": 0.45
1195 },
1196 "Light": {
1197 "hex": "ffffff",
1198 "alpha": 0.45
1199 }
1200 }
1201 },
1202 {
1203 "name": "whale/rise",
1204 "type": "COLOR",
1205 "scopes": [
1206 "FRAME_FILL",
1207 "SHAPE_FILL"
1208 ],
1209 "web": "whale/source/spec.json palette",
1210 "values": {
1211 "Dark": {
1212 "hex": "3594d8",
1213 "alpha": 1
1214 },
1215 "Light": {
1216 "hex": "1e8fd8",
1217 "alpha": 1
1218 }
1219 }
1220 },
1221 {
1222 "name": "whale/deep",
1223 "type": "COLOR",
1224 "scopes": [
1225 "FRAME_FILL",
1226 "SHAPE_FILL"
1227 ],
1228 "web": "whale/source/spec.json palette",
1229 "values": {
1230 "Dark": {
1231 "hex": "2b70d5",
1232 "alpha": 1
1233 },
1234 "Light": {
1235 "hex": "0b48bb",
1236 "alpha": 1
1237 }
1238 }
1239 },
1240 {
1241 "name": "whale/pouch",
1242 "type": "COLOR",
1243 "scopes": [
1244 "FRAME_FILL",
1245 "SHAPE_FILL"
1246 ],
1247 "web": "whale/source/spec.json palette",
1248 "values": {
1249 "Dark": {
1250 "hex": "dcecf8",
1251 "alpha": 1
1252 },
1253 "Light": {
1254 "hex": "dcebf7",
1255 "alpha": 1
1256 }
1257 }
1258 },
1259 {
1260 "name": "whale/eye",
1261 "type": "COLOR",
1262 "scopes": [
1263 "FRAME_FILL",
1264 "SHAPE_FILL"
1265 ],
1266 "web": "whale/source/spec.json palette",
1267 "values": {
1268 "Dark": {
1269 "hex": "0b1424",
1270 "alpha": 1
1271 },
1272 "Light": {
1273 "hex": "0b1424",
1274 "alpha": 1
1275 }
1276 }
1277 }
1278 ]
1279 },
1280 {
1281 "name": "CW 5 \u00b7 Metrics",
1282 "modes": [
1283 "Value"
1284 ],
1285 "variables": [
1286 {
1287 "name": "spacing/hairline",
1288 "type": "FLOAT",
1289 "scopes": [
1290 "GAP"
1291 ],
1292 "web": "var(--spacing-hairline)",
1293 "values": {
1294 "Value": 2
1295 }
1296 },
1297 {
1298 "name": "spacing/compact",
1299 "type": "FLOAT",
1300 "scopes": [
1301 "GAP"
1302 ],
1303 "web": "var(--spacing-compact)",
1304 "values": {
1305 "Value": 4
1306 }
1307 },
1308 {
1309 "name": "spacing/tight",
1310 "type": "FLOAT",
1311 "scopes": [
1312 "GAP"
1313 ],
1314 "web": "var(--spacing-tight)",
1315 "values": {
1316 "Value": 6
1317 }
1318 },
1319 {
1320 "name": "spacing/control",
1321 "type": "FLOAT",
1322 "scopes": [
1323 "GAP"
1324 ],
1325 "web": "var(--spacing-control)",
1326 "values": {
1327 "Value": 8
1328 }
1329 },
1330 {
1331 "name": "spacing/snug",
1332 "type": "FLOAT",
1333 "scopes": [
1334 "GAP"
1335 ],
1336 "web": "var(--spacing-snug)",
1337 "values": {
1338 "Value": 10
1339 }
1340 },
1341 {
1342 "name": "spacing/group",
1343 "type": "FLOAT",
1344 "scopes": [
1345 "GAP"
1346 ],
1347 "web": "var(--spacing-group)",
1348 "values": {
1349 "Value": 12
1350 }
1351 },
1352 {
1353 "name": "spacing/prose",
1354 "type": "FLOAT",
1355 "scopes": [
1356 "GAP"
1357 ],
1358 "web": "var(--spacing-prose)",
1359 "values": {
1360 "Value": 14
1361 }
1362 },
1363 {
1364 "name": "spacing/section",
1365 "type": "FLOAT",
1366 "scopes": [
1367 "GAP"
1368 ],
1369 "web": "var(--spacing-section)",
1370 "values": {
1371 "Value": 16
1372 }
1373 },
1374 {
1375 "name": "spacing/large",
1376 "type": "FLOAT",
1377 "scopes": [
1378 "GAP"
1379 ],
1380 "web": "var(--spacing-large)",
1381 "values": {
1382 "Value": 24
1383 }
1384 },
1385 {
1386 "name": "spacing/page",
1387 "type": "FLOAT",
1388 "scopes": [
1389 "GAP"
1390 ],
1391 "web": "var(--spacing-page)",
1392 "values": {
1393 "Value": 32
1394 }
1395 },
1396 {
1397 "name": "radius/small",
1398 "type": "FLOAT",
1399 "scopes": [
1400 "CORNER_RADIUS"
1401 ],
1402 "web": "var(--radius-small)",
1403 "values": {
1404 "Value": 6
1405 }
1406 },
1407 {
1408 "name": "radius/field",
1409 "type": "FLOAT",
1410 "scopes": [
1411 "CORNER_RADIUS"
1412 ],
1413 "web": "var(--radius-field)",
1414 "values": {
1415 "Value": 8
1416 }
1417 },
1418 {
1419 "name": "radius/control",
1420 "type": "FLOAT",
1421 "scopes": [
1422 "CORNER_RADIUS"
1423 ],
1424 "web": "var(--radius-control)",
1425 "values": {
1426 "Value": 10
1427 }
1428 },
1429 {
1430 "name": "radius/panel",
1431 "type": "FLOAT",
1432 "scopes": [
1433 "CORNER_RADIUS"
1434 ],
1435 "web": "var(--radius-panel)",
1436 "values": {
1437 "Value": 18
1438 }
1439 },
1440 {
1441 "name": "radius/sheet",
1442 "type": "FLOAT",
1443 "scopes": [
1444 "CORNER_RADIUS"
1445 ],
1446 "web": "var(--radius-sheet)",
1447 "values": {
1448 "Value": 18
1449 }
1450 },
1451 {
1452 "name": "radius/window",
1453 "type": "FLOAT",
1454 "scopes": [
1455 "CORNER_RADIUS"
1456 ],
1457 "web": "var(--radius-window)",
1458 "values": {
1459 "Value": 14
1460 }
1461 },
1462 {
1463 "name": "radius/card",
1464 "type": "FLOAT",
1465 "scopes": [
1466 "CORNER_RADIUS"
1467 ],
1468 "web": "var(--radius-card)",
1469 "values": {
1470 "Value": 14
1471 }
1472 },
1473 {
1474 "name": "radius/composer",
1475 "type": "FLOAT",
1476 "scopes": [
1477 "CORNER_RADIUS"
1478 ],
1479 "web": "var(--radius-composer)",
1480 "values": {
1481 "Value": 24
1482 }
1483 },
1484 {
1485 "name": "radius/chip",
1486 "type": "FLOAT",
1487 "scopes": [
1488 "CORNER_RADIUS"
1489 ],
1490 "web": "var(--radius-chip)",
1491 "values": {
1492 "Value": 999
1493 }
1494 },
1495 {
1496 "name": "size/control",
1497 "type": "FLOAT",
1498 "scopes": [
1499 "WIDTH_HEIGHT"
1500 ],
1501 "web": "var(--size-control)",
1502 "values": {
1503 "Value": 28
1504 }
1505 },
1506 {
1507 "name": "size/row",
1508 "type": "FLOAT",
1509 "scopes": [
1510 "WIDTH_HEIGHT"
1511 ],
1512 "web": "var(--size-row)",
1513 "values": {
1514 "Value": 30
1515 }
1516 },
1517 {
1518 "name": "size/session-row",
1519 "type": "FLOAT",
1520 "scopes": [
1521 "WIDTH_HEIGHT"
1522 ],
1523 "web": "var(--size-session-row)",
1524 "values": {
1525 "Value": 44
1526 }
1527 },
1528 {
1529 "name": "size/turn-line",
1530 "type": "FLOAT",
1531 "scopes": [
1532 "WIDTH_HEIGHT"
1533 ],
1534 "web": "var(--size-turn-line)",
1535 "values": {
1536 "Value": 28
1537 }
1538 },
1539 {
1540 "name": "size/change-bar",
1541 "type": "FLOAT",
1542 "scopes": [
1543 "WIDTH_HEIGHT"
1544 ],
1545 "web": "var(--size-change-bar)",
1546 "values": {
1547 "Value": 36
1548 }
1549 },
1550 {
1551 "name": "size/touch-target",
1552 "type": "FLOAT",
1553 "scopes": [
1554 "WIDTH_HEIGHT"
1555 ],
1556 "web": "var(--size-touch-target)",
1557 "values": {
1558 "Value": 44
1559 }
1560 },
1561 {
1562 "name": "size/icon",
1563 "type": "FLOAT",
1564 "scopes": [
1565 "WIDTH_HEIGHT"
1566 ],
1567 "web": "var(--size-icon)",
1568 "values": {
1569 "Value": 16
1570 }
1571 },
1572 {
1573 "name": "size/icon-large",
1574 "type": "FLOAT",
1575 "scopes": [
1576 "WIDTH_HEIGHT"
1577 ],
1578 "web": "var(--size-icon-large)",
1579 "values": {
1580 "Value": 20
1581 }
1582 },
1583 {
1584 "name": "size/sidebar",
1585 "type": "FLOAT",
1586 "scopes": [
1587 "WIDTH_HEIGHT"
1588 ],
1589 "web": "var(--size-sidebar)",
1590 "values": {
1591 "Value": 268
1592 }
1593 },
1594 {
1595 "name": "size/reading",
1596 "type": "FLOAT",
1597 "scopes": [
1598 "WIDTH_HEIGHT"
1599 ],
1600 "web": "var(--size-reading)",
1601 "values": {
1602 "Value": 680
1603 }
1604 },
1605 {
1606 "name": "size/composer",
1607 "type": "FLOAT",
1608 "scopes": [
1609 "WIDTH_HEIGHT"
1610 ],
1611 "web": "var(--size-composer)",
1612 "values": {
1613 "Value": 720
1614 }
1615 },
1616 {
1617 "name": "size/panel",
1618 "type": "FLOAT",
1619 "scopes": [
1620 "WIDTH_HEIGHT"
1621 ],
1622 "web": "var(--size-panel)",
1623 "values": {
1624 "Value": 320
1625 }
1626 },
1627 {
1628 "name": "size/panel-wide",
1629 "type": "FLOAT",
1630 "scopes": [
1631 "WIDTH_HEIGHT"
1632 ],
1633 "web": "var(--size-panel-wide)",
1634 "values": {
1635 "Value": 560
1636 }
1637 },
1638 {
1639 "name": "focus/width",
1640 "type": "FLOAT",
1641 "scopes": [
1642 "STROKE_FLOAT"
1643 ],
1644 "web": "var(--focus-width)",
1645 "values": {
1646 "Value": 2
1647 }
1648 },
1649 {
1650 "name": "focus/offset",
1651 "type": "FLOAT",
1652 "scopes": [
1653 "GAP"
1654 ],
1655 "web": "var(--focus-offset)",
1656 "values": {
1657 "Value": 3
1658 }
1659 }
1660 ]
1661 }
1662 ]
1663 };
1664 const DRY = typeof APPLY_FOUNDATIONS === "undefined" || APPLY_FOUNDATIONS !== true;
1665 const page = figma.root.children.find(node => node.id === '229:3');
1666 if (!page) throw Error('Inspect the existing Foundations page before synchronization');
1667 await figma.setCurrentPageAsync(page);
1668 const rgba = (v) => {
1669 const n = parseInt(v.hex, 16);
1670 return { r: ((n >> 16) & 255) / 255, g: ((n >> 8) & 255) / 255, b: (n & 255) / 255, a: v.alpha };
1671 };
1672 const same = (a, b) =>
1673 typeof a === "number" || typeof b === "number"
1674 ? a === b
1675 : !!a && !!b && ["r", "g", "b", "a"].every((k) => Math.abs((a[k] ?? 1) - (b[k] ?? 1)) < 0.002);
1676 const report = { version: PAYLOAD.version, dry: DRY, created: [], updated: [], unchanged: 0, notInTokens: [], styles: { created: [], updated: [], unchanged: 0 } };
1677 const collections = await figma.variables.getLocalVariableCollectionsAsync();
1678 const variables = await figma.variables.getLocalVariablesAsync();
1679 for (const wanted of PAYLOAD.collections) {
1680 let collection = collections.find((c) => c.name === wanted.name);
1681 if (!collection) {
1682 if (DRY) {
1683 report.created.push(...wanted.variables.map((v) => `${wanted.name}: ${v.name}`));
1684 continue;
1685 }
1686 collection = figma.variables.createVariableCollection(wanted.name);
1687 collection.renameMode(collection.modes[0].modeId, wanted.modes[0]);
1688 for (const mode of wanted.modes.slice(1)) collection.addMode(mode);
1689 }
1690 const modeId = Object.fromEntries(collection.modes.map((m) => [m.name, m.modeId]));
1691 const missingMode = wanted.modes.find((m) => !modeId[m]);
1692 if (missingMode) throw new Error(`${wanted.name} has no mode named ${missingMode}`);
1693 const existing = variables.filter((v) => v.variableCollectionId === collection.id);
1694 const names = new Set(wanted.variables.map((v) => v.name));
1695 report.notInTokens.push(...existing.filter((v) => !names.has(v.name)).map((v) => `${wanted.name}: ${v.name}`));
1696 for (const token of wanted.variables) {
1697 let variable = existing.find((v) => v.name === token.name);
1698 if (!variable) {
1699 report.created.push(`${wanted.name}: ${token.name}`);
1700 if (DRY) continue;
1701 variable = figma.variables.createVariable(token.name, collection, token.type);
1702 variable.scopes = token.scopes;
1703 variable.setVariableCodeSyntax("WEB", token.web);
1704 } else if (!DRY && (variable.codeSyntax.WEB || "") !== token.web) {
1705 variable.setVariableCodeSyntax("WEB", token.web);
1706 }
1707 let changed = false;
1708 for (const mode of wanted.modes) {
1709 const next = token.type === "COLOR" ? rgba(token.values[mode]) : token.values[mode];
1710 if (same(variable.valuesByMode[modeId[mode]], next)) continue;
1711 changed = true;
1712 if (!DRY) variable.setValueForMode(modeId[mode], next);
1713 }
1714 if (changed && !report.created.includes(`${wanted.name}: ${token.name}`)) report.updated.push(`${wanted.name}: ${token.name}`);
1715 if (!changed) report.unchanged += 1;
1716 }
1717 }
1718 const textStyles = await figma.getLocalTextStylesAsync();
1719 for (const wanted of PAYLOAD.textStyles) {
1720 const font = { family: wanted.family, style: wanted.style };
1721 let style = textStyles.find((s) => s.name === wanted.name);
1722 const matches =
1723 style &&
1724 style.fontName.family === font.family &&
1725 style.fontName.style === font.style &&
1726 style.fontSize === wanted.size &&
1727 style.lineHeight.unit === "PIXELS" &&
1728 style.lineHeight.value === wanted.line;
1729 if (matches) {
1730 report.styles.unchanged += 1;
1731 continue;
1732 }
1733 report.styles[style ? "updated" : "created"].push(wanted.name);
1734 if (DRY) continue;
1735 await figma.loadFontAsync(font);
1736 if (!style) {
1737 style = figma.createTextStyle();
1738 style.name = wanted.name;
1739 }
1740 style.fontName = font;
1741 style.fontSize = wanted.size;
1742 style.lineHeight = { unit: "PIXELS", value: wanted.line };
1743 }
1744 report.collectionIds = (await figma.variables.getLocalVariableCollectionsAsync()).map(value => value.id);
1745 report.variableIds = (await figma.variables.getLocalVariablesAsync()).map(value => value.id);
1746 report.textStyleIds = (await figma.getLocalTextStylesAsync()).map(value => value.id);
1747 report.pageId = page.id;
1748 return report;
1749
1749 lines JAVASCRIPT