MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / buildTheme

Function buildTheme

tools/xsbug/assets.js:192–353  ·  view source on GitHub ↗
($, codeFont)

Source from the content-addressed store, hash-verified

190};
191
192function buildTheme($, codeFont) {
193 const colors = globalThis.colors = {};
194 const skins = globalThis.skins = {};
195 const styles = globalThis.styles = {};
196
197 skins.button = new Skin({ fill:$.button.fill, stroke:$.button.stroke });
198 styles.button = new Style({ font:"semibold", color:$.button.color });
199 styles.serialButton = new Style({ font:"semibold", color:$.button.color , left:15, right:15 });
200 skins.iconButton = new Skin({ fill:$.iconButton.fill });
201 styles.iconButton = new Style({ font:"semibold", color:$.iconButton.color });
202 skins.icons = new Skin({ texture:textures.icons, color:$.iconButton.color, x:2, y:2, width:26, height:26, variants:30 });
203 skins.divider = new Skin({ fill:$.divider.fill });
204 skins.fieldScroller = new Skin({ fill: $.field.fill, stroke:$.field.stroke, borders: { left:1, right:1, bottom:1, top:1 } });
205 skins.field = new Skin({ fill: [$.field.fill, $.fieldSelection.fill], });
206 styles.field = new Style({ color:[$.field.color, $.fieldSelection.color], horizontal:"left", left:5, right:5 });
207 skins.popupButton = new Skin({ fill:$.button.fill, stroke:$.button.stroke });
208 styles.popupButton = new Style({ font:"semibold", color:$.button.color, horizontal:"left" }),
209 skins.popupIcons = new Skin({ texture:textures.popup, color:$.popupMenuItem.color, x:0, y:0, width:20, height:30, variants:20 });
210 skins.popupMenu = new Skin({ fill:$.popupMenu.fill, stroke:$.popupMenu.stroke, left:1, right:1, top:1, bottom:1 });
211 skins.popupMenuItem = new Skin({ fill:$.popupMenuItem.fill });
212 styles.popupMenuItem = new Style({ font: "semibold", color:$.popupMenuItem.color, horizontal:"left" });
213 skins.popupMenuShadow = new Skin({ texture:textures.shadow, x:0, y:0, width:60, height:40, left:20, right:20, top:10, bottom:20 });
214 skins.scrollbarThumb = new Skin({ fill:$.scrollbarThumb.fill });
215 skins.horizontalScrollbar = new Skin({ fill:$.scrollbar.fill, stroke:$.scrollbar.stroke, top:1 });
216 skins.verticalScrollbar = new Skin({ fill:$.scrollbar.fill, stroke:$.scrollbar.stroke, left:1 });
217 skins.sliderBar = new Skin({ fill:$.sliderBar.fill, stroke:$.sliderBar.stroke });
218 skins.sliderButton = new Skin({ fill:$.sliderButton.fill, stroke:$.sliderButton.stroke });
219 skins.switchBar = new Skin({ fill:$.switchBar.fill, stroke:$.switchBar.stroke });
220 skins.switchButton = new Skin({ fill:$.switchButton.fill, stroke:$.switchButton.stroke });
221
222 // TABS
223 skins.tabsPane = new Skin({ fill:$.tab.fill[1], stroke:$.divider.fill, borders: { bottom:1 } });
224 skins.tab = new Skin({ fill:$.tab.fill, stroke:$.tab.stroke, borders: { right:1 } });
225 styles.tab = new Style({ font:"semibold 12px Open Sans", color:$.tab.color, horizontal:"center", left:26, right:26 });
226 styles.tabTest262 = new Style({ font:"semibold 12px Open Sans", color:$.tab.color, horizontal:"center", left:13, right:13 });
227 styles.tabBreakpoint = new Style({ font:"bold 10px", horizontal:"right", right:15, color:$.tabBubble.color });
228 skins.tabBubble = new Skin({ texture:textures.glyphs, color:$.tabBubble.fill, x:0, y:48, width:48, height:16 });
229 styles.tabBubble = new Style({ font:"bold 10px", horizontal:"right", right:10, color:$.tabBreakpoint.color });
230
231 // CODE, CONSOLE, PREFERENCES
232 skins.paneBorder = new Skin({ fill:$.tableHeader.stroke });
233 skins.paneHeader = new Skin({ fill:$.tableHeader.fill });
234 styles.paneHeader = new Style({ font:"semibold", color:$.tableHeader.color, horizontal:"left" });
235
236 // CODE
237 styles.pathName = new Style({ font:"semibold", color:$.pathName.color, horizontal:"left" });
238 styles.pathSpan = new Style({ font:"semibold 12px Open Sans", color:$.pathSpan.color, horizontal:"left" });
239
240 skins.lineNumber = new Skin({ fill:$.lineNumber.fill, stroke:$.lineNumber.stroke, borders: { right:1 } });
241 styles.lineNumber = new Style({ font:"bold 10px", horizontal:"right", right:15, color: [ $.lineNumber.color,$.lineBreakpoint.color ] });
242
243 skins.lineBreakpoint = new Skin({ texture:textures.glyphs, color:["transparent", $.lineBreakpoint.fill], x:16, y:32, width:42, height:16, variants:42 });
244 skins.lineCall = new Skin({ texture:textures.glyphs, color:["transparent", $.callRow.fill], x:0, y:32, width:16, height:16 });
245
246 skins.background = new Skin({ fill:$.code.fill });
247 skins.code = new Skin({ fill:[$.codeResult.fill, "transparent", $.codeSelection.fill, $.codeSelection.fill] });
248 styles.code = new Style({ font:codeFont, horizontal:"left", left:8, right:8, color:[$.code.color, $.codeKeyword.color, $.codeLiteral.color, $.codeComment.color] });
249

Callers 1

buildAssetsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected