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

Preserve CSS comments #54

Open
begriffs opened this issue Dec 20, 2013 · 0 comments
Open

Preserve CSS comments #54

begriffs opened this issue Dec 20, 2013 · 0 comments

Comments

@begriffs
Copy link
Owner

As mentioned in #52, ratiocinator strips all comments. One challenge in preserving them is that selectors are often removed or changed in the output, so comments for individual styles need to be rearranged in the output.

One possible algorithm:

  • For each comment, find its closest selector
  • Add a fake CSS property there, like _comment whose value is the text of the comment
  • Run the ratiocinator algorithm
  • When outputting the resulting styles, look for the _comment property, remove it, and print it as a comment above the style block

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

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

1 participant