diff --git a/core/ui/PageTemplate/sidebar-resizer.tid b/core/ui/PageTemplate/sidebar-resizer.tid deleted file mode 100644 index 79c99078e..000000000 --- a/core/ui/PageTemplate/sidebar-resizer.tid +++ /dev/null @@ -1,53 +0,0 @@ -title: $:/core/ui/PageTemplate/sidebar-resizer -tags: $:/tags/PageTemplate -list-after: $:/core/ui/PageTemplate/story - -\import $:/core/macros/sidebar-resizer -\whitespace trim - -<%if [{$:/themes/tiddlywiki/vanilla/options/sidebarresizer}match[show]] %> - - <$eventcatcher - tag="div" - class="tc-sidebar-resizer-pointerdown-eventcatcher" - selector=".tc-sidebar-resizer" - matchSelector=".tc-sidebar-resizer" - $pointerdown=<> - $pointerup=<>> - - <%if [{$:/state/sidebar}!match[no]] %> - - <$eventcatcher - tag="div" - class="tc-sidebar-resizer-pointermove-eventcatcher-wrapper" - selector=".tc-sidebar-resizer" - matchSelector=".tc-sidebar-resizer" - $pointerup={{{ [[$:/state/sidebar/resizing]!is[missing]then] }}}> - - <$eventcatcher - tag="div" - selector=".tc-sidebar-resizer-pointermove" - matchSelector=".tc-sidebar-resizer-pointermove" - class="tc-sidebar-resizer-pointermove-eventcatcher" - $pointerup=<> - $pointerleave=<> - $pointerout=<> - $pointercancel=<> - $pointerdown=<> - $touchstart=<> - $pointermove=<> - $contextmenu=<>> - -
- - - -
- - - - <% endif %> - - - -<% endif %> diff --git a/core/wiki/macros/sidebar-resizer.tid b/core/wiki/macros/sidebar-resizer.tid index 7b0bd918a..cfe387fb7 100644 --- a/core/wiki/macros/sidebar-resizer.tid +++ b/core/wiki/macros/sidebar-resizer.tid @@ -51,11 +51,11 @@ title: $:/core/macros/sidebar-resizer \procedure sidebar-resizer-pointerdown-actions() <%if [[$:/state/sidebar/resizing]is[missing]thenmatch[left]] %> <$let - startStoryLeft={{{ [get.theme.metric[metrics/storyleft]] }}} - startStoryRight={{{ [get.theme.metric[metrics/storyright]] }}} - startSidebarWidth={{{ [get.theme.metric[metrics/sidebarwidth]] }}} - startTiddlerWidth={{{ [get.theme.metric[metrics/tiddlerwidth]] }}} - startStoryWidth={{{ [get.theme.metric[metrics/storywidth]] }}}> + startStoryLeft={{{ [!is[blank]get[text]] :else[get.theme.metric[metrics/storyleft]] }}} + startStoryRight={{{ [!is[blank]get[text]] :else[get.theme.metric[metrics/storyright]] }}} + startSidebarWidth={{{ [!is[blank]get[text]] :else[get.theme.metric[metrics/sidebarwidth]] }}} + startTiddlerWidth={{{ [!is[blank]get[text]] :else[get.theme.metric[metrics/tiddlerwidth]] }}} + startStoryWidth={{{ [!is[blank]get[text]] :else[get.theme.metric[metrics/storywidth]] }}}> <$action-setfield $tiddler="$:/state/sidebar/resizing" text="yes" widget-node-width=<> @@ -83,13 +83,16 @@ title: $:/core/macros/sidebar-resizer <$let storyRightStart={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-story-right}] }}} storyWidthStart={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-story-width}] }}} - storyMinWidth={{{ [convert.to.pixels] }}} - sidebarMinWidth={{{ [convert.to.pixels] }}} - storyPaddingLeft={{{ [get.theme.metric[metrics/storypaddingleft]] }}} - storyPaddingLeft={{{ [convert.to.pixels] }}} - storyPaddingRight={{{ [get.theme.metric[metrics/storypaddingright]] }}} - storyPaddingRight={{{ [convert.to.pixels] }}} - storyLeft={{{ [convert.to.pixels] }}} + storyMinWidthValue={{{ [!is[blank]get[text]] :else[] }}} + storyMinWidth={{{ [convert.to.pixels] }}} + sidebarMinWidthValue={{{ [!is[blank]get[text]] :else[] }}} + sidebarMinWidth={{{ [convert.to.pixels] }}} + storyPaddingLeftValue={{{ [!is[blank]get[text]] :else[get.theme.metric[metrics/storypaddingleft]] }}} + storyPaddingLeft={{{ [convert.to.pixels] }}} + storyPaddingRightValue={{{ [!is[blank]get[text]] :else[get.theme.metric[metrics/storypaddingright]] }}} + storyPaddingRight={{{ [convert.to.pixels] }}} + storyLeftValue={{{ [!is[blank]get[text]] :else[] }}} + storyLeft={{{ [convert.to.pixels] }}} clampedDiff={{{ [addaddsubtractcompare:number:gt[0]] ~0 }}} storyWidthStart={{{ [subtract] }}} storyRightStart={{{ [subtract] }}} @@ -120,7 +123,7 @@ title: $:/core/macros/sidebar-resizer storyWidthResult={{{ [compare:number:ltthenaddsuffix] :else[compare:number:gteqthenaddsuffix] :else[addsuffix] }}} - tiddlerWidthResult={{{ [match[%]thencompare:number:ltthencompare:number:gteq[0]then] :else[match[%]thencompare:number:gtthen] :else[!match[%]thencompare:number:ltthenaddsuffix] :else[!match[%]thencompare:number:gteqthenaddsuffix] :else[compare:number:lt[0]then[0]addsuffix] :else[addsuffix] }}}> + tiddlerWidthResult={{{ [match[%]thencompare:number:ltthencompare:number:gteq[0]then] :else[match[%]thencompare:number:gtthen] :else[!match[%]thencompare:number:ltthenaddsuffix] :else[!match[%]thencompare:number:gteqthenaddsuffix] :else[compare:number:lt[0]then[0]addsuffix] :else[addsuffix] }}}> <$action-setfield $tiddler=<> text=<>/> <$action-setfield $tiddler=<> text=<>/> @@ -144,10 +147,13 @@ title: $:/core/macros/sidebar-resizer \procedure set-sidebarwidth-actions() <$let + sidebarMinWidthValue={{{ [!is[blank]get[text]] :else[] }}} sidebarWidthMetric={{$:/state/sidebar/resizing!!sidebar-width-metric}} - sidebarMinWidth={{{ [convert.to.pixels] }}} - storyLeft={{{ [convert.to.pixels] }}} - storyMinWidth={{{ [convert.to.pixels] }}} + sidebarMinWidth={{{ [convert.to.pixels] }}} + storyLeftValue={{{ [!is[blank]get[text]] :else[] }}} + storyLeft={{{ [convert.to.pixels] }}} + storyMinWidthValue={{{ [!is[blank]get[text]] :else[] }}} + storyMinWidth={{{ [convert.to.pixels] }}} sidebarMaxWidth={{{ [subtractsubtract] }}} clampedDiff={{{ [addaddsubtractcompare:number:gt[0]] ~0 }}} sidebarWidth={{{ [subtract] }}}> @@ -164,9 +170,11 @@ title: $:/core/macros/sidebar-resizer \procedure set-centralised-actions() <$let - storyMinWidth={{{ [convert.to.pixels{$:/themes/tiddlywiki/centralised/metrics/storyminwidth}] }}} + storyMinWidthValue={{{ [!is[blank]get[text]] :else[{$:/themes/tiddlywiki/centralised/metrics/storyminwidth}] }}} + storyMinWidth={{{ [convert.to.pixels] }}} storyWidthStart={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-story-width}] }}} - sidebarMinWidth={{{ [convert.to.pixels{$:/themes/tiddlywiki/centralised/metrics/sidebarminwidth}] }}} + sidebarMinWidthValue={{{ [!is[blank]get[text]] :else[{$:/themes/tiddlywiki/centralised/metrics/sidebarminwidth}] }}} + sidebarMinWidth={{{ [convert.to.pixels] }}} storyMaxWidth={{{ [subtractsubtract] }}} dragDiffMultiplied={{{ [multiply[2]] }}} storyWidthClamped={{{ [addaddsubtractcompare:number:gt[0]] ~0 }}} @@ -179,7 +187,7 @@ title: $:/core/macros/sidebar-resizer storyMinWidthConverted={{{ [function[convert.to.result],,] }}} storyMaxWidthConverted={{{ [function[convert.to.result],,] }}}> - <$action-setfield $tiddler="$:/themes/tiddlywiki/centralised/metrics/storywidth" text={{{ [compare:number:ltthenaddsuffix] :else[compare:number:gteqthenaddsuffix] :else[addsuffix] }}}/> + <$action-setfield $tiddler=<> text={{{ [compare:number:ltthenaddsuffix] :else[compare:number:gteqthenaddsuffix] :else[addsuffix] }}}/> @@ -191,18 +199,65 @@ title: $:/core/macros/sidebar-resizer \procedure sidebar-resizer-pointermove-actions() <%if [[$:/state/sidebar/resizing]!is[missing]] %> <$let widgetNodeWidth={{$:/state/sidebar/resizing!!widget-node-width}} dragDiff=<> startStoryRight={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-story-right}] }}} storyRiverWidth={{{ [add] }}} startSidebarWidth={{{ [convert.to.pixels{$:/state/sidebar/resizing!!start-sidebar-width}] }}} sidebarWidth={{{ [subtract] }}}> - <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fixed-fluid]then{$:/theme}!match[$:/themes/tiddlywiki/centralised]] %> + <%if [match[yes]] %> <> <> <> <> - <%elseif [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fluid-fixed]then{$:/theme}!match[$:/themes/tiddlywiki/centralised]] %> + <% endif %> + <%if [match[yes]] %> <> <> - <%elseif [{$:/theme}match[$:/themes/tiddlywiki/centralised]] %> + <% endif %> + <%if [match[yes]] %> <> <> <% endif %> <% endif %> \end + +\procedure sidebar-resizer() +<$eventcatcher + tag="div" + class="tc-sidebar-resizer-pointerdown-eventcatcher" + selector=".tc-sidebar-resizer" + matchSelector=".tc-sidebar-resizer" + $pointerdown=<> + $pointerup=<>> + + <%if [{$:/state/sidebar}!match[no]] %> + + <$eventcatcher + tag="div" + class="tc-sidebar-resizer-pointermove-eventcatcher-wrapper" + selector=".tc-sidebar-resizer" + matchSelector=".tc-sidebar-resizer" + $pointerup={{{ [[$:/state/sidebar/resizing]!is[missing]then] }}}> + + <$eventcatcher + tag="div" + selector=".tc-sidebar-resizer-pointermove" + matchSelector=".tc-sidebar-resizer-pointermove" + class="tc-sidebar-resizer-pointermove-eventcatcher" + $pointerup=<> + $pointerleave=<> + $pointerout=<> + $pointercancel=<> + $pointerdown=<> + $touchstart=<> + $pointermove=<> + $contextmenu=<>> + +
+ + + +
+ + + + <% endif %> + + +\end diff --git a/themes/tiddlywiki/centralised/sidebar-resizer-ui.tid b/themes/tiddlywiki/centralised/sidebar-resizer-ui.tid new file mode 100644 index 000000000..6b487fdd8 --- /dev/null +++ b/themes/tiddlywiki/centralised/sidebar-resizer-ui.tid @@ -0,0 +1,20 @@ +title: $:/core/ui/PageTemplate/sidebar-resizer +tags: $:/tags/PageTemplate +list-after: $:/core/ui/PageTemplate/story + +\import $:/core/macros/sidebar-resizer +\whitespace trim + +<%if [{$:/themes/tiddlywiki/vanilla/options/sidebarresizer}match[show]] %> + + <$let + tv-set-storywidth-storyright="no" + tv-set-sidebarwidth="no" + tv-set-centralised="yes" + > + + <$transclude $variable="sidebar-resizer"/> + + + +<% endif %> diff --git a/themes/tiddlywiki/vanilla/sidebar-resizer-ui.tid b/themes/tiddlywiki/vanilla/sidebar-resizer-ui.tid new file mode 100644 index 000000000..60f685a07 --- /dev/null +++ b/themes/tiddlywiki/vanilla/sidebar-resizer-ui.tid @@ -0,0 +1,20 @@ +title: $:/core/ui/PageTemplate/sidebar-resizer +tags: $:/tags/PageTemplate +list-after: $:/core/ui/PageTemplate/story + +\import $:/core/macros/sidebar-resizer +\whitespace trim + +<%if [{$:/themes/tiddlywiki/vanilla/options/sidebarresizer}match[show]] %> + + <$let + tv-set-storywidth-storyright={{{ [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fixed-fluid]then[yes]] :else[[no]] }}} + tv-set-sidebarwidth={{{ [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fluid-fixed]then[yes]] :else[[no]] }}} + tv-set-centralised="no" + > + + <$transclude $variable="sidebar-resizer"/> + + + +<% endif %> diff --git a/themes/tiddlywiki/vanilla/sidebar-resizer.tid b/themes/tiddlywiki/vanilla/sidebar-resizer.tid index 142887e89..6f40cd83b 100644 --- a/themes/tiddlywiki/vanilla/sidebar-resizer.tid +++ b/themes/tiddlywiki/vanilla/sidebar-resizer.tid @@ -1,126 +1,126 @@ -title: $:/themes/tiddlywiki/vanilla/sidebar-resizer -tags: [[$:/tags/Stylesheet]] -code-body: yes - -\function sidebarbreakpoint() [{$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint}] - -\function sidebarbreakpoint-minus-one() [{$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint}removesuffix[px]subtract[1]addsuffix[px]] ~[{$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint}] - -\function get.theme.metric(metric) [{$:/theme}addsuffix[/]addsuffixget[text]] ~[[$:/themes/tiddlywiki/vanilla/]addsuffixget[text]] - -\rules only filteredtranscludeinline transcludeinline macrodef macrocallinline macrocallblock conditional - -@media (min-width: <>) { - - .tc-sidebar-resizer { - position: fixed; - top: 0; - height: 100%; - width: min(calc(<> / 2),21px); - transition: opacity 100ms; - opacity: 0.1; - cursor: ew-resize; - background: linear-gradient(<>, <>) no-repeat center/2px 100%; - } - - .tc-sidebar-resizer:hover { - opacity: 0.6; - } - - @media (pointer: coarse) { - - .tc-sidebar-resizer { - background: <>; - } - - .tc-sidebar-resizer:hover { - opacity: 0.1; - } - } - - .tc-sidebar-resizer-pointermove-eventcatcher, .tc-sidebar-resizer-pointermove { - position: absolute; - top: 0; - left: 0; - right: 0; - width: 100%; - height: 100%; - min-height: 100%; - z-index: -1; - } - - .tc-sidebar-resizer, .tc-sidebar-resizer-pointermove-eventcatcher, .tc-sidebar-resizer-pointermove { - touch-action: none; - user-select: none; - } - - <%if [[$:/state/sidebar/resizing]!is[missing]] %> - - .tc-sidebar-resizer-pointermove-eventcatcher-wrapper { - z-index: 801; - } - - .tc-sidebar-resizer-pointermove-eventcatcher { - z-index: 802; - } - - .tc-sidebar-resizer-pointermove { - z-index: 803; - cursor: ew-resize; - } - - .tc-sidebar-resizer { - opacity: 0.6; - } - - @media (pointer: coarse) { - - .tc-sidebar-resizer { - opacity: 0.25; - } - } - - <% endif %> - - <%if [{$:/theme}!match[$:/themes/tiddlywiki/centralised]] %> - - .tc-sidebar-resizer { - left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),max(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),calc({{$:/themes/tiddlywiki/vanilla/metrics/storyright}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3))),max(calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3) + ({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - {{$:/themes/tiddlywiki/vanilla/metrics/storyright}})),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)))),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3))); - } - - .tc-sidebar-left .tc-sidebar-resizer { - left: auto; - right: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),max(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),calc({{$:/themes/tiddlywiki/vanilla/metrics/storyright}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3))),max(calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3) + ({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - {{$:/themes/tiddlywiki/vanilla/metrics/storyright}})),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)))),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3))); - } - - <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fluid-fixed]] %> - - .tc-sidebar-resizer { - left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3))); - } - - .tc-sidebar-left .tc-sidebar-resizer { - left: auto; - right: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3))); - } - - <% endif %> - - <% endif %> - - <%if [{$:/state/sidebar}match[no]] %> - - .tc-sidebar-resizer-pointerdown-eventcatcher, .tc-sidebar-resizer-pointermove-eventcatcher-wrapper, .tc-sidebar-resizer-pointermove-eventcatcher, .tc-sidebar-resizer-pointermove, .tc-sidebar-resizer { - display: none; - } - - <% endif %> - -} - -@media (max-width: <>) { - - .tc-sidebar-resizer-pointerdown-eventcatcher, .tc-sidebar-resizer-pointermove-eventcatcher-wrapper, .tc-sidebar-resizer-pointermove-eventcatcher, .tc-sidebar-resizer-pointermove, .tc-sidebar-resizer { - display: none; - } -} +title: $:/themes/tiddlywiki/vanilla/sidebar-resizer +tags: [[$:/tags/Stylesheet]] +code-body: yes + +\function sidebarbreakpoint() [{$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint}] + +\function sidebarbreakpoint-minus-one() [{$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint}removesuffix[px]subtract[1]addsuffix[px]] ~[{$:/themes/tiddlywiki/vanilla/metrics/sidebarbreakpoint}] + +\function get.theme.metric(metric) [{$:/theme}addsuffix[/]addsuffixget[text]] ~[[$:/themes/tiddlywiki/vanilla/]addsuffixget[text]] + +\rules only filteredtranscludeinline transcludeinline macrodef macrocallinline macrocallblock conditional + +@media (min-width: <>) { + + .tc-sidebar-resizer { + position: fixed; + top: 0; + height: 100%; + width: min(calc(<> / 2),21px); + transition: opacity 100ms; + opacity: 0.1; + cursor: ew-resize; + background: linear-gradient(<>, <>) no-repeat center/2px 100%; + } + + .tc-sidebar-resizer:hover { + opacity: 0.6; + } + + @media (pointer: coarse) { + + .tc-sidebar-resizer { + background: <>; + } + + .tc-sidebar-resizer:hover { + opacity: 0.1; + } + } + + .tc-sidebar-resizer-pointermove-eventcatcher, .tc-sidebar-resizer-pointermove { + position: absolute; + top: 0; + left: 0; + right: 0; + width: 100%; + height: 100%; + min-height: 100%; + z-index: -1; + } + + .tc-sidebar-resizer, .tc-sidebar-resizer-pointermove-eventcatcher, .tc-sidebar-resizer-pointermove { + touch-action: none; + user-select: none; + } + + <%if [[$:/state/sidebar/resizing]!is[missing]] %> + + .tc-sidebar-resizer-pointermove-eventcatcher-wrapper { + z-index: 801; + } + + .tc-sidebar-resizer-pointermove-eventcatcher { + z-index: 802; + } + + .tc-sidebar-resizer-pointermove { + z-index: 803; + cursor: ew-resize; + } + + .tc-sidebar-resizer { + opacity: 0.6; + } + + @media (pointer: coarse) { + + .tc-sidebar-resizer { + opacity: 0.25; + } + } + + <% endif %> + + <%if [{$:/theme}!match[$:/themes/tiddlywiki/centralised]] %> + + .tc-sidebar-resizer { + left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),max(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),calc({{$:/themes/tiddlywiki/vanilla/metrics/storyright}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3))),max(calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3) + ({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - {{$:/themes/tiddlywiki/vanilla/metrics/storyright}})),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)))),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3))); + } + + .tc-sidebar-left .tc-sidebar-resizer { + left: auto; + right: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),max(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),calc({{$:/themes/tiddlywiki/vanilla/metrics/storyright}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3))),max(calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3) + ({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storywidth}} - {{$:/themes/tiddlywiki/vanilla/metrics/storyright}})),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)))),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} - (2 * {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3))); + } + + <%if [{$:/themes/tiddlywiki/vanilla/options/sidebarlayout}match[fluid-fixed]] %> + + .tc-sidebar-resizer { + left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3))); + } + + .tc-sidebar-left .tc-sidebar-resizer { + left: auto; + right: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3)),calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}} + ({{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} / 3))); + } + + <% endif %> + + <% endif %> + + <%if [{$:/state/sidebar}match[no]] %> + + .tc-sidebar-resizer-pointerdown-eventcatcher, .tc-sidebar-resizer-pointermove-eventcatcher-wrapper, .tc-sidebar-resizer-pointermove-eventcatcher, .tc-sidebar-resizer-pointermove, .tc-sidebar-resizer { + display: none; + } + + <% endif %> + +} + +@media (max-width: <>) { + + .tc-sidebar-resizer-pointerdown-eventcatcher, .tc-sidebar-resizer-pointermove-eventcatcher-wrapper, .tc-sidebar-resizer-pointermove-eventcatcher, .tc-sidebar-resizer-pointermove, .tc-sidebar-resizer { + display: none; + } +}