node-cssjanus icon indicating copy to clipboard operation
node-cssjanus copied to clipboard

Inconsistent flipping behavior breaks custom CSS properties

Open HumansCanWinElves opened this issue 4 years ago • 0 comments

When the word "right" or "left" is used as part of the name of a custom CSS property, the name is flipped by CSSJanus when the property is assigned, but not when the property is used, those breaking it's functionality.

Example input:

body.theme-dark {
    --right-rail-bg: blue;
}

.right-rail {
    background: var(--right-rail-bg);
}

CSSJanus output:

body.theme-dark {
    --left-rail-bg: blue;
}

.right-rail {
    background: var(--right-rail-bg); /* invalid */
}

It is probably better to not change custom property names at all, but it should at least be consistent.

HumansCanWinElves avatar Dec 09 '21 14:12 HumansCanWinElves