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

Adds failing test #2134

Closed

Conversation

cspotcode
Copy link
Contributor

Selector references don't always insert spaces when they should, assuming that I'm understanding the spec correctly.

Selectors that don't have any sort of explicit reference (&, ^[], ../, etc) are given an implicit reference like this:

.foo
  // A selector without an explicit reference...
  .bar
  // ... is implicitly prefixed with `& ` (ampersand and space)
  & .bar

I assume that, since a space character is being specified between .bar and .foo, either explicitly or implicitly, it should be inserted into the rendered selector. This doesn't always happen.

kizu added a commit that referenced this pull request Mar 4, 2016
@kizu
Copy link
Member

kizu commented Mar 4, 2016

That's an intended behavior, otherwise it would be rather hard to use those selectors without the space combinator, look at this example:

.foo
  & .bar
    ^[0] a^[-1..-1]
      width: 10px

And inserting a space manually when needed is much simpler than removing it. If there'd be a need to programmatically use the exact subselector, it would still be possible to get the space (or its absence) from the selectors().

@kizu kizu closed this Mar 4, 2016
kizu added a commit that referenced this pull request Mar 5, 2016
kizu added a commit that referenced this pull request 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
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants