Top-rated recipes by Magnus Axelsson http://code.activestate.com/recipes/users/4188509/top/2013-11-20T21:15:22-08:00ActiveState Code RecipesCSS line with px value adds a new line with rem (JavaScript) 2013-11-20T21:15:22-08:00Magnus Axelssonhttp://code.activestate.com/recipes/users/4188509/http://code.activestate.com/recipes/578769-css-line-with-px-value-adds-a-new-line-with-rem/ <p style="color: grey"> JavaScript recipe 578769 by <a href="/recipes/users/4188509/">Magnus Axelsson</a> (<a href="/recipes/tags/convert/">convert</a>, <a href="/recipes/tags/css/">css</a>, <a href="/recipes/tags/komodo/">komodo</a>, <a href="/recipes/tags/macro/">macro</a>). </p> <p>Put your cursor on a CSS line that ends with a value in px (do not select any text). Run the script and it will insert a new line there the px value is converted to a rem value. </p> <p>You need to edit the code to modify your rem base matching the one you use in your own CSS. The default value is 16.</p> <p>Example: font-size: 12px; (run the script with the cursor in this line) font-size: 0.75rem (new line added by script) </p>