[oXygen-sdk] Custom editor variables in CSS

Alex Jitianu alex_jitianu at sync.ro
Wed May 7 07:58:27 CDT 2014


Hello,

As far as I know you can't use any type of editor variables inside CSS 
rules, neither custom nor built-in ones. Can you give us more detains 
about how is the user changing between different branches? Maybe we can 
give some alternatives, like:
- you can have different CSSs associated in the document type and the 
user can switch between them using the "Styles" button on the toolbar 
(when the branch changes)
- you can use custom pseudo-classes [1]. Firstly, you must have rules in 
the CSS to match the pseudo classes, maybe like this:

rootElement:-ext-branch1-pseudo-class image {
   content: url(..path1..)
}

rootElement:-ext-branch2-pseudo-class image {
   content: url(..path2..)
}

When the branch changes you must set the respective pseudo class. You 
can do that dynamically from the JAVA API [1] or by using an action with 
TogglePseudoClassOperation [2] or SetPseudoClassOperation [3].

[1] 
http://www.oxygenxml.com/doc/ug-oxygen/#topics/dg-custom-css-pseudo-classes.html
[2] 
http://www.oxygenxml.com/InstData/Editor/SDK/javadoc/ro/sync/ecss/extensions/commons/operations/TogglePseudoClassOperation.html
[3] 
http://www.oxygenxml.com/InstData/Editor/SDK/javadoc/ro/sync/ecss/extensions/commons/operations/SetPseudoClassOperation.html

Best regards,
Alex
-- 
Alex Jitianu
<oXygen/>  XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

On 07-May-14 1:50 AM, Nathan wrote:
> Hi,
>   I might be wrong here but I am finding that custom variables defined 
> in preferences cannot be used in the CSS (editor variables are fine). 
> If this is true, is there any way to use custom variables in the CSS? 
> We have a case where a person might need to select images in different 
> branches of a version control system and I need to change CSS display 
> based on the branch selected.
>
> Regards,
> Nathan
>
>
> _______________________________________________
> oXygen-sdk mailing list
> oXygen-sdk at oxygenxml.com
> http://www.oxygenxml.com/mailman/listinfo/oxygen-sdk

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.oxygenxml.com/pipermail/oxygen-sdk/attachments/20140507/2b5ae624/attachment.html>


More information about the oXygen-sdk mailing list