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

^[n..m] selector ranges insert undesired spaces #2133

Closed
cspotcode opened this issue Mar 3, 2016 · 1 comment · May be fixed by ali8889/plunker-run-plugin#3, dmitriz/fontello#4 or walmartlabs/circus-stylus#5
Labels

Comments

@cspotcode
Copy link
Contributor

Given this stylus:

.s1
  &-s2
    &-s3
      &-s4
        ^[2]
          // first three levels of selectors
          syntax: "^[2]"
        ^[0..2]
          // I expect this to be identical to the above, but it's not
          syntax: "^[0..2]"

I get this output:

.s1-s2-s3 {
  syntax: "^[2]";
}
.s1 -s2 -s3 {
  syntax: "^[0..2]";
}

In #1240 one of the examples uses ranges to insert into the middle of a selector:

.foo
  & .bar
    width: 10px

    ^[0]:hover ^[1..-1]
      width: 20px

However, that example breaks when I make a slight adjustment.

// When mouse is over .foo, .bar-baz should become wider
.foo
  .bar
     border: 1px solid grey
     &-baz
       width: 10px
       ^[-2]:hover ^[-2..-1]
         width: 20px
.foo .bar {
  border: 1px solid #808080;
}
.foo .bar-baz {
  width: 10px;
}
.foo:hover .bar -baz { /* <-- wrong selector */
  width: 20px;
}
@Panya
Copy link
Member

Panya commented Mar 3, 2016

Thanks for the report. I've fixed this bug in the rc-0.54 branch.

@Panya Panya closed this as completed Mar 3, 2016
kizu added a commit that referenced this issue Mar 5, 2016
* dev: (21 commits)
  Fixed History for 0.54.0
  History up
  Evaluate variables in current-media function. Fixes #2128
  Undesired spaces with partial reference selector using ranges. Fixes #2133
  Slightly clarified an issue with combinators at ranges in partial references, re: #2134
  Validate regexp flags for match function
  Fix bug with evaluating default arguments
  Undesired spaces with partial reference selector using ranges. Fixes #2133
  Fixed bug with selectors() function. Closes #2130
  Don't parse empty imports
  Wrong errors with --include-css and --resolve-url used concurrently. Fixes #2125
  misc fixes
  Docs and History up
  SelectorParser: Added initial reference selector
  BIFs: expose "url" function by "embedurl"
  Updated history
  Bump version
  BIFs: Added "index" function
  Updated docs that where merged incorrectly
  added a slice function
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants