[sword-devel] CSS in Xiphos
Karl Kleinpaste
karl at kleinpaste.org
Fri Apr 20 07:13:41 MST 2018
Xiphos is an XHTML-driven application, and a couple years ago I added
the ability to support user-specified CSS controls
<http://wiki.crosswire.org/Choosing_a_SWORD_program#cite_note-84>.
Initially, this was only per-module, using style.css in the DataPath of
the module. This was first requested by Neil Mayhew (SIL; Freenode
#lsdevlinux). Soon after, I made Xiphos also understand
~/.xiphos/default-style.css, but it's hard to document this in a way
that users find readily. I thought I'd mention it for the sake of a
little visibility.
Below is my default-style.css right now. I've been using 2-column
display as a default for quite a while, because I tend to use large
screens and horizontal real estate is too plentiful to want to read
single-column. In specific modules where that doesn't work well, I add a
style.css to their directories which restores 1-column behavior.
(Default loads 1st, per-module 2nd.) There are a couple genbook modules
I use routinely that display alone, and for those I use style.css to
configure 4-column. The rest here followed after working on better ways
to show pre-book and -chapter intro material.
body { -webkit-column-count: 2 ; margin-top: 0.1cm ; }
.introMaterial { background-color:yellow ; color:black }
.divineName { color:purple }
.transChange { background-color:green ; color:yellow }
As is typical for CSS, it's possible to walk right up to the edge of
visual psychosis with it, and my choices in these controls have explored
that boundary explicitly. The ".divineName" and ".transChange"
attributes are standard in the XHTML provided by Sword rendering. You
can find the rest of the available knobs to twist with "diatheke -b KJV
-f xhtml -k gen.1.1". So if you really want .wordsOfJesus in 24-point
boldface, you can arrange for that in Xiphos directly. ".introMaterial"
is a Xiphos-specific provision as of 4.1, which will remain until/unless
Sword itself starts rendering N:0 requests (pre-book/-chapter content)
with its own control name.
Have some fun with it. Share your particularly good, or particularly
psychotic, modifications.
http://ftp.xiphos.org/sword/xiphos/CSS/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.crosswire.org/pipermail/sword-devel/attachments/20180420/7864bf3f/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: iblkigpainlemmci.png
Type: image/png
Size: 211145 bytes
Desc: not available
URL: <http://www.crosswire.org/pipermail/sword-devel/attachments/20180420/7864bf3f/attachment-0001.png>
More information about the sword-devel
mailing list