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

Less beautify error with Link style states #53

Closed
nojaf opened this issue Jul 28, 2014 · 4 comments
Closed

Less beautify error with Link style states #53

nojaf opened this issue Jul 28, 2014 · 4 comments

Comments

@nojaf
Copy link

nojaf commented Jul 28, 2014

Hi,

I'm using atom 0.119.0 on Windows to format my less file. Whoever the output isn't exactly better at all. Also there is a bug when using statements as &:hover and &:link

                    a {
                        line-height: @headerHeight;

display: block;
                        padding: 0px 15px;
                        font-size: 16px;
                        button {
                            font-size: 16px;
                        }
                        &:link {
                            color: @white;

text-decoration: none;
                        }
                        &:visited {
                            color: @white;

                        }
                        &:hover {
                            color: @orange;

                        }
                        &.green {
                            color: @green;

&:hover {
                                color: @white;

background-color: @green;

                            }
                        }

&:hover and &:link become &:(space)hover and &:(space)link. Which doesn't compile anymore.

@Glavin001 Glavin001 added the bug label Jul 28, 2014
@Glavin001
Copy link
Owner

Currently LESS is being beautified by the CSS beautifier of js-beautify.

See

case 'Sass':
case 'SCSS':
case 'LESS':
case 'CSS':
text = beautifyCSS(text, self.getOptions('css', allOptions));
beautifyCompleted(text);
break;

You should forward this issue over to the js-beautify project, and see what they say. There may be problems handling LESS, or in a much more fortunate case, may be a setting that provides better LESS support and resolves your issue. If it is a setting and Atom Beautify is restricting this, let me know and I can reopen this and make the necessary adjustments to optimize js-beautify for LESS.

Hope we can find a solution for you!

@Glavin001
Copy link
Owner

It Pretty-Diff has been recommended by a contributor of LESS.js and switching Atom Beautify to prettydiff may resolve some LESS issues we have been having.

Could you try out http://prettydiff.com/ and let me know how well it works for you? If it works significantly better than js-beautify then we could migrate over in the future :).

/cc @mcdonnelldean

@mcdonnelldean
Copy link

@Glavin001 I tested Pretty-Diff using the sample LESS from my issue. The formatting looks perfect, I have also tested the sample from above and it looks good too.

@import "syntax-variables";
.editor-colors {
    background-color: @syntax-background-color;
    color: @syntax-text-color;
}
.editor {
    background-color: @syntax-background-color;
    color: @syntax-text-color;
    .wrap-guide {
        background-color: @syntax-wrap-guide-color;
    }
    .indent-guide {
        color: @syntax-indent-guide-color;
    }
    .invisible-character {
        color: @syntax-invisible-character-color;
    }
    .gutter {
        background-color: @syntax-gutter-background-color;
        color: @syntax-gutter-text-color;
        .line-number {
            &.cursor-line {
                background-color: @syntax-gutter-background-color-selected;
                color: @syntax-gutter-text-color-selected;
            }
            &.cursor-line-no-selection {
                color: @syntax-gutter-text-color-selected;
            }
        }
    }
}
a {
    display: block;
    font-size: 16px;
    line-height: @headerHeight;
    padding: 0px 15px;
    button {
        font-size: 16px;
    }
    &:link {
        color: @white;
        text-decoration: none;
    }
    &:visited {
        color: @white;
    }
    &:hover {
        color: @orange;
    }
    &.green {
        color: @green;
        &:hover {
            background-color: @green;
            color: @white;
        }
    }

@Glavin001
Copy link
Owner

Excellent news! Thank you, @mcdonnelldean!

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

3 participants