Styling xincluded inline elements with css

Having trouble installing Oxygen? Got a bug to report? Post it all here.
dcramer
Posts: 163
Joined: Sat Aug 28, 2010 1:23 am

Styling xincluded inline elements with css

Post 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
Radu
Posts: 9446
Joined: Fri Jul 09, 2004 5:18 pm

Re: Styling xincluded inline elements with css

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
dcramer
Posts: 163
Joined: Sat Aug 28, 2010 1:23 am

Re: Styling xincluded inline elements with css

Post 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
Radu
Posts: 9446
Joined: Fri Jul 09, 2004 5:18 pm

Re: Styling xincluded inline elements with css

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
dcramer
Posts: 163
Joined: Sat Aug 28, 2010 1:23 am

Re: Styling xincluded inline elements with css

Post 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
Post Reply