1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-08-10 15:53:58 +00:00
This commit is contained in:
BurningTreeC 2024-10-26 20:06:14 +02:00
parent 3021154bc3
commit b888ac2100
6 changed files with 23 additions and 10 deletions

View File

@ -11,6 +11,14 @@ tags: $:/tags/Global
\function is.pt.value(value) [<value>removesuffix[pt]]
\function is.em.value(value) [<value>removesuffix[em]]
\function convert.to.cm(value) [<value>divide[37.8]]
\function convert.to.mm(value) [convert.to.cm<value>multiply[10]]
\function convert.to.Q(value) [convert.to.cm<value>multiply[40]]
\function convert.to.in(value) [<value>divide[96]]
\function convert.to.pc(value) [convert.to.in<value>multiply[6]]
\function convert.to.pt(value) [convert.to.in<value>multiply[72]]
\function convert.to.em(value) [<value>divide{$:/themes/tiddlywiki/vanilla/metrics/fontsize}]
\function convert.to.pixels(value,metric) [<metric>match[cm]then<value>multiply[37.8]] [<metric>match[mm]then<value>multiply[37.8]divide[10]] [<metric>match[Q]then<value>multiply[37.8]divide[40]] [<metric>match[in]then<value>multiply[96]] [<metric>match[pc]then<value>multiply[96]divide[6]] [<metric>match[pt]then<value>multiply[96]divide[72]] [<metric>match[em]then<value>multiply{$:/themes/tiddlywiki/vanilla/metrics/fontsize}]
\function subtract.one.from.sidebarbreakpoint(value) [is.pixel.value<value>subtract[1]addsuffix[px]] :else[is.cm.value<value>function[convert.to.pixels],<value>,[cm]subtract[1]divide[37.8]addsuffix[cm]] :else[is.mm.value<value>function[convert.to.pixels],<value>,[mm]subtract[1]divide[37.8]multiply[10]addsuffix[mm]] :else[is.Q.value<value>function[convert.to.pixels],<value>,[Q]subtract[1]divide[37.8]multiply[40]addsuffix[Q]] :else[is.in.value<value>function[convert.to.pixels],<value>,[in]subtract[1]divide[96]addsuffix[in]] :else[is.pc.value<value>function[convert.to.pixels],<value>,[pc]subtract[1]divide[96]multiply[6]addsuffix[pc]] :else[is.pt.value<value>function[convert.to.pixels],<value>,[pt]subtract[1]divide[96]multiply[72]addsuffix[pt]] :else[is.em.value<value>function[convert.to.pixels],<value>,[em]subtract[1]divide{$:/themes/tiddlywiki/vanilla/metrics/fontsize}addsuffix[em]]

View File

@ -1,13 +1,6 @@
title: $:/core/macros/sidebar-resizer
\function convert.to.percentage(value) [<value>divide<widgetNodeWidth>multiply[100]]
\function convert.to.cm(value) [<value>divide[37.8]]
\function convert.to.mm(value) [convert.to.cm<value>multiply[10]]
\function convert.to.Q(value) [convert.to.cm<value>multiply[40]]
\function convert.to.in(value) [<value>divide[96]]
\function convert.to.pc(value) [convert.to.in<value>multiply[6]]
\function convert.to.pt(value) [convert.to.in<value>multiply[72]]
\function convert.to.em(value) [<value>divide{$:/themes/tiddlywiki/vanilla/metrics/fontsize}]
\function convert.to.percentage.value() [convert.to.percentage<value>]
\function convert.to.cm.value() [convert.to.cm<value>]

View File

@ -27,7 +27,7 @@ tags: [[$:/tags/Stylesheet]]
text-align: left;
left: 50%;
right: 0;
margin-left: min(calc((100% - (2 * <<get.theme.metric sidebarminwidth>>)) / 2 - 42px),calc(<<get.theme.metric storywidth>> / 2 - 42px));
margin-left: min(calc((100% - (2 * <<get.theme.metric sidebarminwidth>>)) / 2 - <<get.theme.metric storypaddingright>>),calc(<<get.theme.metric storywidth>> / 2 - <<get.theme.metric storypaddingright>>));
width: auto;
}
@ -35,7 +35,7 @@ tags: [[$:/tags/Stylesheet]]
margin-left: 0;
right: 50%;
left: 0;
margin-right: min(calc((100% - (2 * <<get.theme.metric sidebarminwidth>>)) / 2 - 42px),calc(<<get.theme.metric storywidth>> / 2 - 42px));
margin-right: min(calc((100% - (2 * <<get.theme.metric sidebarminwidth>>)) / 2 - <<get.theme.metric storypaddingleft>>),calc(<<get.theme.metric storywidth>> / 2 - <<get.theme.metric storypaddingleft>>));
padding-right: 0px;
padding-left: 42px;
}

View File

@ -0,0 +1,8 @@
title: $:/themes/tiddlywiki/example/functions
\function set.centralised() yes
\function set.storywidth.storyright() no
\function set.sidebarwidth() no
\function sidebar.resizer.maxwidth() 12px
\function sidebar.resizer.width() [<sidebar.resizer.maxwidth>]

View File

@ -0,0 +1,4 @@
title: $:/themes/tiddlywiki/example/metrics/
storypaddingleft: 0px
storypaddingright: 0px

View File

@ -5,5 +5,5 @@
"core-version": ">=5.0.0",
"plugin-type": "theme",
"description": "Builds on top of various other themes",
"dependents": ["$:/themes/tiddlywiki/tight","$:/themes/tiddlywiki/seamless","$:/themes/tiddlywiki/snowwhite"]
"dependents": ["$:/themes/tiddlywiki/centralised","$:/themes/tiddlywiki/tight","$:/themes/tiddlywiki/seamless","$:/themes/tiddlywiki/snowwhite"]
}