Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: What are the possible interfaces expected for processCss hook and how to use css-modules-require-hook to generate what I want? #84

Open
daniloster opened this issue Feb 26, 2017 · 2 comments

Comments

@daniloster
Copy link

daniloster commented Feb 26, 2017

Hi all,

I am trying to create a processor to transpile css/scss to ReactNative.StyleSheet objects. What I am not understanding is what is expected from a processCss function. Maybe I should use another phase to do what I want. I don't know indeed and that is why I would be pleased to hear from anyone some advice about.

Given the import myClasses from './my-classes.css'; When/where should I interfere to parse the last step before assigning some value to the variable myClasses? I guess, it is the right moment to get my css (string) convert into object and use the ReactNative.StyleSheet.create to generate what I want to consume from myClasses.

Thank you so much in advance

@daniloster daniloster changed the title Question: What are the possible interfaces expected for processCss hook and how use css-modules-require-hook to generate what I want? Question: What are the possible interfaces expected for processCss hook and how to use css-modules-require-hook to generate what I want? Feb 26, 2017
@mightyaleksey
Copy link
Member

Hello,

I'm not quite familiar with ReactNative, but there is an example of its usage in Electron: https://github.com/knpwrs/css-modules-electron/blob/master/src/index.js#L25-L36

Probably, if you have any access to ReactNative.StyleSheet.create in the environment, then you need to transform the resulting css string to the object notation and inject it to the view.

@daniloster
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants