griffel icon indicating copy to clipboard operation
griffel copied to clipboard

core: Support object literal with multiline keys

Open gaoqiangz opened this issue 2 years ago • 2 comments

const useStyles = makeStyles({
    root: {
        [`
            & .item:hover,
            & .item-selected
        `]: {
            backgroundColor: '#fff',
        }
    }
});

gaoqiangz avatar Dec 10 '23 05:12 gaoqiangz

FYI, following works:

makeStyles({
  root: {
    [`& .item:hover, & .item-selected`]: {
       backgroundColor: '#fff',
    }
  }
});

layershifter avatar Dec 10 '23 11:12 layershifter

Hey @layershifter how about parsing the slots styles first and as you suggested above, fixing the property by something like this - property.replace(/(\r\n|\n|\r)/gm, " ").replace(/\s+/g, " ").trim()

this will remove the multiline and extra spaces

Shubhdeep12 avatar May 19 '24 03:05 Shubhdeep12