Permalink
Browse files

Prefix wildcard

  • Loading branch information...
1 parent c8037ad commit f8729b7fb32bdb7246fdef8401a0f43ae02b9d80 @LeaVerou committed Jul 24, 2012
Showing with 14 additions and 2 deletions.
  1. +13 −1 prefixfree.js
  2. +1 −1 prefixfree.min.js
View
@@ -179,7 +179,7 @@ function fix(what, before, after, replacement, css) {
}
var self = window.PrefixFree = {
- prefixCSS: function(css, raw) {
+ prefixCSS: function(css, raw, element) {
var prefix = self.prefix;
css = fix('functions', '(\\s|:|,)', '\\s*\\(', '$1' + prefix + '$2(', css);
@@ -203,6 +203,18 @@ var self = window.PrefixFree = {
// Fix double prefixing
css = css.replace(RegExp('-' + prefix, 'g'), '-');
+ // Prefix wildcard
+ css = css.replace(/-\*-(?=[a-z]+)/gi, self.prefix);
+
+ // Gradient angles hotfix
+ if(false && self.functions.indexOf('linear-gradient')) {
+ // Gradients are supported with a prefix, convert angles to legacy
+ css = css.replace(/(\s|:|,)(repeating-)?linear-gradient\(\s*(-?\d*\.?\d*)deg/ig, function (angle) {
+ console.log(arguments);
+ return angle;
+ });
+ }
+
return css;
},
View
2 prefixfree.min.js 100755 → 100644

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

0 comments on commit f8729b7

Please sign in to comment.