Skip to content

feat: allow comma separated class selectors#1444

Open
m1ga wants to merge 5 commits into
mainfrom
multiClasses
Open

feat: allow comma separated class selectors#1444
m1ga wants to merge 5 commits into
mainfrom
multiClasses

Conversation

@m1ga
Copy link
Copy Markdown
Contributor

@m1ga m1ga commented Apr 12, 2026

This PR will allow the user to have selectors like '.btn, .btn2' (like in HTML)
Need to do some more testing and see if there are no other cases where a comma is allowed in the selector.

<Alloy>
  <Window layout="vertical">
    <Button class="btn">Button 1</Button>
    <Button class="btn2">Button 2</Button>
  </Window>
</Alloy>
'.btn, .btn2': {
  backgroundColor: 'red'
}

'.btn2': {
  color: 'green'
}
Screenshot_20260412-143206

The later style will override the parts of the first so

'.btn, .btn2': {
  backgroundColor: 'red',
  color: 'blue'
}

'.btn2': {
  color: 'green'
}

will only make the first button text color blue.

All tests pass: 2778 specs, 0 failures
two bigger Alloy apps still look fine, so nothing broke in existing styles.

@m1ga m1ga marked this pull request as ready for review May 10, 2026 12:34
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

Successfully merging this pull request may close these issues.

1 participant