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

Space before CSS attribute selector improperly trimmed #401

Closed
callmevlad opened this issue Feb 6, 2014 · 0 comments
Closed

Space before CSS attribute selector improperly trimmed #401

callmevlad opened this issue Feb 6, 2014 · 0 comments

Comments

@callmevlad
Copy link

If you run the following code through http://jsbeautifier.org/:

<style>
    html.js [data-custom="123"] {
        opacity: 1.00;
    }
</style>

The resulting CSS is broken:

<style>
    html.js[data-custom="123"] {
        opacity: 1.00;
    }
</style>

The input code has a selector that means:

Select all elements with attribute `data-custom` *inside* of the `html` element

But the output CSS means something completely different:

Select the `html` element *with* a `data-custom` attribute

The space after html.js should be preserved in the output.

One current workaround for this (if you have control over the input CSS) is to add a * selector before the attribute declaration:

<style>
    html.js *[data-custom="123"] {
        opacity: 1.00;
    }
</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

2 participants