rennat / pynliner

Python CSS-to-inline-styles conversion tool for HTML using BeautifulSoup and cssutils
http://pythonhosted.org/pynliner/
181 stars 93 forks source link

Chained CSS selectors get over-applied #35

Closed craiglabenz closed 9 years ago

craiglabenz commented 10 years ago

CSS of the form selector, selector { style-rules; } do not seem to get applied correctly. See the example below where both <p> tags render orange, instead of just the one living inside the appropriate wrapper class.

This HTML:

<div class="orange-wrapper">
    <p>Orange.</p>
</div>
<div>
    <p>Black.</p>
</div>

Mixed with this CSS:

.orange-wrapper p, .super-orange-wrapper p {
    color:orange;
}

Results in this inlined HTML:

<div class="orange-wrapper">
    <p style="color: orange">Orange.</p>
</div>
<div>
    <p style="color: orange">Black.</p>
</div>