Skip to content

Commit

Permalink
update vanilla base
Browse files Browse the repository at this point in the history
  • Loading branch information
BurningTreeC committed Oct 10, 2024
1 parent 054d630 commit 48ed5dc
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 12 deletions.
10 changes: 6 additions & 4 deletions core/wiki/macros/sidebar-resizer.tid
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ title: $:/core/macros/sidebar-resizer

\function get.theme.metric(metric) [{$:/theme}addsuffix[/]addsuffix<metric>get[text]] ~[[$:/themes/tiddlywiki/vanilla/]addsuffix<metric>get[text]]

\function set.theme.metric(metric) [{$:/theme}addsuffix[/]addsuffix<metric>is[shadow]] ~[{$:/theme}addsuffix[/]addsuffix<metric>is[shadow]!is[missing]] ~[[$:/themes/tiddlywiki/vanilla/]addsuffix<metric>]

\function get.value.metric(value) [<value>suffix[px]then[px]] ~[<value>suffix[%]then[%]] ~[<value>suffix[cm]then[cm]] ~[<value>suffix[mm]then[mm]] ~[<value>suffix[Q]then[Q]] ~[<value>suffix[in]then[in]] ~[<value>suffix[pc]then[pc]] ~[<value>suffix[pt]then[pt]] ~[<value>suffix[em]then[em]]

\procedure sidebar-resizer-pointerdown-actions()
Expand Down Expand Up @@ -110,8 +112,8 @@ title: $:/core/macros/sidebar-resizer

tiddlerWidthResult={{{ [<tiddlerWidthMetric>match[%]then<storyWidth>compare:number:lt<storyMinWidth>then<get.theme.metric metrics/tiddlerwidth>compare:number:gteq[0]then<get.theme.metric metrics/tiddlerwidth>] ~[<tiddlerWidthMetric>match[%]then<storyWidth>compare:number:gt<storyMaxWidth>then<get.theme.metric metrics/tiddlerwidth>] ~[<tiddlerWidthMetric>!match[%]then<tiddlerWidth>compare:number:lt<tiddlerMinWidth>then<tiddlerMinWidthConverted>addsuffix<tiddlerWidthMetric>] ~[<tiddlerWidthMetric>!match[%]then<tiddlerWidth>compare:number:gteq<tiddlerMaxWidth>then<tiddlerMaxWidthConverted>addsuffix<tiddlerWidthMetric>] ~[<tiddlerWidth>compare:number:lt[0]then[0]addsuffix<tiddlerWidthMetric>] ~[<tiddlerWidthConverted>addsuffix<tiddlerWidthMetric>] }}}>

<$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth" text=<<tiddlerWidthResult>>/>
<$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storywidth" text=<<storyWidthResult>>/>
<$action-setfield $tiddler=<<set.theme.metric metrics/tiddlerwidth>> text=<<tiddlerWidthResult>>/>
<$action-setfield $tiddler=<<set.theme.metric metrics/storywidth>> text=<<storyWidthResult>>/>

</$let>

Expand All @@ -123,7 +125,7 @@ title: $:/core/macros/sidebar-resizer

result={{{ [<storyRiverWidth>compare:number:lt<storyMinWidthAddLeft>then<storyMinWidthAddLeftConverted>addsuffix<storyRightMetric>] ~[<storyRiverWidth>compare:number:gteq<storyRiverLimit>then<storyRiverLimitConverted>addsuffix<storyRightMetric>] ~[<storyRiverWidthConverted>addsuffix<storyRightMetric>] }}}>

<$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyright" text=<<result>>/>
<$action-setfield $tiddler=<<set.theme.metric metrics/storyright>> text=<<result>>/>

</$let>

Expand All @@ -145,7 +147,7 @@ title: $:/core/macros/sidebar-resizer
sidebarMaxWidthConverted={{{ [function[convert.to.result],<sidebarMaxWidth>,<sidebarWidthMetric>] }}}
sidebarMinWidthConverted={{{ [function[convert.to.result],<sidebarMinWidth>,<sidebarWidthMetric>] }}}>

<$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth" text={{{ [<sidebarWidth>compare:number:gteq<sidebarMaxWidth>then<sidebarMaxWidthConverted>addsuffix<sidebarWidthMetric>] ~[<sidebarWidth>compare:number:lt<sidebarMinWidth>then<sidebarMinWidthConverted>addsuffix<sidebarWidthMetric>] ~[<sidebarWidthConverted>addsuffix<sidebarWidthMetric>] }}}/>
<$action-setfield $tiddler=<<set.theme.metric metrics/sidebarwidth>> text={{{ [<sidebarWidth>compare:number:gteq<sidebarMaxWidth>then<sidebarMaxWidthConverted>addsuffix<sidebarWidthMetric>] ~[<sidebarWidth>compare:number:lt<sidebarMinWidth>then<sidebarMinWidthConverted>addsuffix<sidebarWidthMetric>] ~[<sidebarWidthConverted>addsuffix<sidebarWidthMetric>] }}}/>
</$vars>
</$let>
\end
Expand Down
2 changes: 1 addition & 1 deletion themes/tiddlywiki/centralised/metrics.multids
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ sidebarminwidth: 350px
storyminwidth: 350px
storypaddingleft: 42px
storypaddingright: 42px
storywidth: 770px
storywidth: 770px
6 changes: 5 additions & 1 deletion themes/tiddlywiki/tight-heavier/metrics.multids
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
title: $:/themes/tiddlywiki/tight-heavier/metrics/

sidebarwidth: 350px
storypaddingleft: 0px
storypaddingright: 0px
storypaddingright: 0px
storyright: 770px
storywidth: 770px
tiddlerwidth: 770px
5 changes: 4 additions & 1 deletion themes/tiddlywiki/tight/metrics.multids
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
title: $:/themes/tiddlywiki/tight/metrics/

sidebarwidth: 350px
storypaddingleft: 0px
storypaddingright: 0px
tiddlerwidth: 770px
storyright: 770px
storywidth: 770px
tiddlerwidth: 770px
10 changes: 5 additions & 5 deletions themes/tiddlywiki/vanilla/base.tid
Original file line number Diff line number Diff line change
Expand Up @@ -1029,7 +1029,7 @@ button.tc-btn-invisible.tc-remove-tag-button {
.tc-sidebar-scrollable {
position: fixed;
top: {{$:/themes/tiddlywiki/vanilla/metrics/storytop}};
left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}}),{{$:/themes/tiddlywiki/vanilla/metrics/storyright}},calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}}));
left: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}}),<<get.theme.metric metrics/storyright>>,calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}}));
bottom: 0;
right: 0;
overflow-y: auto;
Expand All @@ -1041,14 +1041,14 @@ button.tc-btn-invisible.tc-remove-tag-button {

html[dir="rtl"] .tc-sidebar-scrollable {
left: auto;
right: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}}),{{$:/themes/tiddlywiki/vanilla/metrics/storyright}},calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}}));
right: clamp(calc({{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} + {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}}),<<get.theme.metric metrics/storyright>>,calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}}));
}

.tc-story-river {
position: relative;
left: max(0px,{{$:/themes/tiddlywiki/vanilla/metrics/storyleft}});
top: {{$:/themes/tiddlywiki/vanilla/metrics/storytop}};
width: clamp({{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}},{{$:/themes/tiddlywiki/vanilla/metrics/storywidth}},calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}}));
width: clamp({{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}},<<get.theme.metric metrics/storywidth>>,calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}}));
padding: 42px {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingright}} 42px {{$:/themes/tiddlywiki/vanilla/metrics/storypaddingleft}};
}

Expand Down Expand Up @@ -1483,7 +1483,7 @@ html body.tc-body.tc-single-tiddler-window {
width: auto;
left: 0;
margin-left: max(0px,{{$:/themes/tiddlywiki/vanilla/metrics/storyleft}});
margin-right: clamp({{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}},{{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}},calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} - {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}}));
margin-right: clamp({{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}},<<get.theme.metric metrics/sidebarwidth>>,calc(100% - {{$:/themes/tiddlywiki/vanilla/metrics/storyleft}} - {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}}));
}

.tc-tiddler-frame {
Expand All @@ -1494,7 +1494,7 @@ html body.tc-body.tc-single-tiddler-window {
left: auto;
bottom: 0;
right: 0;
width: clamp({{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}},{{$:/themes/tiddlywiki/vanilla/metrics/sidebarwidth}},(100% - {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} - {{$:/themes/tiddlywiki/vanilla/metrics/storyleft}}));
width: clamp({{$:/themes/tiddlywiki/vanilla/metrics/sidebarminwidth}},<<get.theme.metric metrics/sidebarwidth>>,(100% - {{$:/themes/tiddlywiki/vanilla/metrics/storyminwidth}} - {{$:/themes/tiddlywiki/vanilla/metrics/storyleft}}));
}

body.tc-body .tc-page-container.tc-page-view-zoomin .tc-tiddler-frame {
Expand Down

0 comments on commit 48ed5dc

Please sign in to comment.