Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Unfortunately there are <strong>limitations to what you can use in combination with the ampersand</strong> in selectors - it expects a class name (<code>.</code>), an id (<code>#</code>), a pseudo class (<code>:</code>), or attribute selectors (<code>[]</code>).<br> Other acceptable symbols that can also be combined with <code>&amp;</code> are valid CSS selector combinators <code></code>, <code>&gt;</code>, <code>+</code>, and <code>~</code>.</p> <hr> <h2><strong>Solution for Sass >= 3.3:</strong></h2> <p>You can use <strong>string interpolation</strong> on the ampersand <code>#{&amp;}</code> and then you can concatenate it with any string.<br> However, this way (if you do this in a nested rule) a nested selector still automatically gets the parent selectors attached at the beginning:</p> <pre><code>.parent { #{&amp;}--at-map { ... } } </code></pre> <p>would return:</p> <pre><code>.parent .parent--at-map { ... } </code></pre> <p>But, you can save the contents of the ampersand in a variable and use it outside the parent rule. So in your case something along these lines could work:</p> <pre><code>$last-rule: null; .search-doctors-box { position:relative; z-index:999; margin: 0px; $last-rule: &amp;; } #{$last-rule}--at-map { position: absolute; margin-bottom:10px; top: 0px; left: 415px; width:680px; } </code></pre> <h3><a href="http://sassmeister.com/gist/7909803">DEMO</a></h3> <p>or even better, you could use</p> <h3><code>@at-root</code></h3> <p>with nested concatenated selectors, like so:</p> <pre><code>.search-doctors-box { position:relative; z-index:999; margin: 0px; @at-root #{&amp;}--at-map { position: absolute; margin-bottom:10px; top: 0px; left: 415px; width:680px; } } </code></pre> <p>which will give you the desired output:</p> <h3><a href="http://sassmeister.com/gist/8088994">DEMO</a></h3>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload