stylex icon indicating copy to clipboard operation
stylex copied to clipboard

A good way to write complex css + compose local styles would be nice.

Open pnegahdar opened this issue 1 month ago • 0 comments

Describe the feature request

Right now it seems impossible to use vars within more complex css you might need. I regularly find myself working around limited css selector access.

Would be ergonomically nice if the following things existed:

  1. stylex.props() can take additional classnames and styles to merge them together, though I may have missed something. I wrote a function to do this and found out that breaks things pretty bad. Classname at least should be relative common for selector workaround in importing css modules to supplement.

  2. Perhaps allowing compile time string template css that gets transformed to the right thing. e.g.

const someComplexCss = `
   li:nth-child(4) > p {
         color: ${theme.textHighLight}
    }
`

And someComplexCss becomes a StyleXProp I can use.

pnegahdar avatar May 15 '24 04:05 pnegahdar