1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-02-02 12:19:11 +00:00

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.
This commit is contained in:
Jermolene 2015-04-01 21:08:42 +01:00
parent 987bfcfd5b
commit 5101ae4ce6
2 changed files with 18 additions and 5 deletions

View File

@ -30,6 +30,14 @@ caption: Theme Tweaks
</$select> </$select>
\end \end
\define backgroundimagesize-dropdown()
<$select tiddler="$:/themes/tiddlywiki/vanilla/settings/backgroundimagesize" default="scroll">
<option value="auto">Auto</option>
<option value="cover">Cover</option>
<option value="contain">Contain</option>
</$select>
\end
You can tweak certain aspects of the ''Vanilla'' theme. You can tweak certain aspects of the ''Vanilla'' theme.
! Options ! 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"/> | | |[[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"/> |<<backgroundimage-dropdown>> | |[[Page background image|$:/themes/tiddlywiki/vanilla/settings/backgroundimage]] |<$edit-text tiddler="$:/themes/tiddlywiki/vanilla/settings/backgroundimage" default="" tag="input"/> |<<backgroundimage-dropdown>> |
|[[Page background image attachment |$:/themes/tiddlywiki/vanilla/settings/backgroundimageattachment]] |<<backgroundimageattachment-dropdown>> | | |[[Page background image attachment |$:/themes/tiddlywiki/vanilla/settings/backgroundimageattachment]] |<<backgroundimageattachment-dropdown>> | |
|[[Page background image size |$:/themes/tiddlywiki/vanilla/settings/backgroundimagesize]] |<<backgroundimagesize-dropdown>> | |
! Sizes ! Sizes

View File

@ -2,19 +2,23 @@ title: $:/themes/tiddlywiki/vanilla/base
tags: [[$:/tags/Stylesheet]] tags: [[$:/tags/Stylesheet]]
\define custom-background-datauri() \define custom-background-datauri()
<$reveal state="$:/themes/tiddlywiki/vanilla/settings/backgroundimage" type="nomatch" text="">
<$set name="background" value={{$:/themes/tiddlywiki/vanilla/settings/backgroundimage}}> <$set name="background" value={{$:/themes/tiddlywiki/vanilla/settings/backgroundimage}}>
<$list filter="[<background>is[image]]"> <$list filter="[<background>is[image]]">
`background: url(`
<$list filter="[<background>!has[_canonical_uri]]"> <$list filter="[<background>!has[_canonical_uri]]">
`background: url(`<$macrocall $name="datauri" title={{$:/themes/tiddlywiki/vanilla/settings/backgroundimage}}/>`);` <$macrocall $name="datauri" title={{$:/themes/tiddlywiki/vanilla/settings/backgroundimage}}/>
</$list> </$list>
<$list filter="[<background>has[_canonical_uri]]"> <$list filter="[<background>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"/>
</$list> </$list>
`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}}`;`
</$list> </$list>
</$set> </$set>
</$reveal>
\end \end
\rules only filteredtranscludeinline transcludeinline macrodef macrocallinline \rules only filteredtranscludeinline transcludeinline macrodef macrocallinline