From 470b7477e81fdf5ecf9a261b97944ddb29248791 Mon Sep 17 00:00:00 2001 From: Guillermo Rauch Date: Sat, 16 Jul 2016 11:53:04 -0700 Subject: [PATCH] remove override style utility --- app/lib/utils/override-style.js | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 app/lib/utils/override-style.js diff --git a/app/lib/utils/override-style.js b/app/lib/utils/override-style.js deleted file mode 100644 index a4ed8d8f..00000000 --- a/app/lib/utils/override-style.js +++ /dev/null @@ -1,31 +0,0 @@ -// hack to configure important style attributes -// to work around this madness: -// https://github.com/Khan/aphrodite/pull/41 - -export default function overrideStyle (obj) { - if (obj) { - return function (ref) { - if (ref) { - for (const key in obj) { - if (null != obj[key]) { - const val = 'number' === typeof obj[key] - ? `${obj[key]}px` - : String(obj[key]); - const prop = toProp(key); - ref.style.setProperty(prop, val, 'important'); - } - } - } - }; - } else { - return null; - } -} - -// converts camelCase to camel-case -function toProp (key) { - return key.replace( - /[a-z]([A-Z])/, - (a, b) => a.substr(0, a.length - 1) + '-' + b.toLowerCase() - ); -}