1 of 2
1
LESS CSS Sugar?
Posted: 06 February 2010 09:38 PM   [ Ignore ]
Newbie
Rank
Total Posts:  2
Joined  2010-02-06

Would anyone be able to create a LESS CSS sugar? It is really the only thing that Espresso lacks. :)

Profile
 
 
Posted: 07 February 2010 10:19 PM   [ Ignore ]   [ # 1 ]
Sr. Member
RankRankRankRank
Total Posts:  232
Joined  2008-11-19

You can! I don’t have experience in making Sugars myself. But, oh man, {less} looks amazing.

Profile
 
 
Posted: 08 February 2010 11:24 AM   [ Ignore ]   [ # 2 ]
Moderator
RankRankRankRank
Total Posts:  1252
Joined  2008-10-28

Or you could use the Less app, which works with any text editor.

 Signature 

Ian Beck
MacRabbit Support

Follow us on Twitter, or try my custom themes: Quiet Light & Earthworm

Profile
 
 
Posted: 08 February 2010 07:22 PM   [ Ignore ]   [ # 3 ]
Newbie
Rank
Total Posts:  7
Joined  2009-03-29

A start:

http://github.com/elliottcable/LESS.sugar

Profile
 
 
Posted: 14 February 2010 09:10 PM   [ Ignore ]   [ # 4 ]
Newbie
Rank
Total Posts:  5
Joined  2010-02-13

One of the things I really love about Espresso is the intelligent code completion and helpful theming + navigator for scanning documents.

Am I correct in understanding it would take a Sugar to bring these features? Or perhaps writing as a .css, copy + paste to a .less, then run the gem?

Profile
 
 
Posted: 15 February 2010 10:42 AM   [ Ignore ]   [ # 5 ]
Moderator
RankRankRankRank
Total Posts:  1252
Joined  2008-10-28

Code completion, theming, and so forth for Less syntax would require a Sugar, as would expanding the CSS itemizer definitions in order to get Less nesting in the navigator.

 Signature 

Ian Beck
MacRabbit Support

Follow us on Twitter, or try my custom themes: Quiet Light & Earthworm

Profile
 
 
Posted: 15 February 2010 03:36 PM   [ Ignore ]   [ # 6 ]
Newbie
Rank
Total Posts:  2
Joined  2010-02-06

Would it be possible to just edit the original CSS Sugar to work with LESS?

Profile
 
 
Posted: 15 February 2010 07:02 PM   [ Ignore ]   [ # 7 ]
Moderator
RankRankRankRank
Total Posts:  1252
Joined  2008-10-28

Simon,

That wouldn’t be necessary.  Sugars can embed/extend the functionality from other Sugars, so a Less sugar would probably just add a few syntactical zones on top of the existing CSS sugar.

 Signature 

Ian Beck
MacRabbit Support

Follow us on Twitter, or try my custom themes: Quiet Light & Earthworm

Profile
 
 
Posted: 18 February 2010 10:20 AM   [ Ignore ]   [ # 8 ]
Newbie
Rank
Total Posts:  12
Joined  2009-04-09
jpcody - 14 February 2010 09:10 PM

One of the things I really love about Espresso is the intelligent code completion and helpful theming + navigator for scanning documents.

Am I correct in understanding it would take a Sugar to bring these features? Or perhaps writing as a .css, copy + paste to a .less, then run the gem?

It would require a sugar. I can’t imagine it’d be that hard to make one for a Sugar developer that knows what they’re doing (I don’t - I just had a look and got scared off by the big list of XML files and limited docs in the wiki).

At present I’m just overriding the automatic language detection and telling Espresso it’s a CSS file, which is close enough for now.

As an aside, this would be great in CSSEdit also. I’ve been using less on a project recently and it’s something I think will stick around in my dev toolbox.

Profile
 
 
Posted: 18 February 2010 11:18 AM   [ Ignore ]   [ # 9 ]
Newbie
Rank
Total Posts:  5
Joined  2010-02-13

Aegis, this would be satisfactory for me in the interim. Is there somewhere one can update Espresso to force it to treat all .less files as .css?

Profile
 
 
Posted: 18 February 2010 11:44 AM   [ Ignore ]   [ # 10 ]
Moderator
RankRankRankRank
Total Posts:  1252
Joined  2008-10-28

jpcody, you can add .less as a CSS extension by overriding the default Sugar:

http://wiki.macrabbit.com/index/Override_default_sugars/

Hopefully there will be an easier way to do this in the future, but for now it’s the only way to add new extensions to existing sugars.

 Signature 

Ian Beck
MacRabbit Support

Follow us on Twitter, or try my custom themes: Quiet Light & Earthworm

Profile
 
 
Posted: 18 February 2010 12:01 PM   [ Ignore ]   [ # 11 ]
Newbie
Rank
Total Posts:  5
Joined  2010-02-13

Thanks Ian, worked like a charm.

Profile
 
 
Posted: 06 March 2010 03:26 AM   [ Ignore ]   [ # 12 ]
Newbie
Rank
Total Posts:  1
Joined  2010-03-06

I just found LESS as well, and was looking for a sugar for it. However, it’s safe to say I have no idea where to start. I spent the requisite few hours squinting very hard at the examples and existing CSS sugar, but it didn’t help.

I’m currently using the override to treat .less files as CSS, but it brings a few aesthetic issues. The major one occurs with variables in the source list—Espresso thinks everything between a } and { that’s not a comment is part of the next selector. I’m hiding that mess away in a folder with ”.clear {}” at the bottom to keep it from flowing into the first actual selector, but I’d like to have them be usable. What would I need to edit to get Espresso to recognize a semicolon as an indicator of the end of an item?

The other issue is more minor and has to do with nested items. They simply show up in the same color as the attributes, rather than the selectors. I don’t know where to change this either.

Thanks for the help.

Profile
 
 
Posted: 08 March 2010 01:19 PM   [ Ignore ]   [ # 13 ]
Newbie
Rank
Total Posts:  9
Joined  2010-02-10

I’ve got a sort of working LESS sugar. It doesn’t like nested selectors at the moment, but mixins and variables are ok. Feel free to fork it and improve because I probably won’t be spending much more time on it.

http://github.com/hawx/LESS.sugar

Profile
 
 
Posted: 06 May 2010 04:18 AM   [ Ignore ]   [ # 14 ]
Member
RankRankRank
Total Posts:  51
Joined  2009-04-16

Would anyone care to wrap this one up? :)

(I wouldn’t ask if I hadn’t tried it myself first)

 Signature 

Marco Jardim
Homepage: jard.im

Profile
 
 
Posted: 06 May 2010 11:43 AM   [ Ignore ]   [ # 15 ]
Newbie
Rank
Total Posts:  1
Joined  2010-05-06

I took a crack at it too… nested selector support would be awesome :)

Profile
 
 
   
1 of 2
1
 
‹‹ Understanding text actions      SASS Sugar ››