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

Open curly brackets on new line produce different output then when in same line as selector #1448

Closed
gligoran opened this issue Aug 16, 2015 · 1 comment

Comments

@gligoran
Copy link

For example, when the open curly brackets are in the same line as the selector:

.md-card {
    .md-info-card-highlight {
        background: red;
        color: blue;

        .ng-md-icon {
            color: green;
        }
    }
}

libSass produces this:

.md-card .md-info-card-highlight {
  background: red;
  color: blue;
}
.md-card .md-info-card-highlight .ng-md-icon {
  color: green;
}

But is you put the curly brackets in their own line:

.md-card
{
    .md-info-card-highlight
    {
        background: red;
        color: blue;

        .ng-md-icon
        {
            color: green;
        }
    }
}

you get this:

.md-card
.md-info-card-highlight {
  background: red;
  color: blue;
}

.md-card
.md-info-card-highlight
.ng-md-icon {
  color: green;
}

I'm not sure how valid this is in CSS, but I feel like both of these should produce the same result and that curly brackets position should not affect compiler result. Also using Sass 3.4.14 compiler both SCSS variations are compiled into the same result, with the whole selector being on the same line. Using output style nested produces similar results.

All these steps are reproduceable in http://sassmeister.com/. Use the gear-button to change compilers.

@xzyfer
Copy link
Contributor

xzyfer commented Aug 17, 2015

Thanks @gligoran you're correct the output should be the same in both case. The output CSS is valid and semantically equivalent so this is a low priority bug for the time being.

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