PageRenderTime 24ms CodeModel.GetById 19ms app.highlight 2ms RepoModel.GetById 2ms app.codeStats 0ms

/AppLanding/js/vendor/lesshat/mixins/skewY/skewY.js

https://gitlab.com/webocalypse/themes
JavaScript | 38 lines | 17 code | 9 blank | 12 comment | 2 complexity | f2bab4a1e741aeb8970c41d54c1c3d89 MD5 | raw file
 1/**
 2 * SkewY mixin
 3 */
 4
 5var skewY = function skewY(value) {
 6  value = value || '0';
 7  var numRegex = /\d/gi;
 8  var numWithoutValue = /(?:\s|^)(\.?\d+\.?\d*)(?![^(]*\)|\w|%|\.)/gi;
 9
10  if (numRegex.test(value)) {
11    value = value.replace(numWithoutValue, function(match) {
12      return match + 'deg';
13    });
14  }
15
16  return value;
17};
18
19/**
20 * Result settings
21 */
22
23skewY.result = {
24  property: 'transform',
25  value: 'skewY({{ result }})',
26};
27
28/**
29 * For which browsers is this mixin specified
30 */
31
32skewY.vendors = ['webkit', 'moz', 'opera', 'ms'];
33
34/**
35 * Export mixin
36 */
37
38module.exports = skewY;