Styling xincluded inline elements with css

Having trouble installing <oXygen/>? Got a bug to report? Post it all here.
dcramer
Posts: 159
Joined: Sat Aug 28, 2010 1:23 am

Styling xincluded inline elements with css

Post by dcramer » Mon Feb 14, 2011 8:24 pm

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: 7029
Joined: Fri Jul 09, 2004 5:18 pm

Re: Styling xincluded inline elements with css

Post by Radu » Tue Feb 15, 2011 10:47 am

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: 159
Joined: Sat Aug 28, 2010 1:23 am

Re: Styling xincluded inline elements with css

Post by dcramer » Tue Feb 15, 2011 11:09 pm

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: 7029
Joined: Fri Jul 09, 2004 5:18 pm

Re: Styling xincluded inline elements with css

Post by Radu » Wed Feb 16, 2011 10:40 am

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: 159
Joined: Sat Aug 28, 2010 1:23 am

Re: Styling xincluded inline elements with css

Post by dcramer » Wed Feb 16, 2011 9:45 pm

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