xkeshav / color-collector

A vs code extension to collect all color value from a css file and replace every different color value with intuitive variable name.
https://marketplace.visualstudio.com/items?itemName=xkeshav.css-color-collector
Apache License 2.0
4 stars 2 forks source link

property `white-space` or a named color mentioned in attribute selector getting replaced. #6

Closed xkeshav closed 1 year ago

xkeshav commented 1 year ago

initial css file


body { white-space: normal; color: black;}
.link[data-color=white] { color: white}

changed after collect colors command

/* following :root block added by css color collector */
:root {
    --body__defaultElement--1: white;
    --body__txt--2: black;
}
body { 
    var(--body__defaultElement--1)-space: normal; 
    color:var(--body__txt--2);
}
.link[data-color=var(--body__defaultElement--1)] { 
    color: var(--body__defaultElement--1)
}

which is incorrect

xkeshav commented 1 year ago

issue fixed and in the latest v1.1.0