Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSS output to expanded/nested rather than 1 line? #64

Open
jezthomp opened this issue Jan 30, 2014 · 2 comments
Open

CSS output to expanded/nested rather than 1 line? #64

jezthomp opened this issue Jan 30, 2014 · 2 comments

Comments

@jezthomp
Copy link

Anyway to edit the css output to something other than one line?

Nested, expanded for example?

@roborourke
Copy link
Owner

@jezthomp thanks for your patience!

The docs for the PHP interface to the lessc class can be found here http://leafo.net/lessphp/docs/#php_interface

So here's an example:

<?php

add_action( 'lessc', function( $lessc ) {
     // make a new formatter (copy of existing one)
     $formatter = new lessc_formatter_classic;
     // set indent char eg spaces or tabs
     $formatter->indentChar = "\t";
     // use the new formatter
     $lessc->setFormatter( $formatter );

     // keep comments
     $lessc->setPreserveComments( true );
} );

?>

If you look in the lessc source there's the original formatter class which you could copy and modify:
https://github.com/leafo/lessphp/blob/master/lessc.inc.php#L3653

I've not actually tested this yet by the way so let me know if it doesn't work!

@jezthomp
Copy link
Author

jezthomp commented Feb 4, 2014

Thank you for taking the time, but i’ve actually posted in the wrong repository.

Will this work for your wp-sass plugin as well, or should i start an issue in there?

Apologies

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

No branches or pull requests

2 participants