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

selector_separator_newline adds erroneous newline on @extend SCSS statements #1799

Closed
TomAnthony opened this issue May 17, 2020 · 2 comments
Closed

Comments

@TomAnthony
Copy link
Contributor

Description

The selector_separator_newline option, when set to true, is slightly buggy with SCSS @extend statements, adding a newline when it should not.

Input

The code looked like this before beautification:

	a {
		@extend .color-black, .hover-far-red;
	}

Expected Output

The code should have looked like this after beautification:

	a {
		@extend .color-black, .hover-far-red;
	}

Actual Output

The code actually looked like this after beautification:

	a {
		@extend .color-black,
		.hover-far-red;
	}

The added newline is erroneous.

It works correctly for @import statements with comma delimited entries, and does not add a new line.

Steps to Reproduce

Settings

Example:

{
    "selector_separator_newline": false
}
@damienfa
Copy link

damienfa commented Jul 16, 2021

Same issue everywhere there is a "comma separated list" .

Example with list variable definition in SCSS :

Expected :
$sizes: 40px, 50px, 80px;

Actual wrong output :

$sizes: 40px,
50px,
80px;

Example with maps variable definition in SCSS :

Expected :
$default-margin: (desktop: 24px, tablet: 16px, phone: 16px);

Actual :

$default-margin: (desktop: 24px,
tablet: 16px,
phone: 16px,
);

Example with @each loop :

Expected :

@each $name, $color in $colorsrefs {
    .#{$name}-bg {
        background-color: $color;
    }
}

Actual wrong output :

@each $name,
$color in $colorsrefs {
    .#{$name}-bg {
        background-color: $color;
    }
}

Etc...

@mhnaeem
Copy link
Contributor

mhnaeem commented Apr 10, 2022

@bitwiseman This was fixed in #1800

@bitwiseman bitwiseman modified the milestones: v1.14.0, v1.12.0 Apr 11, 2022
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