mirror of
https://github.com/webstudio-is/webstudio.git
synced 2026-11-07 12:33:36 +09:00
Ref https://github.com/webstudio-is/webstudio-designer/issues/807 We are gonna consolidate design token styles and local styles. On build (project) level there will be list of styles and list of style sources which are basically a group of styles to be referenced. These style sources can be local with mandatory tree id or token with optional tree id to scope a token on specific page instead of whole project. Tree will get new list of references to style sources. Here resulting types ```ts // Stored as Build.styles type StylesItem = { // same as before but instead of instanceId style is referenced through style source styleSourceId: string, breakpointId, property, value } type StyleSourcesToken = { type: token id: string treeId?: string name: string } type StyleSourcesLocal = { type: local id: string treeId: string name: string } // Stored as Build.styleSources type StyleSourcesItem = StyleSourcesToken | StyleSourcesLocal // Stored as Tree.styleRefs type StyleRefsItem = { instanceId: string, values: StyleSourcesItem['id'] } ```