CSS to JS Converter / Escaper

  • report
    Click for Disclaimer
    This Custom Built Tool is over a year old (first published about 5 years ago). As such, please keep in mind that some of the information may no longer be accurate, best practice, or a reflection of how I would approach the same thing today.
  • infoFull Custom Built Tool Details
    info_outlineClick for Full Custom Built Tool Details
    Date Posted:
    Jan. 09, 2019
    Last Updated:
    Jan. 09, 2019
  • classTags
    classClick for Tags

In general, you probably want to avoid putting CSS directly into your Javascript. However, there are times when it is unavoidable, or simply not worth the time. I made this tool for myself, for those times when I simply need to paste in a block of CSS into JS code as a string literal, while preserving (or removing) formatting.

Just paste your CSS into the left panel, and then copy the generated JS from the right side.


Leave a Reply

Your email address will not be published.