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

Extra space after pseudo-elements within :not() #618

Closed
jessefisher opened this issue Feb 6, 2015 · 12 comments
Closed

Extra space after pseudo-elements within :not() #618

jessefisher opened this issue Feb 6, 2015 · 12 comments

Comments

@jessefisher
Copy link

Beautifying this code:
&:not(:last-child) {}
Results in this:
&:not(: last-child) {}

The extra space causes an error, which tries to identify the line above as an invalid property error.

Thanks for the great extension!

@bitwiseman
Copy link
Member

Is this the same as #557?

@jessefisher
Copy link
Author

If the patch for #557 fixes the space between all colon and pseudo-elements then yes. In this instance the extra space has only occured on :last-child when inside :not().

@bitwiseman
Copy link
Member

Um... is there a patch for #557 that I don't know about?

@jessefisher
Copy link
Author

No, sorry I meant you might be able to fix it with the same solution.

@bitwiseman
Copy link
Member

Okay, good to have another example.

@bitwiseman
Copy link
Member

@jessefisher, This appears to be fixed. On http://jsbeautifier.org/ this remains unchanged:

<style>
    &:not(:last-child) {}
</style>

Can you verify?

@corgrath
Copy link

This is still broken.

This code:

  <style>
      div {
          &:not(:first-of-type) {
              background: red;
          }
      }
  </style>

Results in:

  <style>
      div {
          &:not(: first-of-type) {
              background: red;
          }
      }
  </style>

@brianfryer
Copy link

I am also experiencing this issue.

@maelfrize
Copy link

Same here

@alan-cole
Copy link

Same.

I find if compiling the following:

[type="checkbox"]:not(:checked) {
  background-color: transparent;
}

@mixin hello {
  [type="checkbox"]:not(:checked) {
    background-color: transparent;
  }
}

The output is:

[type="checkbox"]:not(:checked) {
  background-color: transparent;
}

@mixin hello {
  [type="checkbox"]:not(: checked) {
    background-color: transparent;
  }
}

Notice the first :not(:checked) outside the braces works, the second one inside the @mixin{} braces doesn't work.

@hmaesta
Copy link

hmaesta commented Feb 24, 2016

I am facing this bug using brackets-beautify.

@jessefisher
Copy link
Author

Sorry for the delay @bitwiseman I was also having this issue using brackets-beautify, but I don't remember how I ended up posting the issue here instead.

The code below works fine in brackets-beautify now, but on http://jsbeautifier.org/ the code inside div{} still has the issue with the extra space on both lines as @alan-cole has said.

<style>   
    [type="checkbox"]:not(:checked) {
        background-color: transparent;
    }
    div {
        &:not(:last-child) {}
        [type="checkbox"]:not(:checked) {
            background-color: transparent;
        }
    }
</style>

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

7 participants