title: $:/core/functions/themes tags: $:/tags/Global code-body: yes \function is.pixel.value(value) [removesuffix[px]] \function is.percentage.value(value) [removesuffix[%]] \function is.cm.value(value) [removesuffix[cm]] \function is.mm.value(value) [removesuffix[mm]] \function is.Q.value(value) [removesuffix[Q]] \function is.in.value(value) [removesuffix[in]] \function is.pc.value(value) [removesuffix[pc]] \function is.pt.value(value) [removesuffix[pt]] \function is.em.value(value) [removesuffix[em]] \function convert.to.cm(value) [divide[37.8]] \function convert.to.mm(value) [convert.to.cmmultiply[10]] \function convert.to.Q(value) [convert.to.cmmultiply[40]] \function convert.to.in(value) [divide[96]] \function convert.to.pc(value) [convert.to.inmultiply[6]] \function convert.to.pt(value) [convert.to.inmultiply[72]] \function convert.to.em(value) [[storyTiddler]is[variable]thendivide{$:/themes/tiddlywiki/vanilla/metrics/bodyfontsize}] [[storyTiddler]!is[variable]thendivide{$:/themes/tiddlywiki/vanilla/metrics/fontsize}] \function convert.to.pixels(value) [is.pixel.value] :else[is.cm.valuemultiply[37.8]] :else[is.mm.valuemultiply[37.8]divide[10]] :else[is.Q.valuemultiply[37.8]divide[40]] :else[is.in.valuemultiply[96]] :else[is.pc.valuemultiply[96]divide[6]] :else[is.pt.valuemultiply[96]divide[72]] :else[is.em.valuethen[storyTiddler]is[variable]thenmultiply{$:/themes/tiddlywiki/vanilla/metrics/bodyfontsize}] :else[is.em.valuethen[storyTiddler]!is[variable]thenmultiply{$:/themes/tiddlywiki/vanilla/metrics/fontsize}] \end \function convert.to.pixels.metric(value,metric) [addsuffix] :map[convert.to.pixels] \function subtract.one.from.sidebarbreakpoint(value) [is.pixel.valuesubtract[1]addsuffix[px]] :else[is.cm.valueconvert.to.pixels.metric,[cm]subtract[1]divide[37.8]addsuffix[cm]] :else[is.mm.valueconvert.to.pixels.metric,[mm]subtract[1]divide[37.8]multiply[10]addsuffix[mm]] :else[is.Q.valueconvert.to.pixels.metric,[Q]subtract[1]divide[37.8]multiply[40]addsuffix[Q]] :else[is.in.valueconvert.to.pixels.metric,[in]subtract[1]divide[96]addsuffix[in]] :else[is.pc.valueconvert.to.pixels.metric,[pc]subtract[1]divide[96]multiply[6]addsuffix[pc]] :else[is.pt.valueconvert.to.pixels.metric,[pt]subtract[1]divide[96]multiply[72]addsuffix[pt]] :else[is.em.valueconvert.to.pixels.metric,[em]subtract[1]divide{$:/themes/tiddlywiki/vanilla/metrics/fontsize}addsuffix[em]] \end \function sidebarbreakpoint() [{$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint}] \function sidebarbreakpoint-minus-one() [subtract.one.from.sidebarbreakpoint] :else[] \function add.one.to.breakpoint(value) [is.pixel.valueadd[1]addsuffix[px]] :else[is.cm.valueconvert.to.pixels.metric,[cm]add[1]divide[37.8]addsuffix[cm]] :else[is.mm.valueconvert.to.pixels.metric,[mm]add[1]divide[37.8]multiply[10]addsuffix[mm]] :else[is.Q.valueconvert.to.pixels.metric,[Q]add[1]divide[37.8]multiply[40]addsuffix[Q]] :else[is.in.valueconvert.to.pixels.metric,[in]add[1]divide[96]addsuffix[in]] :else[is.pc.valueconvert.to.pixels.metric,[pc]add[1]divide[96]multiply[6]addsuffix[pc]] :else[is.pt.valueconvert.to.pixels.metric,[pt]add[1]divide[96]multiply[72]addsuffix[pt]] :else[is.em.valueconvert.to.pixels.metric,[em]add[1]divide{$:/themes/tiddlywiki/vanilla/metrics/fontsize}addsuffix[em]] \end \function breakpoint-plus-one() [add.one.to.breakpoint{$:/config/plugins/menubar/breakpoint}] :else[{$:/config/plugins/menubar/breakpoint}] \function get.base.theme.metric.recursive(theme,metric) [get[dependents]enlist-input[]] :map[get.base.theme.metric,] \function get.base.theme.metric(theme,metric) [addsuffix[/metrics/]addsuffixis[tiddler]] :else[addsuffix[/metrics/]addsuffixis[shadow]] :else[get.base.theme.metric.recursive,] \end \function get.base.theme(theme,metric) [get.base.theme.metric,first[]removesuffixremovesuffix[/metrics/]] \function get.theme.metric(metric) [get.base.theme.metric,first[]get[text]] \function get.base.theme.option.recursive(theme,option) [get[dependents]enlist-input[]] :map[get.base.theme.option,