|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
536 bytes
|
| Line | |
|---|
| 1 | "use strict";
|
|---|
| 2 | const pattern = /-(\w|$)/g;
|
|---|
| 3 |
|
|---|
| 4 | const callback = (dashChar, char) => char.toUpperCase();
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 | const camelCaseCSS = property =>
|
|---|
| 9 | {
|
|---|
| 10 | property = property.toLowerCase();
|
|---|
| 11 |
|
|---|
| 12 | // NOTE :: IE8's "styleFloat" is intentionally not supported
|
|---|
| 13 | if (property === "float")
|
|---|
| 14 | {
|
|---|
| 15 | return "cssFloat";
|
|---|
| 16 | }
|
|---|
| 17 | // Microsoft vendor-prefixes are uniquely cased
|
|---|
| 18 | else if (property.startsWith("-ms-"))
|
|---|
| 19 | {
|
|---|
| 20 | return property.substr(1).replace(pattern, callback);
|
|---|
| 21 | }
|
|---|
| 22 | else
|
|---|
| 23 | {
|
|---|
| 24 | return property.replace(pattern, callback);
|
|---|
| 25 | }
|
|---|
| 26 | };
|
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 |
|
|---|
| 30 | module.exports = camelCaseCSS;
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.