Ryan Tsao
Ryan Tsao
I think supporting `@supports` this makes sense. That said, I think there are a few questions that need to be resolved, mostly around specificity/precedence. For example, what should the text...
Yeah, the object iteration example was mainly to shed light on how the semantics aren't all that clear (in isolation of how it is actually rendered). As you point out,...
I brought this idea in https://github.com/styletron/styletron/issues/334#issuecomment-562692804, but repeated selectors might be an elegant way of handling `@supports`. The basic idea: when iterating through a style object, increment the specificity each...
> If we used this order in plain CSS, the resulting color would be red for both components Yeah, this is option 1 in https://github.com/styletron/styletron/issues/21#issuecomment-481498288, which I'm still open to....
Yeah I was thinking about this; I think we can add some way to have context passed from the react package to the engine and/or vice-versa. The simplest thing I...
Alternatively, `styletron-react` could use try/catch and re-throw errors after calling `React.error`. But this can't be used for warnings, so making this part of the `styletron-engine-atomic` API might be better.
[`React.warn` and `React.error` was reverted and never released](https://github.com/facebook/react/pull/16126/files#diff-5ddbfb03321128deb9f08b4daf40fe11L18), but we can still get access to the stack via ```js React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactDebugCurrentFrame.getStackAddendum() ```
Another edge case is styles containing semicolons. For example, with encoded data URIs such as: ```js const style = { backgroundImage: "url(data:image/gif;base64,R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs=)", }; ``` Failing test: https://github.com/styletron/styletron/pull/308 For what it's...
Because these edge cases are extremely rare, I think perhaps the best option is to add a warning in development if any style values contain a `;` or `}`, indicating...
Yeah, I didn't implement this initially in styletron-utils since it can always be added in later or even done in userland code. I'd be interested in seeing how much overhead...