-
-
Notifications
You must be signed in to change notification settings - Fork 167
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
Add styling props #16
Conversation
In order to use those props, you need to pass a style object right? What I had in mind was more something like
This would be simpler to integrate with any styling solution, CSS-in-JSS or not. |
I don't use classes. In fact I'm using react-native-web so I wouldn't be able to pass a class or a className. But either way, that could be added as well so you could either pass a class or a style and it will work in both cases What do you think? |
I understand. On the same idea as the one I suggested with classes, could you group all of them under a Also could you please update the ReadMe so other people know how to use this new feature 🙂 |
I haven't really used emotion or styled-components so what would be the best way to merge the classes with the default styles in this case? I guess it would be just passing the className to each element, right? |
Yes exactly. :) In the same way you added |
src/index.js
Outdated
@@ -268,6 +270,7 @@ class Cropper extends React.Component { | |||
transform: `translate(${x}px, ${y}px) scale(${zoom})`, | |||
}} | |||
imageStyle={imageStyle} | |||
className={cropAreaClassName} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should be imageClassName
here 😄
src/index.js
Outdated
@@ -279,6 +282,7 @@ class Cropper extends React.Component { | |||
}} | |||
data-testid="cropper" | |||
cropAreaStyle={cropAreaStyle} | |||
className={imageClassName} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opposite here: should be cropAreaClassName
Co-Authored-By: tafelito <tafelito@gmail.com>
Co-Authored-By: tafelito <tafelito@gmail.com>
Thanks for this PR and the adjustements while I was a bit slow to answer 👍 |
@ValentinH, when do you think you'll publish a new version? |
I would like to group this PR for the release: #18 If it's too long, I'll publish tomorrow :) |
This PR adds styling props to the container, cropping area and image
close #15