aphrodite icon indicating copy to clipboard operation
aphrodite copied to clipboard

Add a public API to return the definition for a style

Open kevinbarabash opened this issue 6 years ago • 3 comments

I was experimenting with Storybook's jsx addon. Here's its output for a component that's passed an aphrodite style as a prop: screen shot 2018-03-08 at 2 45 54 pm

I would like to update the plugin to handle aphrodite styles more gracefully by being display the definition for the rule instead of the aphrodite internals.

Proposed API:

function getStyleDefinition(style) => Object

kevinbarabash avatar Mar 10 '18 06:03 kevinbarabash

To clarify, you would expect this to return the value of the _definition key?

lencioni avatar Mar 15 '18 03:03 lencioni

Yes. But we might change how we store the definition in the future. This might make sense as a separate package inside this repo.

kevinbarabash avatar Mar 15 '18 09:03 kevinbarabash

I think I feel similar to https://github.com/Khan/aphrodite/issues/306#issuecomment-373825834 about this

lencioni avatar Mar 16 '18 19:03 lencioni