CSS3 Support for SyntaxEditor

SyntaxEditor for Windows Forms Forum

Posted 7 years ago by Lisa Vaughan
Version: 12.1.0302
Avatar

Hi there,

We're looking at using the WinForms version of SyntaxEditor for a windows application that maintains our corporate CMS and internal staff Wiki/project management tools. They're all very HTML5 and CSS3 oriented and the editor will be used by web developers and designers (we have a separate WYSIWYG editor for them to use). The idea is to give the devs more access to the code via SyntaxEditor (we'll add validators and etc in the editor).

Thus far I've been tinkering and love what I see, but I am unable to workout how to get CSS3 like syntax working with your CSS grammar file example.

.icon {
 background-image: url('blah.gif');
 
 &.tracker { 
  background-position: 40px; 
 }  
 
 &.edit{   
  background-position: 35px; 
 }   
}  

I am not a CSS3 or HTML5 guru but the above snippet was given to me by one of the designers. The &.tracker parts won't be recognised.

There's also the advanced selectors for CSS3 that I'm looking at implementing by modifying the existing CSS file.

*:target { color: red; }
*:target::before {contet: url('page.png')} 

Is there a way of doing these type of things with the grammar? I thought adding a ChildState of itself to the PropertyState would be something that would work, but I can't get the .icon example above working like that.

I am also using an older version of your editor it seems - version 4.0.290.0 rather than 2012.1, this is due to the fact that another developer originally started to create a Proof of Concept but left the company. I've taken over his role and this little project.

Is it worth moving over to 2012 as it looks like if we can get  CSS3 like working, our manager should OK us buying this gem! Is there a huge difference? WPF/Silverlight are not on our agenda.

[Modified 7 years ago]

Comments (1)

Answer - Posted 7 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Lisa,

FYI v4.0 and 2012.1 for WinForms have nearly identical capabilities in terms of language definitions. You should be able to accommodate any of these changes with updates to the language definition.

For the &, that may actually require two states. One with a scope that starts with & and ends with }. This state would have similar code to the default state and would be a child of the property state.  Another state within that would be a child state that starts with { but has no end scope. It needs to be set up that way so that } can properly jump up out of the two nested states when encountered.  This lowest level one would be like the property state and would have recursion into the first new state you added.

I believe the second snippet you pasted does already syntax highlight ok with the existing lexer.


Actipro Software Support

The latest build of this product (v2020.1 build 0400) was released 24 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.