Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sidebar-resizer: change $:/themes/... tiddlers #8663

Draft
wants to merge 148 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 127 commits
Commits
Show all changes
148 commits
Select commit Hold shift + click to select a range
1e0d4b8
Create sidebar-resizer.tid
BurningTreeC Oct 4, 2024
be6510b
updates
BurningTreeC Oct 4, 2024
7fbbb4e
updates
BurningTreeC Oct 4, 2024
22b33e6
updates
BurningTreeC Oct 4, 2024
035c23e
updates
BurningTreeC Oct 4, 2024
f547be6
remove some unnecessary calculations
BurningTreeC Oct 4, 2024
315e543
clean up stylesheet
BurningTreeC Oct 4, 2024
445547d
for now, in fixed-fluid mode keep story and tiddler fixed width
BurningTreeC Oct 4, 2024
bc9706d
wip: fixed-fluid mode, change storyleft. + more calculations
BurningTreeC Oct 4, 2024
02498a1
no high z-index on first eventcatcher
BurningTreeC Oct 4, 2024
dd5af9f
cleanup pointermove actions
BurningTreeC Oct 5, 2024
ea7da2b
more calculations
BurningTreeC Oct 5, 2024
6b98a2d
update base stylesheet
BurningTreeC Oct 5, 2024
01c945e
fix filters
BurningTreeC Oct 5, 2024
6fd3432
updates
BurningTreeC Oct 5, 2024
667e173
updates
BurningTreeC Oct 5, 2024
ca32bed
add fallbacks
BurningTreeC Oct 5, 2024
40a89fc
add ctrl modifier drag for fixed-fluid mode that changes behavior
BurningTreeC Oct 5, 2024
b7d542e
updates
BurningTreeC Oct 5, 2024
c31a51f
cleanup
BurningTreeC Oct 5, 2024
61cb65f
updates
BurningTreeC Oct 6, 2024
6176f3a
simplify pointermove actions and calculations
BurningTreeC Oct 6, 2024
fb47dfd
different behavior for ctrl-dragging
BurningTreeC Oct 6, 2024
3c4d7c5
fix problem with double px suffixes
BurningTreeC Oct 6, 2024
126c216
delete config tiddler
BurningTreeC Oct 6, 2024
e84dfa4
position the resizer correctly in fixed-fluid
BurningTreeC Oct 6, 2024
5d22139
make ctrl in fixed-fluid mode work like I intended
BurningTreeC Oct 6, 2024
c149989
make it work with em too
BurningTreeC Oct 6, 2024
f823a81
add themetweaks configs for sidebarminwidth and storyminwidth
BurningTreeC Oct 6, 2024
8f9cbe9
store the ctrl modifier
BurningTreeC Oct 6, 2024
807397c
add css limits in base stylesheet
BurningTreeC Oct 6, 2024
9bae7ca
add hint in ThemeTweaks for now, make shift jump out of ctrl mode
BurningTreeC Oct 6, 2024
4a746bf
set storyminwidth to 168px
BurningTreeC Oct 6, 2024
dbda2c8
cleanup
BurningTreeC Oct 6, 2024
76d8c97
cleanup
BurningTreeC Oct 6, 2024
e5a2f37
updates, fixed-fluid
BurningTreeC Oct 8, 2024
8360871
make tiddlerwidth percentages work
BurningTreeC Oct 8, 2024
da76a2f
add support for centralised for testing
BurningTreeC Oct 8, 2024
da23268
some small adjustments
BurningTreeC Oct 8, 2024
8cefe1b
update for negative tiddler width
BurningTreeC Oct 8, 2024
fd615da
small update for centralised
BurningTreeC Oct 8, 2024
25d4bd3
centralised adjustments
BurningTreeC Oct 8, 2024
03a860f
conditionally show themetweaks metrics
BurningTreeC Oct 8, 2024
910cffb
further adjustments
BurningTreeC Oct 8, 2024
a69d324
fix edgecase in centralised theme
BurningTreeC Oct 8, 2024
22a4099
add some newlines at end of file
BurningTreeC Oct 8, 2024
fbf299b
fix edgecase in centralised theme fix
BurningTreeC Oct 8, 2024
c092912
missing closing bla
BurningTreeC Oct 8, 2024
8637f16
update for clamped edgecases
BurningTreeC Oct 9, 2024
ca68786
update for clamped edgecases
BurningTreeC Oct 9, 2024
6122c5b
tiddlerwidth is not clamped
BurningTreeC Oct 9, 2024
0a3dd8b
tiddlerwidth is clamped in certain cases
BurningTreeC Oct 9, 2024
8ad8496
tiddlerwidth min-width 0px makes sense
BurningTreeC Oct 9, 2024
c2ae885
fix another edgecase
BurningTreeC Oct 9, 2024
b33be06
more clamping
BurningTreeC Oct 9, 2024
1d9a4c4
wip: make it work cross-theme (tight)
BurningTreeC Oct 10, 2024
7c2e05e
make it respect the metrics of the current theme
BurningTreeC Oct 10, 2024
7fc2239
get metrics by currently selected theme
BurningTreeC Oct 10, 2024
0b48093
add some ThemeTweak language strings
BurningTreeC Oct 10, 2024
ea1ff26
make ThemeTweaks flexible based on currently selected theme
BurningTreeC Oct 10, 2024
247f5eb
remove centralised language themetweaks
BurningTreeC Oct 10, 2024
f171a0b
fix themetweaks
BurningTreeC Oct 10, 2024
e96ff3f
correctly check if theme tiddler exists
BurningTreeC Oct 10, 2024
11cb571
fix padding in centralised theme
BurningTreeC Oct 10, 2024
23f8af3
fix resizer positioning
BurningTreeC Oct 10, 2024
db683e2
add hint for story-right-padding
BurningTreeC Oct 10, 2024
d399543
update tight theme padding
BurningTreeC Oct 10, 2024
054d630
update vanilla base
BurningTreeC Oct 10, 2024
48ed5dc
update vanilla base
BurningTreeC Oct 10, 2024
7dde829
update tight base
BurningTreeC Oct 10, 2024
a3a5d65
fix
BurningTreeC Oct 10, 2024
902a91e
add refresh throttling to config tiddlers
BurningTreeC Oct 13, 2024
4d60f91
adjustments for html dir=rtl
BurningTreeC Oct 19, 2024
b9c70fe
more adjustments for html dir=rtl
BurningTreeC Oct 19, 2024
e217b1a
add docs
BurningTreeC Oct 19, 2024
a94d496
make showing the sidebar resizer configurable and hide by default
BurningTreeC Oct 19, 2024
0bf2349
more adjustments for html dir=rtl + show sidebar on the left (configu…
BurningTreeC Oct 20, 2024
140d435
further adjustments for rtl and sidebar left
BurningTreeC Oct 20, 2024
fa42e6c
fixes for sidebar hidden
BurningTreeC Oct 20, 2024
4d86493
remove unused html-direction variable
BurningTreeC Oct 20, 2024
89623dd
small css fix for tight theme
BurningTreeC Oct 21, 2024
dd0c3f9
Merge branch 'TiddlyWiki:master' into sidebar-resizer-config
BurningTreeC Oct 21, 2024
de653df
cleanup
BurningTreeC Oct 25, 2024
0c132c9
make it more generic
BurningTreeC Oct 25, 2024
b5a5bf8
more generic adjustments
BurningTreeC Oct 25, 2024
70b759c
make it more generic
BurningTreeC Oct 25, 2024
4f9a2fa
make it more generic
BurningTreeC Oct 25, 2024
2794413
make everything even more generic
BurningTreeC Oct 26, 2024
ae28506
make everything even more generic
BurningTreeC Oct 26, 2024
743b465
make everything even more generic
BurningTreeC Oct 26, 2024
d268fd7
fix detection of dependents
BurningTreeC Oct 26, 2024
707db27
update ThemeTweaks/Hint
BurningTreeC Oct 26, 2024
3e502b7
make dependents detection more stable
BurningTreeC Oct 26, 2024
5f4484e
make dependents detection more reliable
BurningTreeC Oct 26, 2024
25013e9
update ThemeTweaks
BurningTreeC Oct 26, 2024
0c5de55
add an example theme that builds on three different themes
BurningTreeC Oct 26, 2024
3021154
updates for sidebarbreakpoint
BurningTreeC Oct 26, 2024
b888ac2
updates
BurningTreeC Oct 26, 2024
a1b356e
update menubar plugin
BurningTreeC Oct 27, 2024
9b4e961
move sidebar-resizer ui into dedicated PageTemplate
BurningTreeC Oct 27, 2024
49105f1
rename sidebar-resizer PageTemplate
BurningTreeC Oct 27, 2024
fcbdf11
pick a theme if none is set
BurningTreeC Oct 27, 2024
5727ddd
pick a theme if none is set
BurningTreeC Oct 27, 2024
1d5e76c
make use of get.current.theme
BurningTreeC Oct 27, 2024
f7d83b8
different em conversion for inside tiddlerbody and outside
BurningTreeC Oct 27, 2024
1b5889f
only use sidebarresizer if theme explicitly sets option to show
BurningTreeC Oct 27, 2024
adc3007
add optional variables for sidebar-resizer metrics definable as funct…
BurningTreeC Oct 27, 2024
dfa9a0a
revert overflow-fix on .tc-tab-content.tc-vertical - maybe a differen…
BurningTreeC Oct 27, 2024
c617e28
add dblclick below 500ms to hide sidebar
BurningTreeC Oct 27, 2024
30b4a4f
thank you pmario, cleaned up global functions
BurningTreeC Oct 27, 2024
801396b
add convert.to.pixels.locally function that uses conver.to.pixels glo…
BurningTreeC Oct 27, 2024
2e2914a
fix false use of get.theme.metric for storypaddingleft and storypaddi…
BurningTreeC Oct 27, 2024
32894e7
make two functions more readable
BurningTreeC Oct 28, 2024
d4a94d4
more refactoring for readability
BurningTreeC Oct 28, 2024
a35b9a5
use get.theme.option sidebarposition instead of vanilla option directly
BurningTreeC Oct 28, 2024
338a3d1
start making it possible to use this universally
BurningTreeC Oct 29, 2024
f63b1ed
wip make it universally usable
BurningTreeC Oct 29, 2024
e61dd82
add two-cell-slider procedure
BurningTreeC Oct 30, 2024
530500e
add one-cell-slider procedure and use it for editor and preview
BurningTreeC Oct 30, 2024
62333ce
small update, todo for all variables
BurningTreeC Oct 30, 2024
a253b6e
update sliderWidth between editor and preview
BurningTreeC Oct 30, 2024
0688142
make editor - preview slider stable
BurningTreeC Oct 30, 2024
669fd60
adjust left margin of tiddler preview
BurningTreeC Oct 30, 2024
bb673fc
make minwidths configurable
BurningTreeC Oct 30, 2024
d92e4d9
updates
BurningTreeC Oct 31, 2024
a53f839
cleanup
BurningTreeC Oct 31, 2024
ce832d8
use is tiddler
BurningTreeC Oct 31, 2024
babed80
updates
BurningTreeC Oct 31, 2024
187f34d
updates
BurningTreeC Oct 31, 2024
eb06c37
replace more not-is-missing with is-tiddler
BurningTreeC Oct 31, 2024
ce244fe
update minwidths
BurningTreeC Oct 31, 2024
324ead8
updates
BurningTreeC Nov 1, 2024
e167eef
updates
BurningTreeC Nov 1, 2024
843f043
updates
BurningTreeC Nov 1, 2024
f6a7e41
updates
BurningTreeC Nov 1, 2024
6b31a11
adjustments for html dir=rtl
BurningTreeC Nov 1, 2024
bbcfba7
updates
BurningTreeC Nov 1, 2024
d652f17
fixes
BurningTreeC Nov 1, 2024
340375d
make fluid-fixed and fixed-fluid visually the same (storyminwidth and…
BurningTreeC Nov 1, 2024
9b1d746
make fixed-fluid mode respect paddingleft and paddingright and add ad…
BurningTreeC Nov 3, 2024
6e2c39a
margin-left margin-right -2px for tc-editor-toolbar is enough
BurningTreeC Nov 3, 2024
e1d0f1b
adjustment for sidebar left and dir=rtl
BurningTreeC Nov 3, 2024
dc6031b
adjustment for sidebar left + storyleft
BurningTreeC Nov 3, 2024
3b9b535
more adjustments for html dir=rtl
BurningTreeC Nov 3, 2024
a609ffe
big WIP: keeping the values in fixed-fluid mode fixed-fluid
BurningTreeC Nov 6, 2024
3c23411
make minwidth in fluid-fixed same as in fixed-fluid
BurningTreeC Nov 6, 2024
1b6953d
update margin-right of fluid-fixed story-river
BurningTreeC Nov 6, 2024
c1e4019
test with 42px
BurningTreeC Nov 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions core/language/en-GB/Misc.multids
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ InternalJavaScriptError/Title: Internal JavaScript Error
InternalJavaScriptError/Hint: Well, this is embarrassing. It is recommended that you restart TiddlyWiki by refreshing your browser
LayoutSwitcher/Description: Open the layout switcher
LazyLoadingWarning: <p>Trying to load external content from ''<$text text={{!!_canonical_uri}}/>''</p><p>If this message doesn't disappear, either the tiddler content type doesn't match the type of the external content, or you may be using a browser that doesn't support external content for wikis loaded as standalone files. See https://tiddlywiki.com/#ExternalText</p>
Left: Left
LoginToTiddlySpace: Login to TiddlySpace
Manager/Controls/FilterByTag/None: (none)
Manager/Controls/FilterByTag/Prompt: Filter by tag:
Expand All @@ -73,6 +74,7 @@ PageTemplate/Description: the default ~TiddlyWiki layout
PageTemplate/Name: Standard Layout
PluginReloadWarning: Please save {{$:/core/ui/Buttons/save-wiki}} and reload {{$:/core/ui/Buttons/refresh}} to allow changes to ~JavaScript plugins to take effect
RecentChanges/DateFormat: DDth MMM YYYY
Right: Right
Shortcuts/Input/AdvancedSearch/Hint: Open the ~AdvancedSearch panel from within the sidebar search field
Shortcuts/Input/Accept/Hint: Accept the selected item
Shortcuts/Input/AcceptVariant/Hint: Accept the selected item (variant)
Expand Down
13 changes: 12 additions & 1 deletion core/language/en-GB/ThemeTweaks.multids
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
title: $:/language/ThemeTweaks/

ThemeTweaks: Theme Tweaks
ThemeTweaks/Hint: You can tweak certain aspects of the ''Vanilla'' theme.
ThemeTweaks/Hint: You can tweak certain aspects of the ''<$text text={{{ [<get.current.theme>get[name]] :else[[current]] }}}/>'' theme.
Options: Options
Options/SidebarLayout: Sidebar layout
Options/SidebarLayout/Fixed-Fluid: Fixed story, fluid sidebar
Options/SidebarLayout/Fluid-Fixed: Fluid story, fixed sidebar
Options/SidebarPosition: Sidebar position
Options/SidebarResizer: Sidebar resizer
Options/StickyTitles: Sticky titles
Options/StickyTitles/Hint: Causes tiddler titles to "stick" to the top of the browser window
Options/CodeWrapping: Wrap long lines in code blocks
Expand All @@ -26,8 +28,15 @@ Metrics/FontSize: Font size
Metrics/LineHeight: Line height
Metrics/BodyFontSize: Font size for tiddler body
Metrics/BodyLineHeight: Line height for tiddler body
Metrics/SidebarResizer/Hint: the values for `storyleft`, `storyright`, `storywidth`, `storyminwidth`, `sidebarwidth` and `sidebarminwidth` need to be ''absolute'' CSS units, ''percentages'' or ''em'' units in order for the sidebar resizer to work
Metrics/StoryLeft: Story left position
Metrics/StoryLeft/Hint: how far the left margin of the story river<br>(tiddler area) is from the left of the page
Metrics/StoryMinWidth: Minimum Story width
Metrics/StoryMinWidth/Hint: the minimun width of the story river
Metrics/StoryPaddingLeft: Story Padding Left
Metrics/StoryPaddingLeft/Hint: the left padding of the story river
Metrics/StoryPaddingRight: Story Padding Right
Metrics/StoryPaddingRight/Hint: the right padding of the story river, also controls the width and positioning of the resizer
Metrics/StoryTop: Story top position
Metrics/StoryTop/Hint: how far the top margin of the story river<br>is from the top of the page
Metrics/StoryRight: Story right
Expand All @@ -38,5 +47,7 @@ Metrics/TiddlerWidth: Tiddler width
Metrics/TiddlerWidth/Hint: within the story river
Metrics/SidebarBreakpoint: Sidebar breakpoint
Metrics/SidebarBreakpoint/Hint: the minimum page width at which the story<br>river and sidebar will appear side by side
Metrics/SidebarMinWidth: Minimum Sidebar width
Metrics/SidebarMinWidth/Hint: the minimum width of the sidebar
Metrics/SidebarWidth: Sidebar width
Metrics/SidebarWidth/Hint: the width of the sidebar in fluid-fixed layout
2 changes: 1 addition & 1 deletion core/ui/EditTemplate/body-editor.tid
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ title: $:/core/ui/EditTemplate/body/editor
<$edit

field="text"
class="tc-edit-texteditor tc-edit-texteditor-body"
class=<<get.tc-edit-texteditor.class>>
placeholder={{$:/language/EditTemplate/Body/Placeholder}}
tabindex={{$:/config/EditTabIndex}}
focus={{{ [{$:/config/AutoFocus}match[text]then[true]] ~[[false]] }}}
Expand Down
65 changes: 47 additions & 18 deletions core/ui/EditTemplate/body/default.tid
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
title: $:/core/ui/EditTemplate/body/default

\function edit-preview-state()
\function get.edit-preview-state()
[{$:/config/ShowEditPreview/PerTiddler}!match[yes]then[$:/state/showeditpreview]] :else[<qualified-preview-state>] +[get[text]] :else[[no]]
\end

\function get.tc-edit-texteditor.class() tc-edit-texteditor tc-edit-texteditor-body [<get.edit-preview-state>match[yes]then<identifier>addprefix[tc-edit-texteditor-identified-]] +[join[ ]]

\function get.preview.width() [<sidebarWidthTiddler>get[text]]

\function get.style.grid-template-columns()
[<get.edit-preview-state>!match[yes]then[1fr]]
:else[<sidebarWidthTiddler>!is[missing]then[calc(100% - ]addsuffix<get.preview.width>addsuffix[) ]addsuffix<get.preview.width>]
:else[[repeat(2, minmax(0px, 1fr))]]
\end

\function get.slider.condition() [<get.edit-preview-state>match[yes]] :else[[no]]

\define config-visibility-title()
$:/config/EditorToolbarButtons/Visibility/$(currentTiddler)$
\end
Expand All @@ -12,33 +24,50 @@ $:/config/EditorToolbarButtons/Visibility/$(currentTiddler)$
<$action-popup $state=<<importState>> $coords="(0,0,0,0)" $floating="yes"/>
\end

\whitespace trim
<$let
qualified-preview-state=<<qualify "$:/state/showeditpreview">>
editPreviewStateTiddler={{{ [{$:/config/ShowEditPreview/PerTiddler}!match[yes]then[$:/state/showeditpreview]] :else[<qualified-preview-state>] }}}
importTitle=<<qualify $:/ImportImage>>
importState=<<qualify $:/state/ImportImage>> >
<$dropzone importTitle=<<importTitle>> autoOpenOnImport="no" contentTypesFilter={{$:/config/Editor/ImportContentTypesFilter}} class="tc-dropzone-editor" enable={{{ [{$:/config/DragAndDrop/Enable}match[no]] :else[subfilter{$:/config/Editor/EnableImportFilter}then[yes]else[no]] }}} filesOnly="yes" actions=<<importFileActions>> >
<div>
<div class={{{ [<edit-preview-state>match[yes]then[tc-tiddler-preview]else[tc-tiddler-preview-hidden]] [[tc-tiddler-editor]] +[join[ ]] }}}>
\procedure tp-tiddler-editor-preview()
<div
class={{{ [<get.edit-preview-state>match[yes]then[tc-tiddler-preview]else[tc-tiddler-preview-hidden]] [[tc-tiddler-editor]] +[join[ ]] }}}
style.grid-template-columns=<<get.style.grid-template-columns>>>

<$transclude tiddler="$:/core/ui/EditTemplate/body/editor" mode="inline"/>
<$transclude tiddler="$:/core/ui/EditTemplate/body/editor" mode="inline"/>

<$list filter="[<editPreviewStateTiddler>get[text]match[yes]]" variable="ignore">
<$list filter="[<editPreviewStateTiddler>get[text]match[yes]]" variable="ignore">

<div class="tc-tiddler-preview-preview" data-tiddler-title={{!!draft.title}} data-tags={{!!tags}}>
<div class="tc-tiddler-preview-preview" data-tiddler-title={{!!draft.title}} data-tags={{!!tags}}>

<$transclude tiddler={{$:/state/editpreviewtype}} mode="inline">
<$transclude tiddler={{$:/state/editpreviewtype}} mode="inline">

<$transclude tiddler="$:/core/ui/EditTemplate/body/preview/output" mode="inline"/>
<$transclude tiddler="$:/core/ui/EditTemplate/body/preview/output" mode="inline"/>

</$transclude>
</$transclude>

</div>
</div>

</$list>
</$list>

</div>
\end

\whitespace trim
<$let
qualified-preview-state=<<qualify "$:/state/showeditpreview">>
editPreviewStateTiddler={{{ [{$:/config/ShowEditPreview/PerTiddler}!match[yes]then[$:/state/showeditpreview]] :else[<qualified-preview-state>] }}}
importTitle=<<qualify $:/ImportImage>>
importState=<<qualify $:/state/ImportImage>>
identifier={{{ [<qualify>addsuffix[-]addsuffix<currentTiddler>sha256[]] }}}
sidebarWidthTiddler={{{ [<identifier>addprefix[$:/state/resizer/previewwidth-]] }}} >
<$dropzone importTitle=<<importTitle>> autoOpenOnImport="no" contentTypesFilter={{$:/config/Editor/ImportContentTypesFilter}} class="tc-dropzone-editor" enable={{{ [{$:/config/DragAndDrop/Enable}match[no]] :else[subfilter{$:/config/Editor/EnableImportFilter}then[yes]else[no]] }}} filesOnly="yes" actions=<<importFileActions>> >
<div>

<$transclude
$variable="editor-preview-slider"
class="tc-edit-texteditor-slider"
template="tp-tiddler-editor-preview"
sliderCondition=<<get.slider.condition>>
mode="inline"
padding="0px"
sliderWidth="6px"
/>

</div>

Expand Down
34 changes: 34 additions & 0 deletions core/ui/PageTemplate/sidebar-resizer.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
title: $:/core/ui/PageTemplate/sidebar-resizer
tags: $:/tags/PageTemplate
list-after: $:/core/ui/PageTemplate/story

\import [function[get.base.functions.theme],<get.current.theme>first[]!is[missing]] :else[function[get.base.functions.theme],<get.current.theme>first[]is[shadow]] :else[[$:/themes/tiddlywiki/vanilla/functions]] [[$:/core/procedures/sidebar-resizer]]
\function resizer.state.tiddler() $:/state/sidebar/resizing
\function resizer.state() [{$:/state/sidebar}]
\function resizer.class() tc-main-sidebar-resizer
\function set.throttling() yes
\whitespace trim

<%if [<get.theme.explicit.option sidebarresizer>match[show]] %>

<$let
tv-set-storywidth-storyright=<<set.storywidth.storyright>>
tv-set-sidebarwidth=<<set.sidebarwidth>>
tv-set-centralised=<<set.centralised>>

storyLeftTiddler=<<get.story-left.tiddler>>
storyRightTiddler=<<get.story-right.tiddler>>
sidebarWidthTiddler=<<get.sidebar-width.tiddler>>
tiddlerWidthTiddler=<<get.tiddler-width.tiddler>>
storyWidthTiddler=<<get.story-width.tiddler>>
storyMinWidthTiddler=<<get.story-minwidth.tiddler>>
sidebarMinWidthTiddler=<<get.sidebar-minwidth.tiddler>>
storyPaddingLeftTiddler=<<get.story-padding-left.tiddler>>
storyPaddingRightTiddler=<<get.story-padding-right.tiddler>>
>

<$transclude $variable="sidebar-resizer"/>

</$let>

<% endif %>
4 changes: 4 additions & 0 deletions core/ui/PageTemplateClassFilters.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
title: $:/core/ui/PageTemplateClassFilters
tags: $:/tags/ClassFilters/PageTemplate

[<get.theme.option sidebarposition>match[left]then[tc-sidebar-left]]
109 changes: 109 additions & 0 deletions core/wiki/functions/themes.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
title: $:/core/functions/themes
tags: $:/tags/Global
code-body: yes

\function is.pixel.value(value) [<value>removesuffix[px]]
\function is.percentage.value(value) [<value>removesuffix[%]]
\function is.cm.value(value) [<value>removesuffix[cm]]
\function is.mm.value(value) [<value>removesuffix[mm]]
\function is.Q.value(value) [<value>removesuffix[Q]]
\function is.in.value(value) [<value>removesuffix[in]]
\function is.pc.value(value) [<value>removesuffix[pc]]
\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) [[storyTiddler]is[variable]then<value>divide{$:/themes/tiddlywiki/vanilla/metrics/bodyfontsize}] [[storyTiddler]!is[variable]then<value>divide{$:/themes/tiddlywiki/vanilla/metrics/fontsize}]

\function convert.to.pixels(value)
[is.pixel.value<value>]
:else[is.cm.value<value>multiply[37.8]]
:else[is.mm.value<value>multiply[37.8]divide[10]]
:else[is.Q.value<value>multiply[37.8]divide[40]]
:else[is.in.value<value>multiply[96]]
:else[is.pc.value<value>multiply[96]divide[6]]
:else[is.pt.value<value>multiply[96]divide[72]]
:else[is.em.value<value>then[storyTiddler]is[variable]then<value>multiply{$:/themes/tiddlywiki/vanilla/metrics/bodyfontsize}]
:else[is.em.value<value>then[storyTiddler]!is[variable]then<value>multiply{$:/themes/tiddlywiki/vanilla/metrics/fontsize}]
\end

\function convert.to.pixels.metric(value,metric) [<value>addsuffix<metric>] :map[convert.to.pixels<currentTiddler>]

\function subtract.one.from.sidebarbreakpoint(value)
[is.pixel.value<value>subtract[1]addsuffix[px]]
:else[is.cm.value<value>convert.to.pixels.metric<value>,[cm]subtract[1]divide[37.8]addsuffix[cm]]
:else[is.mm.value<value>convert.to.pixels.metric<value>,[mm]subtract[1]divide[37.8]multiply[10]addsuffix[mm]]
:else[is.Q.value<value>convert.to.pixels.metric<value>,[Q]subtract[1]divide[37.8]multiply[40]addsuffix[Q]]
:else[is.in.value<value>convert.to.pixels.metric<value>,[in]subtract[1]divide[96]addsuffix[in]]
:else[is.pc.value<value>convert.to.pixels.metric<value>,[pc]subtract[1]divide[96]multiply[6]addsuffix[pc]]
:else[is.pt.value<value>convert.to.pixels.metric<value>,[pt]subtract[1]divide[96]multiply[72]addsuffix[pt]]
:else[is.em.value<value>convert.to.pixels.metric<value>,[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<sidebarbreakpoint>] :else[<sidebarbreakpoint>]

\function add.one.to.breakpoint(value)
[is.pixel.value<value>add[1]addsuffix[px]]
:else[is.cm.value<value>convert.to.pixels.metric<value>,[cm]add[1]divide[37.8]addsuffix[cm]]
:else[is.mm.value<value>convert.to.pixels.metric<value>,[mm]add[1]divide[37.8]multiply[10]addsuffix[mm]]
:else[is.Q.value<value>convert.to.pixels.metric<value>,[Q]add[1]divide[37.8]multiply[40]addsuffix[Q]]
:else[is.in.value<value>convert.to.pixels.metric<value>,[in]add[1]divide[96]addsuffix[in]]
:else[is.pc.value<value>convert.to.pixels.metric<value>,[pc]add[1]divide[96]multiply[6]addsuffix[pc]]
:else[is.pt.value<value>convert.to.pixels.metric<value>,[pt]add[1]divide[96]multiply[72]addsuffix[pt]]
:else[is.em.value<value>convert.to.pixels.metric<value>,[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) [<theme>get[dependents]enlist-input[]] :map[get.base.theme.metric<currentTiddler>,<metric>]

\function get.base.theme.metric(theme,metric)
[<theme>addsuffix[/metrics/]addsuffix<metric>!is[missing]]
:else[<theme>addsuffix[/metrics/]addsuffix<metric>is[shadow]]
:else[get.base.theme.metric.recursive<theme>,<metric>]
\end

\function get.base.theme(theme,metric) [get.base.theme.metric<theme>,<metric>first[]removesuffix<metric>removesuffix[/metrics/]]

\function get.theme.metric(metric) [get.base.theme.metric<get.current.theme>,<metric>first[]get[text]]

\function get.base.theme.option.recursive(theme,option) [<theme>get[dependents]enlist-input[]] :map[get.base.theme.option<currentTiddler>,<option>]

\function get.base.theme.option(theme,option)
[<theme>addsuffix[/options/]addsuffix<option>!is[missing]]
:else[<theme>addsuffix[/options/]addsuffix<option>is[shadow]]
:else[get.base.theme.option.recursive<theme>,<option>]
\end

\function get.theme.option(option) [get.base.theme.option<get.current.theme>,<option>first[]get[text]]

\function get.theme.explicit.option(option) [<get.current.theme>addsuffix[/options/]addsuffix<option>get[text]]

\function get.theme(metric)
[get.base.theme<get.current.theme>,<metric>addsuffix[/metrics/]addsuffix<metric>!is[missing]]
:else[get.base.theme<get.current.theme>,<metric>addsuffix[/metrics/]addsuffix<metric>is[shadow]]
:else[[$:/themes/tiddlywiki/vanilla/metrics/]addsuffix<metric>]
\end

\function set.theme.metric(metric)
[get.base.theme.metric<get.current.theme>,<metric>first[]is[shadow]]
:else[get.base.theme.metric<get.current.theme>,<metric>first[]!is[shadow]!is[missing]]
:else[[$:/themes/tiddlywiki/vanilla/metrics/]addsuffix<metric>]
\end

\function get.base.functions.theme.recursive(theme) [<theme>get[dependents]enlist-input[]] :map[get.base.functions.theme<currentTiddler>]

\function get.base.functions.theme(theme)
[<theme>addsufix[/functions]!is[missing]]
:else[<theme>addsuffix[/functions]is[shadow]]
:else[get.base.functions.theme.recursive<theme>]
\end

\function get.current.theme() [{$:/theme}!is[blank]] :else[all[tiddlers+shadows]plugin-type[theme]plugin-priority[0]first[]]
Loading
Loading