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

New line added between each css declaration #523

Closed
tonyjessup opened this issue Sep 11, 2014 · 8 comments
Closed

New line added between each css declaration #523

tonyjessup opened this issue Sep 11, 2014 · 8 comments

Comments

@tonyjessup
Copy link

It seems prettify is adding extra lines to each css declaration in this particular file. Not sure how to fix this so it doesn't add extra lines.

Before:

html,
button,
input,
select,
textarea {
  color: #222;
}

body {
  font-size: 1em;
  line-height: 1.4;
}

After:
Selecting block and using Prettify Code with Node 0.10.31 in ST3 3065 running OSX 10.9.4

html, button, input, select, textarea {

    color: #222;

}

body {

    font-size: 1em;

    line-height: 1.4;

}

Prettify css settings:

    "css": {
        "allowed_file_extensions": ["css", "scss", "sass", "less"],
        "end_with_newline": false,
        "indent_char": " ",
        "indent_size": 4,
        "selector_separator": " ",
        "selector_separator_newline": false
    },
@anouarattn
Copy link

same issue window 7 64bits st 3

image

@bhouszka
Copy link

I have the same issue as you guys. Running OSX 10.8.5

@anouarattn
Copy link

in my case, "preserve_newlines": false, don't work for css if there is blank line at the beginning of the file.
if there is no blank line at the begening of the file "preserve_newlines" work. "max_preserve_newlines": 3,` don't work in any case.
the number of blank line in the begening of the file determine the nb of blank lines in the file after beautify.

@bhouszka
Copy link

I finally found a solution. It is a bit strange but it is working for me. Please make sure you have no empty newlines at the top of the CSS document. It has to start with a code. Then it will be properly formatted.

@avireni
Copy link

avireni commented Sep 25, 2014

bhouszka: Strange but working for me too. Thanks for the tip

@bitwiseman bitwiseman added this to the v1.5.2 milestone Sep 25, 2014
@bitwiseman
Copy link
Member

This is a bug, but I'm glad you found a work around for now.

@tonyjessup
Copy link
Author

@bhouszka yep workaround tip appreciated

@bhouszka
Copy link

Glad I could help. :)

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

5 participants