Page 1 of 1

Styling xincluded inline elements with css

Posted: Mon Feb 14, 2011 8:24 pm
by dcramer
Hi there,
I was inspired by something in this thread, http://www.oxygenxml.com/forum/topic3240.html, to try to change the styling of xincluded content. I can see that oxy|reference also applies to xinclude, but nothing I try affects the include element itself. My goal is to make xincluded inlines less obtrusive (in my customization of DocBook, you can xinclude any element, including inlines).

I was trying things like this and could get it to style the oxy|reference but not the include:

Code: Select all


@namespace oxy url('http://www.oxygenxml.com/extensions/author');
@namespace xi url('http://www.w3.org/2001/XInclude"');

oxy|reference, xi|include {
display:inline !important;
}

oxy|reference:before, xi|include:before {
display: inline !important;
}
Any tips?

Thanks,
David

Re: Styling xincluded inline elements with css

Posted: Tue Feb 15, 2011 10:47 am
by Radu
Hi David,

Are you looking for a CSS selector like this?

Code: Select all

/*a <sect1> which is a direct child of an <xi:include> which is a direct child of the root <article>*/
article > xi|include > sect1:before{
display:inline;
}
Regards,
Radu

Re: Styling xincluded inline elements with css

Posted: Tue Feb 15, 2011 11:09 pm
by dcramer
Actually, I figured out I just need to leave off the namespace prefix:

Code: Select all


include {
display:inline !important;
}
That prevents the include element itself from being rendered as a block element, which gets me part of the way there. Is there a way to suppress the link icon and the value of the href attribute? I tried adding

Code: Select all

content: "" !important
to the rule but that doesn't help.

Doing the following:

Code: Select all


oxy|reference:before {
content: "" !important;
}
gets rid of the other icon, but it's not so obtrusive. In fact, I'd like to keep it and get rid of the link icon and value of the href attribute.

David

Re: Styling xincluded inline elements with css

Posted: Wed Feb 16, 2011 10:40 am
by Radu
Hi David,

This CSS snippet should get you there:

Code: Select all

@namespace xi "http://www.w3.org/2001/XInclude";
@namespace oxy url('http://www.oxygenxml.com/extensions/author');
xi|include:before {
content:"" !important;
}
oxy|reference:before {
content: "" !important;
}
Regards,
Radu

Re: Styling xincluded inline elements with css

Posted: Wed Feb 16, 2011 9:45 pm
by dcramer
Yes, that did it. I guess the "url()" part kept the xi from being recognized? Anyway, below is what I ended up with (I've modified DocBook to allow xincludes anywhere, so I want included content in paras, entrys and titles, to be inline and less obtrusive. I've kept the little icon before the oxy|reference because it's unobtrusive and mousing over it shows the path to the included content:

Code: Select all


@namespace xi "http://www.w3.org/2001/XInclude";

para xi|include, entry xi|include, title xi|include {
display:inline !important;
}

para xi|include:before, entry xi|include:before, title xi|include:before {
content:"" !important;
}
Thanks,
David