From fc315d1df7621b2ae4aea7e545decb7573f0844f Mon Sep 17 00:00:00 2001 From: Jermolene Date: Sun, 22 Mar 2015 10:15:43 +0000 Subject: [PATCH] Make sticky titles be a theme tweak for Vanilla theme Fixes #1599 (albeit brutally!) --- editions/prerelease/tiddlers/Release 5.1.8.tid | 2 +- themes/tiddlywiki/snowwhite/base.tid | 11 ----------- themes/tiddlywiki/vanilla/ThemeTweaks.tid | 5 +++++ themes/tiddlywiki/vanilla/base.tid | 2 ++ themes/tiddlywiki/vanilla/options.multids | 3 +++ themes/tiddlywiki/vanilla/sticky.tid | 16 ++++++++++++++++ 6 files changed, 27 insertions(+), 12 deletions(-) create mode 100644 themes/tiddlywiki/vanilla/options.multids create mode 100644 themes/tiddlywiki/vanilla/sticky.tid diff --git a/editions/prerelease/tiddlers/Release 5.1.8.tid b/editions/prerelease/tiddlers/Release 5.1.8.tid index 6ed1e3e55..8e9702152 100644 --- a/editions/prerelease/tiddlers/Release 5.1.8.tid +++ b/editions/prerelease/tiddlers/Release 5.1.8.tid @@ -29,7 +29,7 @@ This release includes many improvements to the documentation for TiddlyWiki. Man * [[Improved|https://github.com/Jermolene/TiddlyWiki5/pull/1353]] behaviour of the tag dropdown in the edit template * [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/ea6e60e66983ee1184f09c5796ef6c8bceae703a]] automatic focusing of the search box at startup * [[Introduced|https://github.com/Jermolene/TiddlyWiki5/commit/4f3cb8b9aebfc4f65f40c96ef99730887d746b41]] the [[Railroad Plugin]] by Astrid Elocson (see it in action in the new [[Filter Syntax]] documentation) -* [[Migrated|https://github.com/Jermolene/TiddlyWiki5/commit/230066eeae9ace8336612e02c78f8cdaa3f717e4]] functionality of "Sticky Titles" theme into "Vanilla"/"Snow White". This means that tiddler titles will stick to the top of the window during scrolling on browsers that support `position: sticky` (such as Safari and Firefox) +* [[Migrated|https://github.com/Jermolene/TiddlyWiki5/commit/230066eeae9ace8336612e02c78f8cdaa3f717e4]] functionality of "Sticky Titles" theme into an optional tweak for the "Vanilla"/"Snow White" themes. This means that tiddler titles will stick to the top of the window during scrolling on browsers that support `position: sticky` (such as Safari and Firefox) * [[Added|https://github.com/Jermolene/TiddlyWiki5/commit/8cb7090c40489c81e8c5dfb8cbbdee2c60998c3e]] icons to [[$:/AdvancedSearch]], [[$:/ControlPanel]] and [[$:/TagManager]] * [[Changed|https://github.com/Jermolene/TiddlyWiki5/commit/b9129d77e99970579074bdb4f9c2ef4b77b812c6]] wording of tiddler "save" button to "store" * [[Added|https://github.com/Jermolene/TiddlyWiki5/issues/1103]] automatic linking of system tiddlers such as $:/ControlPanel diff --git a/themes/tiddlywiki/snowwhite/base.tid b/themes/tiddlywiki/snowwhite/base.tid index e9f342119..608725505 100644 --- a/themes/tiddlywiki/snowwhite/base.tid +++ b/themes/tiddlywiki/snowwhite/base.tid @@ -7,17 +7,6 @@ tags: [[$:/tags/Stylesheet]] text-shadow: 0 1px 0 <>; } -.tc-tiddler-title { - position: -webkit-sticky; - position: -moz-sticky; - position: -o-sticky; - position: -ms-sticky; - position: sticky; - top: 0px; - background: <>; - z-index: 500; -} - .tc-tiddler-info { <> } diff --git a/themes/tiddlywiki/vanilla/ThemeTweaks.tid b/themes/tiddlywiki/vanilla/ThemeTweaks.tid index f21700dd5..9b1e76ad9 100644 --- a/themes/tiddlywiki/vanilla/ThemeTweaks.tid +++ b/themes/tiddlywiki/vanilla/ThemeTweaks.tid @@ -4,6 +4,11 @@ caption: Theme Tweaks You can tweak certain aspects of the ''Vanilla'' theme. +! Options + +|[[Sticky titles|$:/themes/tiddlywiki/vanilla/options/stickytitles]]
//Causes tiddler titles to "stick" to the top of the screen. Not compatible with Chrome, and causes some layout issues in Firefox// |<$select tiddler="$:/themes/tiddlywiki/vanilla/options/stickytitles"> | + + ! Settings |[[Font family|$:/themes/tiddlywiki/vanilla/settings/fontfamily]] |<$edit-text tiddler="$:/themes/tiddlywiki/vanilla/settings/fontfamily" default="" tag="input"/> | diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid index c973717a4..e09299134 100644 --- a/themes/tiddlywiki/vanilla/base.tid +++ b/themes/tiddlywiki/vanilla/base.tid @@ -571,6 +571,8 @@ button.tc-untagged-label { border: 1px solid <>; } +{{$:/themes/tiddlywiki/vanilla/sticky}} + .tc-tiddler-info { padding: 14px 42px 14px 42px; background-color: <>; diff --git a/themes/tiddlywiki/vanilla/options.multids b/themes/tiddlywiki/vanilla/options.multids new file mode 100644 index 000000000..e8189b8c2 --- /dev/null +++ b/themes/tiddlywiki/vanilla/options.multids @@ -0,0 +1,3 @@ +title: $:/themes/tiddlywiki/vanilla/options/ + +stickytitles: no diff --git a/themes/tiddlywiki/vanilla/sticky.tid b/themes/tiddlywiki/vanilla/sticky.tid new file mode 100644 index 000000000..407f44665 --- /dev/null +++ b/themes/tiddlywiki/vanilla/sticky.tid @@ -0,0 +1,16 @@ +title: $:/themes/tiddlywiki/vanilla/sticky + +<$reveal state="$:/themes/tiddlywiki/vanilla/options/stickytitles" type="match" text="yes"> +`` +.tc-tiddler-title { + position: -webkit-sticky; + position: -moz-sticky; + position: -o-sticky; + position: -ms-sticky; + position: sticky; + top: 0px; + background: ``<>``; + z-index: 500; +} +`` +