-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Not displaying the complete icon for images smaller than 50x50. #9194
Merged
oleq
merged 7 commits into
i/2052-inline-images
from
i/9165-upload-indicator-for-small-images
Mar 15, 2021
Merged
Not displaying the complete icon for images smaller than 50x50. #9194
oleq
merged 7 commits into
i/2052-inline-images
from
i/9165-upload-indicator-for-small-images
Mar 15, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
oleq
reviewed
Mar 12, 2021
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.
Instead of using JS, check out
diff --git a/packages/ckeditor5-theme-lark/theme/ckeditor5-image/imageuploadicon.css b/packages/ckeditor5-theme-lark/theme/ckeditor5-image/imageuploadicon.css
index 5b8eff4006..28e2696e35 100644
--- a/packages/ckeditor5-theme-lark/theme/ckeditor5-image/imageuploadicon.css
+++ b/packages/ckeditor5-theme-lark/theme/ckeditor5-image/imageuploadicon.css
@@ -7,13 +7,12 @@
--ck-color-image-upload-icon: hsl(0, 0%, 100%);
--ck-color-image-upload-icon-background: hsl(120, 100%, 27%);
- --ck-image-upload-icon-size: 20px;
+ --ck-image-upload-icon-size: 20;
--ck-image-upload-icon-width: 2px;
+ --ck-image-upload-icon-is-visible: clamp(0px, 100% - 50px, 1px);
}
.ck-image-upload-complete-icon {
- width: var(--ck-image-upload-icon-size);
- height: var(--ck-image-upload-icon-size);
opacity: 0;
background: var(--ck-color-image-upload-icon-background);
animation-name: ck-upload-complete-icon-show, ck-upload-complete-icon-hide;
@@ -21,11 +20,19 @@
animation-duration: 500ms, 500ms;
/* To make animation scalable. */
- font-size: var(--ck-image-upload-icon-size);
+ font-size: calc( 1px * var(--ck-image-upload-icon-size));
/* Hide completed upload icon after 3 seconds. */
animation-delay: 0ms, 3000ms;
+ /*
+ * Use CSS math to similate container queries.
+ * https://css-tricks.com/the-raven-technique-one-step-closer-to-container-queries/#what-about-showing-and-hiding-things
+ */
+ overflow: hidden;
+ width: calc(var(--ck-image-upload-icon-is-visible) * var(--ck-image-upload-icon-size));
+ height: calc(var(--ck-image-upload-icon-is-visible) * var(--ck-image-upload-icon-size));
+
/* This is check icon element made from border-width mixed with animations. */
&::after {
/* Because of border transformation we need to "hard code" left position. */
oleq
reviewed
Mar 15, 2021
packages/ckeditor5-theme-lark/theme/ckeditor5-image/imageuploadicon.css
Outdated
Show resolved
Hide resolved
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Suggested merge commit message (convention)
Fix (image): The image upload success indicator should not be displayed for images smaller than 50x50px. Closes #9165.
Additional information
For example – encountered issues, assumptions you had to make, other affected tickets, etc.