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

Round Cropper #19

Closed
ruthansah opened this issue Sep 4, 2018 · 3 comments
Closed

Round Cropper #19

ruthansah opened this issue Sep 4, 2018 · 3 comments
Labels

Comments

@ruthansah
Copy link

Thank you for this wonderful plugin. Is there a way to configure the cropper to be round rather than square?

@Enlcxx
Copy link
Owner

Enlcxx commented Oct 25, 2018

use css, border-radius: 50%;

@Enlcxx Enlcxx closed this as completed Oct 25, 2018
@sajidgangat
Copy link

sajidgangat commented Jun 25, 2019

Any updates on this? How can I display round cropper instead of the default square? Where should I place border-radius: 50%;?
@Enlcxx @alyleui

@Enlcxx
Copy link
Owner

Enlcxx commented Jun 28, 2019

Hi @sajidgangat sorry for the delay.

Add border-radius: 50%; to the result in your stylesheet, but if you want to edit the cropping area, you can add variables to theme.

e.g.

export class GlobalVariables implements PartialThemeVariables {
  ...
  ...
  imgCropper = {
    root: {
      '& {area}, & {area}::after': {
        borderRadius: '50%'
      }
    }
  };
}

result:

img

Obviously this will not make the result rounded, so do not forget to add the styles to the result.

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

No branches or pull requests

4 participants