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

Option to keep new line between selectors in SASS #180

Closed
thethreeonee opened this issue Jan 7, 2015 · 10 comments
Closed

Option to keep new line between selectors in SASS #180

thethreeonee opened this issue Jan 7, 2015 · 10 comments

Comments

@thethreeonee
Copy link

Hi,

I just want to know if there is an option to keep new line between selectors in sass files.
Like below:

.a {
  color: #fff;

  .b {
    color: #999;
  }
}

not

.a {
  color: #fff;
  .b {
    color: #999;
  }
}
@Glavin001 Glavin001 self-assigned this Jan 7, 2015
@Glavin001 Glavin001 added this to the v1.0.0 milestone Jan 7, 2015
@Glavin001
Copy link
Owner

SASS is handled by PrettyDiff.
See https://github.com/Glavin001/atom-beautify/blob/master/lib/language-options.coffee#L424-L426 and https://github.com/Glavin001/atom-beautify/blob/master/lib/langs/less-beautify.coffee

I recommend forwarding this issue over to https://github.com/austincheney/prettydiff and /ccing me or letting me know if there is any progress and if I should update Atom Beautify to support a newer Prettydiff version. Thanks!

@thethreeonee
Copy link
Author

The author of PrettyDiff has added the support of this enhancement minutes ago, and he said he will launch it tomorrow.

May be you can look forward of that.

@quicoto
Copy link

quicoto commented Jan 14, 2015

Here's the change for "preserve empty lines for CSS like languages" from PrettyDiff from 4 days ago: prettydiff/prettydiff@843185f

Is it possible to update beauify with it?

@thethreeonee
Copy link
Author

I don't think this issue has been fixed.

When I have code like:

.a {
  color: #fff;

  .b {
    color: #999;
  }
}

I still get

.a {
  color: #fff;
  .b {
    color: #999;
  }
}

What I really want is:

.a {
  color: #fff;

  .b {
    color: #999;
  }
}

atom beautifer version: 0.22.3

@Glavin001
Copy link
Owner

Can you confirm that Prettydiff's website does work and that this is an Atom Beautify issue?

@thethreeonee
Copy link
Author

I can confirm that. Anything work perfectly on Prettydiff's website.

@Glavin001
Copy link
Owner

I have updated Prettydiff to 0.11.0 with Atom Beautify v0.22.2 ( see commit history https://github.com/Glavin001/atom-beautify/commits/master ).

If updating to v0.22.3 (latest, next release after v0.22.2) still does not work, then I would ask @prettydiff if those changes are supported on the Node.js version of Prettydiff and not just the web browser version.

@prettydiff
Copy link
Collaborator

Actually, I just tested it and it works from the web tool. It requires use of an option preserve. This option supports these values:

  • css
  • js
  • all
  • none

On the webtool a default is set to all. In the node file the default is set to none. I will change the default in the node file to all to match the web tool. I will release this tonight.

@Glavin001
Copy link
Owner

Migrating this issue over to #245 . I am adding support in Atom Beautify for passing the preserve option to Prettydiff.

@Glavin001
Copy link
Owner

Published to v0.22.5

Atom Beautify uses a boolean (true or false) value for preserve_newlines option and will translate to all in Prettydiff. Support is only for LESS/SCSS/SASS (Prettydiff supported languages).

Thank you for your patients.

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

No branches or pull requests

4 participants