Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Does this support Less? #10

Closed
hallodom opened this issue Apr 9, 2013 · 24 comments
Closed

Does this support Less? #10

hallodom opened this issue Apr 9, 2013 · 24 comments

Comments

@hallodom
Copy link

hallodom commented Apr 9, 2013

No description provided.

@zmoazeni
Copy link
Owner

zmoazeni commented Apr 9, 2013

@hallodom csscss doesn't currently support less. I'm not sure if it will. Less depends on node.js and I don't have a great idea on how to resolve that dependency chain. Sass was an easy win since that was already in ruby.

Hopefully running against the css result will be good enough. It will also download the css from http if that helps.

That said, I'd welcome some pull requests or ideas on how to add less support without it becoming an installation or maintenance burden.

@hallodom
Copy link
Author

hallodom commented Apr 9, 2013

Hey thanks for the response. Shame it doesn't support less, a lot of tools are missing around Less like this. If I had more experience with node I'd be sure to give it a go but unfortunately have only briefly played with it.

Great tool though! Still helps on the outputted css but doesn't have much luck on minified CSS files where all selectors are on one line, get the following error:

Had a problem parsing the css at line: 1, column: 1
Run with CSSCSS_DEBUG=true for verbose parser errors

@hallodom
Copy link
Author

hallodom commented Apr 9, 2013

^ Actually just tried it on another single line minified css file and it worked :/ must be something up with my CSS!

@zmoazeni
Copy link
Owner

zmoazeni commented Apr 9, 2013

@hallodom it could still be a bug in the parser. If it is good in a validator please send me a snippet that csscss breaks on so I can fix it.

@hallodom
Copy link
Author

hallodom commented Apr 9, 2013

@hallodom
Copy link
Author

hallodom commented Apr 9, 2013

Sorry I can't be of much more help

@zmoazeni
Copy link
Owner

zmoazeni commented Apr 9, 2013

Looks like the issue is with css expressions.

.icon-glass{*zoom:expression(this.runtimeStyle['zoom'] = '1',this.innerHTML = ' ')}

This is the first I've seen css expressions. Sounds like they were only available in IE versions up to 8, so I won't extend the parser for them.

@hallodom
Copy link
Author

hallodom commented Apr 9, 2013

Cool, that's from Font Awesome stuff.

http://fortawesome.github.io/Font-Awesome/#icon/icon-glass

@hallodom
Copy link
Author

hallodom commented Apr 9, 2013

Thanks for taking a look!

@Mte90
Copy link

Mte90 commented Apr 9, 2013

i have see this http://rubygems.org/gems/less can be help for resolve this issues?

@zmoazeni
Copy link
Owner

zmoazeni commented Apr 9, 2013

@Mte90 Oh thanks. I didn't see that. Perhaps I can use it in the same way I'm using sass and compass. Thanks for pointing it out!

@tobiastom
Copy link

+1 for less support.

@eddievlagea
Copy link

IMHO it's better to run it against the final CSS file. I have 14 different .less files in the project that I'm currently working on and running csscss against them would be such a hassle.

@hallodom
Copy link
Author

I assumed that csscss would be smart enough to figure out the imports and tell you what duplicates are in which less files?? Haven't tried it with Sass so not sure if it works this way.

@zmoazeni
Copy link
Owner

@creativityhurts @hallodom I'll experiment with hitting the LESS preprocessor first. In theory you should be able to pass csscss multiple files but I think I found an issue with that in #16

@tobiastom
Copy link

@creativityhurts With the final result you would again have the problem that sourcemaps try to solve. You get an error in a file, but do not know which file (and line) is really references.

@jasonsee
Copy link

+1 LESS support as well.

@zmoazeni
Copy link
Owner

For what it's worth, source maps will also be an issue for displaying line numbers which has been a recurring request.

Is LESS much like SASS in that it translates source files into a 1:1 css file? (ignoring included partials stuff). It might still straightforward to implement, but yeah the line numbers are going to be awkward. Reminds me of debugging a javascript error in the browser and having to flip back to the coffeescript source.

@jasonsee
Copy link

Indeed. And my current workflow is to segment out classes by sections; in other words the same class might appear three or more times in the same LESS file: In positioning section, typography section and presentation section. I could see how line number references would make this more valuable to me. Once the LESS is minified, it compiles all classes and mixins - making the line numbering obsolete.

@mekka
Copy link

mekka commented Apr 14, 2013

I just added LESS support and sent Zach a pull request. Feel free to give it a whirl. It would be great to get some some real world testing to know if this works for you guys.

  • cheers

zmoazeni added a commit that referenced this issue Apr 14, 2013
This support behaves very similar to the SASS support. It will attempt
to compile the css prior to checking for redundancies.

For c-versions of ruby, therubyracer is required. For jruby,
therubyrhino.

More information can be found at http://lesscss.org/

refs: #52, #10
@zmoazeni
Copy link
Owner

All set in master and will go out in the next release. Thanks @mekka!

@zmoazeni
Copy link
Owner

Released in v1.2.0

@hallodom
Copy link
Author

Awesome thanks @mekka!

@tobiastom
Copy link

Thank you. I'll try it as soon as possible.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants