johanholmerin / style9

CSS-in-JS compiler inspired by Meta's stylex
MIT License
570 stars 27 forks source link

Add support for pseudo selectors and media queries #1

Closed johanholmerin closed 4 years ago

johanholmerin commented 4 years ago

Example from Facebook Workplace:

{
  focused: {
    outline: "2px solid Highlight",
    "@media (-webkit-min-device-pixel-ratio: 0)": {
        outline: "5px auto -webkit-focus-ring-color"
    }
  },
  unfocused: {
    outline: "none"
  }
}

{
  typeaheadLayoutOpened: {
    borderBottomEndRadius: "8px",
    borderBottomStartRadius: "8px",
    "::before": {
      borderBottomEndRadius: "8px",
      borderBottomStartRadius: "8px"
    }
  }
}
CanRau commented 4 years ago

👍 Something like customizable named keys would be cool as well like fela-plugin-named-keys

Edit: Uh-huh it might be due to nesting probably not yet being supported correct? Oh and just realized you're the author of the library and not only of this issue haha 😅 Any ETA? May I somehow help? Though I'm pretty new to babel plugins 🤷‍♂️

johanholmerin commented 4 years ago

Yes, this issue was about adding support for nesting, which is implemented in 0.5.0.