Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: Support object literal with multiline keys #474

Open
gaoqiangz opened this issue Dec 10, 2023 · 2 comments
Open

core: Support object literal with multiline keys #474

gaoqiangz opened this issue Dec 10, 2023 · 2 comments
Labels
🐞 bug Something isn't working

Comments

@gaoqiangz
Copy link

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

FYI, following works:

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

@layershifter layershifter changed the title feature: Support object literal with multiline keys core: Support object literal with multiline keys Dec 10, 2023
@layershifter layershifter added the 🐞 bug Something isn't working label Dec 10, 2023
@Shubhdeep12
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants