segmentio / ui-box

Blazing Fast React UI Primitive
MIT License
1.07k stars 54 forks source link

Properly attach nested selectors to CSV parent selector #136

Closed brandongregoryscott closed 1 year ago

brandongregoryscott commented 1 year ago

Resolves the issue described in https://github.com/segmentio/evergreen/issues/1622

Essentially, when providing a CSV selector with nested selectors, the nested selectors would only be added once to the end of the parent selector string, whereas we would expect the csv to be expanded and each individual selector has the nested one appended.

<Box
  selectors={{
    '&[aria-current="page"],&[aria-selected="true"]': {
      "&:before": {
        transform: "scaleY(1)",
      },
    },
  }}
/>
-.ub-tfrm_qu4iyp_fiauus[aria-current="page"], .ub-tfrm_qu4iyp_fiauus[aria-selected="true"]:before {
+.ub-tfrm_qu4iyp_fiauus[aria-current="page"]:before, .ub-tfrm_qu4iyp_fiauus[aria-selected="true"]:before {
  transform: scaleY(1);
}