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

Wrong order for generated nested styles #1657

Open
smite107 opened this issue Feb 8, 2024 · 0 comments
Open

Wrong order for generated nested styles #1657

smite107 opened this issue Feb 8, 2024 · 0 comments

Comments

@smite107
Copy link

smite107 commented Feb 8, 2024

Expected behavior:
Order of generated styles is same as in jss styles

Describe the bug:
In some cases for nested styles order of generated styles is REVERSED

Reproduction:
Styles:

export const test = createUseStyles({
  test: {
    '& $first': {
      //
      '&:hover': { color: 'white' },
    },

    '& $second': {
      //
      '&:hover': { color: 'red' },
    },
  },

  first: { color: 'red' },

  second: { color: 'blue' },
});

Generated styles:

<style data-jss="" data-meta="Unthemed">
.test-0-2-931 .second-0-2-933:hover {
  color: red;
}
.test-0-2-931 .first-0-2-932:hover {
  color: white;
}
.first-0-2-932 {
  color: red;
}
.second-0-2-933 {
  color: blue;
}
</style>

Versions (please complete the following information):

  • jss: 10.10.0
  • react-jss: 10.10.0
  • Browser [e.g. chrome, safari]: Chrome 121.0.6167.140 (Last)
  • OS [e.g. Windows, macOS]: Windows 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant