Bernd Kuemmerlen wrote:
>
> with the current docbook.css, the rendering of the <shortcut> tag in a
> <menuchoice> is not very nice, for example look at the following
> fragment in XXE:
>
> <?xml version="1.0" encoding="UTF-8" ?>
> <section>
> <para>
> <menuchoice>
> <shortcut>
> <keysym>C-N</keysym>
> </shortcut>
> <guimenu>Datei</guimenu>
> <guimenuitem>Neu</guimenuitem>
> </menuchoice>
> </para>
> </section>
>
> The opening "(" of the shortcut is not rendered because the
> menuchoice > *:first-child:before
> statement in docbook.css overrides this.
>
> I am no css-expert, but I tried to come up with something more
> reasonable (just IMHO), the following patch to docbook.css changes the
> menuchoice rendering a bit, the shortcut always gets the parenthesis,
> guimenu element never have a ">>" before and guisubmenu and guimenuitem
> have no ">>" if they are the first child of the menuchoice.
Thanks for the patch. I added this variation to XXE DocBook style sheet:
------------------
menuchoice > *:before {
content: "->";
}
menuchoice > shortcut + *:before {
content: " ";
}
menuchoice > *:first-child:before {
content: "";
}
/*
* shortcut is the optional first child of menuchoice and it
* cannot appear anywhere else.
* The :first-child is needed just to make the specificity
* of this rule higher than specificity of the rule above.
*/
menuchoice > shortcut:first-child:before {
content: "(";
}
menuchoice > shortcut:after {
content: ")";
}
------------------