Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

STYLE_ constants obeyed #15

Closed
jamierumbelow opened this Issue · 18 comments

7 participants

Jamie Rumbelow Aaron Leung Hampton Catlin Mr Ben Griffin Param Dhaliwal Craig Barnes Adeel Mujahid
Jamie Rumbelow

I got all excited about adding different output styles to my libsass binding to discover that only SASS_STYLE_NESTED is working!

Are there still plans to make the other style constants work?

Aaron Leung
Owner

Yes, all the output styles will be implemented. It's currently a low priority compared to other features such as full interpolation and selector inheritance.

Hampton Catlin
Owner
Mr Ben Griffin

We also would like to see compressed!

Aaron Leung
Owner

I'll be getting this feature in by the end of the month!

Aaron Leung
Owner

Added support for compressed output styles. Please give it a try!

Param Dhaliwal

Not working for me. Getting an empty output

Aaron Leung
Owner

Can you provide more details on how you're invoking LibSass? It's been working for us.

Param Dhaliwal

Using SassC
as in
./bin/sassc [input file]

Aaron Leung
Owner

Oh, the SassC command-line tool is still hard-coded to use the nested style (haven't had time to update that yet!). To use the compressed style, you currently have to set the flag in the C interface when invoking LibSass as a library.

Craig Barnes

I'm just working on sassc flag handling now. Is it ok to use getopt or does it need to be Windows friendly?

Aaron Leung
Owner

Hmm ... preferably Windows-friendly, but that's less of a priority than keeping the core library itself portable. So I'd say go ahead and use getopt if it makes things much easier and more robust. Thanks for the help!

Param Dhaliwal

Sorry if i being a bit dense - dont have much experience with C

Changed the sassc.c file line 16 to ctx->options.output_style = SASS_STYLE_COMPRESSED;

Then ran make

Output is now empty

Aaron Leung
Owner

Have you updated the libsass submodule? Try going into the libsass subfolder and run git pull. Then back out and do a make clean and make.

Param Dhaliwal

That did it! Thanks for the help...
Seems to be working well

Aaron Leung
Owner

No problem! And let me know if the styles don't look right!

Param Dhaliwal

Will be testing tomorrow. Ill let you know if there any problems!

Adeel Mujahid

Isn't expanded and nested somewhat redundant?

Supposedly, nested produces the following output:

a > b > c {
    declaration }
    a > b > c > d {
        declaration1;
         declaration2; }

and the expanded is supposed to be:

a > b > c
{
    declaration;
}

a > b > c > d
{
    declaration1;
     declaration2;
}

Then there might be a requirement which begs another kind of nested expansion:

a > b > c
{
    declaration;
}

    a > b > c > d
    {
        declaration1;
        declaration2;
    }

So, wouldn't it make sense to have just two styles: expanded (which is nested-expansion; unobtrusive, well-formatted and nested) and compact (minified flavor)? Perhaps, expanded can be aided by another option --indent, which is the base indentation in case of multi-nesting (normally its 2 or 4).

On a related note, both kind of outputs should get the detailed source maps pinpointing the location for each source-to-source artifacts (exactly how lessc does it), as opposed to the mere hints -- not capturing the details to full extent / depriving consumers of implementing some extraordinary features. See #324.

Hampton Catlin
Owner

We are trying to match the styles produced by the Ruby implementation. I'm going to close this since the issue is actually about the constants, not compatibility with Ruby sass.

Hampton Catlin hcatlin closed this
Tobias Lohse MrLoh referenced this issue in jasonsanjose/brackets-sass
Closed

Filter Function Conflict #48

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.