From 5101ae4ce65349da5d41f84cb902797aac51e843 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Wed, 1 Apr 2015 21:08:42 +0100 Subject: [PATCH] Add background image size theme tweak Makes it possible to create a background image that fully covers the window, as well as the tiled images that were working before. --- themes/tiddlywiki/vanilla/ThemeTweaks.tid | 9 +++++++++ themes/tiddlywiki/vanilla/base.tid | 14 +++++++++----- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/themes/tiddlywiki/vanilla/ThemeTweaks.tid b/themes/tiddlywiki/vanilla/ThemeTweaks.tid index 30a58f23c..ef56b935a 100644 --- a/themes/tiddlywiki/vanilla/ThemeTweaks.tid +++ b/themes/tiddlywiki/vanilla/ThemeTweaks.tid @@ -30,6 +30,14 @@ caption: Theme Tweaks \end +\define backgroundimagesize-dropdown() +<$select tiddler="$:/themes/tiddlywiki/vanilla/settings/backgroundimagesize" default="scroll"> + + + + +\end + You can tweak certain aspects of the ''Vanilla'' theme. ! Options @@ -42,6 +50,7 @@ You can tweak certain aspects of the ''Vanilla'' theme. |[[Code font family|$:/themes/tiddlywiki/vanilla/settings/codefontfamily]] |<$edit-text tiddler="$:/themes/tiddlywiki/vanilla/settings/codefontfamily" default="" tag="input"/> | | |[[Page background image|$:/themes/tiddlywiki/vanilla/settings/backgroundimage]] |<$edit-text tiddler="$:/themes/tiddlywiki/vanilla/settings/backgroundimage" default="" tag="input"/> |<> | |[[Page background image attachment |$:/themes/tiddlywiki/vanilla/settings/backgroundimageattachment]] |<> | | +|[[Page background image size |$:/themes/tiddlywiki/vanilla/settings/backgroundimagesize]] |<> | | ! Sizes diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid index e1f67848d..4f95f88f4 100644 --- a/themes/tiddlywiki/vanilla/base.tid +++ b/themes/tiddlywiki/vanilla/base.tid @@ -2,19 +2,23 @@ title: $:/themes/tiddlywiki/vanilla/base tags: [[$:/tags/Stylesheet]] \define custom-background-datauri() -<$reveal state="$:/themes/tiddlywiki/vanilla/settings/backgroundimage" type="nomatch" text=""> <$set name="background" value={{$:/themes/tiddlywiki/vanilla/settings/backgroundimage}}> <$list filter="[is[image]]"> +`background: url(` <$list filter="[!has[_canonical_uri]]"> -`background: url(`<$macrocall $name="datauri" title={{$:/themes/tiddlywiki/vanilla/settings/backgroundimage}}/>`);` +<$macrocall $name="datauri" title={{$:/themes/tiddlywiki/vanilla/settings/backgroundimage}}/> <$list filter="[has[_canonical_uri]]"> -`background: url(`<$view tiddler={{$:/themes/tiddlywiki/vanilla/settings/backgroundimage}} field="_canonical_uri"/>`);` +<$view tiddler={{$:/themes/tiddlywiki/vanilla/settings/backgroundimage}} field="_canonical_uri"/> -`background-attachment: `{{$:/themes/tiddlywiki/vanilla/settings/backgroundimageattachment}}`;` +`);` +`background-attachment: `{{$:/themes/tiddlywiki/vanilla/settings/backgroundimageattachment}}`; +-webkit-background-size:` {{$:/themes/tiddlywiki/vanilla/settings/backgroundimagesize}}`; +-moz-background-size:` {{$:/themes/tiddlywiki/vanilla/settings/backgroundimagesize}}`; +-o-background-size:` {{$:/themes/tiddlywiki/vanilla/settings/backgroundimagesize}}`; +background-size:` {{$:/themes/tiddlywiki/vanilla/settings/backgroundimagesize}}`;` - \end \rules only filteredtranscludeinline transcludeinline macrodef macrocallinline