Skip to content

Instantly share code, notes, and snippets.

@hekt
Created October 5, 2012 18:20
Show Gist options
  • Save hekt/3841489 to your computer and use it in GitHub Desktop.
Save hekt/3841489 to your computer and use it in GitHub Desktop.
add vendor prefixes
;; add css vendor prefixes
(defun add-css-vendor-prefixes (start end)
(interactive "r")
(replace-regexp
"\\([\s\t]*\\)\\(\\(?:.\\|\n\\)+;\\)"
"\\1-webkit-\\2\n\\1-moz-\\2\n\\1-ms-\\2\n\\1-o-\\2\n\\&"
nil start end))
(defun add-css-vendor-prefixes-to-value (start end)
(interactive "r")
(replace-regexp
"\\([\s\t]*[a-zA-Z-]+[\s\t]*:[\s\t]*\\)\\(\\(?:.\\|\n\\)+;\\)"
"\\1-webkit-\\2\n\\1-moz-\\2\n\\1-ms-\\2\n\\1-o-\\2\n\\&"
nil start end))
(defun add-css-vendor-prefixes-to-both (start end)
(interactive "r")
(replace-regexp
"\\([\s\t]*\\)\\([a-zA-Z-]+[s\t]*:[\s\t]*\\)\\(\\(?:.\\|\n\\)+;\\)"
"\\1-webkit-\\2-webkit-\\3\n\\1-moz-\\2-moz-\\3\n\\1-ms-\\2-ms-\\3\n\\1-o-\\2-o-\\3\n\\&"
nil start end))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment