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:
parent
987bfcfd5b
commit
5101ae4ce6
@ -30,6 +30,14 @@ caption: Theme Tweaks
|
||||
</$select>
|
||||
\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.
|
||||
|
||||
! 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"/> |<<backgroundimage-dropdown>> |
|
||||
|[[Page background image attachment |$:/themes/tiddlywiki/vanilla/settings/backgroundimageattachment]] |<<backgroundimageattachment-dropdown>> | |
|
||||
|[[Page background image size |$:/themes/tiddlywiki/vanilla/settings/backgroundimagesize]] |<<backgroundimagesize-dropdown>> | |
|
||||
|
||||
! Sizes
|
||||
|
||||
|
@ -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="[<background>is[image]]">
|
||||
`background: url(`
|
||||
<$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 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>
|
||||
`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>
|
||||
</$set>
|
||||
</$reveal>
|
||||
\end
|
||||
|
||||
\rules only filteredtranscludeinline transcludeinline macrodef macrocallinline
|
||||
|
Loading…
Reference in New Issue
Block a user