mirror of
https://github.com/go-gitea/gitea.git
synced 2026-11-26 10:47:04 -06:00
refactor: replace cropperjs with @github/image-crop-element (#40530)
Replace cropperjs, which was stuck on v1 because v2 was too complex to migrate to, with `@github/image-crop-element`, the cropper GitHub uses (2.3 KB vs 14.5 KB gzipped). A full selection of a square image uploads the original file so animated avatars keep working, any other selection uploads the selected square as PNG. Custom element events are now typed via `HTMLElementEventMap`, removing event casts. <img width="208" height="208" alt="Avatar crop panel with the Gitea logo" src="https://github.com/user-attachments/assets/dbdc2744-592a-45ea-91d2-356c34a0d52b"> Ref: https://github.com/go-gitea/gitea/pull/33827 Assisted-by: Claude Code:claude-opus-5-5
This commit is contained in:
@@ -121,3 +121,7 @@ img.ui.avatar {
|
||||
max-width: 80px;
|
||||
}
|
||||
}
|
||||
|
||||
.cropper-panel image-crop {
|
||||
max-width: 400px;
|
||||
}
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
@import "cropperjs/dist/cropper.css";
|
||||
|
||||
.avatar-file-with-cropper + .cropper-panel .cropper-wrapper {
|
||||
max-width: 400px;
|
||||
max-height: 400px;
|
||||
}
|
||||
@@ -45,7 +45,6 @@
|
||||
@import "./features/imagediff.css";
|
||||
@import "./features/projects.css";
|
||||
@import "./features/expander.css";
|
||||
@import "./features/cropper.css";
|
||||
@import "./features/console.css";
|
||||
@import "./features/captcha.css";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user