A theme super-hack

20 views
Skip to first unread message

XENO

unread,
Feb 10, 2008, 5:45:50 PM2/10/08
to TiddlyWiki
Using the IsDirty plug-in ( http://tiddlywiki.bidix.info/#IsDirtyPlugin
) is it possible to have the background color of the theme title area
change?
I am using the BlueBerry2 theme ( http://tiddlythemes.com/#Blueberry2
) where a change from the Blue to lets say a red would be very
helpfull.
Thank you
C

FND

unread,
Feb 11, 2008, 3:02:37 AM2/11/08
to Tiddl...@googlegroups.com
> Using the IsDirty plug-in ( http://tiddlywiki.bidix.info/#IsDirtyPlugin
> ) is it possible to have the background color of the theme title area
> change?

I'm not sure about the IsDirty plugin, but you could use TiddlyWiki's
new theme-switching functionality.
(N.B.: There a still a few quirks with that feature right now; those
will most likely be ironed out in the upcoming 2.3.1 release - so I'd
hold off on this until then.)

Create a tiddler tagged with "systemConfig" with the following contents:
---------------
//{{{
// hijack setDirty() to add theme switching
setDirty_DirtyStyle = TiddlyWiki.prototype.setDirty;
TiddlyWiki.prototype.setDirty = function() {
setDirty_DirtyStyle.apply(this, arguments);
if(this.dirty)
story.switchTheme("DirtyTheme");
else
story.switchTheme("CleanTheme");
};
//}}}
---------------

Then create two theme tiddlers, [[CleanTheme]] and [[DirtyTheme]], both
tagged with "systemTheme":
---------------
/***
|''Name:''|DirtyTheme|
|''~CoreVersion:''|2.3.0|

|''~StyleSheet:''|##StyleSheet|
***/
!StyleSheet
/*{{{*/
[[StyleSheetCustom]]

body {
background-color: #F00;
}
/*}}}*/
---------------
/***
|''Name:''|CleanTheme|
|''~CoreVersion:''|2.3.0|

|''~StyleSheet:''|##StyleSheet|
***/
!StyleSheet
/*{{{*/
[[StyleSheetCustom]]

body {
background-color: #F00;
}
/*}}}*/
---------------

This way you can modify the StyleSheet portions for each state (dirty or
not dirty) individually - shared styles go into [[StyleSheetCustom]].

HTH.


-- F.

Reply all
Reply to author
Forward
0 new messages