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

Added a placeholder for not previewable HTML snippet. #8799

Merged
merged 13 commits into from
Jan 18, 2021

Conversation

magda-chrzescian
Copy link
Contributor

@magda-chrzescian magda-chrzescian commented Jan 11, 2021

Suggested merge commit message (convention)

Fix (html-embed): An information should be displayed if the HTML snippet is not previewable. Closes #8435.

@magda-chrzescian
Copy link
Contributor Author

@oleq Sinc it's totally different solution than the one we discussed, I'd like to wait for some initial review before writing the tests.

@magda-chrzescian
Copy link
Contributor Author

The current state is as follows:
- "No preview available" is displayed for all invisible by design elements (scripts, head, comments, elements with display: none).
- Empty container is displayed if renderable, but invisible element is inside (div with 0x0 size, larger div with no background-color). This one may be a poor UX, but this is a rare case and it seems reasonable that if the user adds content that is invisible, he sees nothing.
- Proper information must be added if the snippet is empty,
- The content is displayed properly if an element in the HTML snippet is smaller than the placeholder behind it.

@@ -8,6 +8,8 @@
--ck-html-embed-source-height: 10em;
--ck-html-embed-unfocused-outline-width: 1px;
--ck-html-embed-content-min-height: calc(var(--ck-icon-size) + var(--ck-spacing-standard));

--ck-html-embed-source-disabled-color: hsl(0deg 0% 45%)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This variable is added to be consistent with not merged yet https://github.com/ckeditor/ckeditor5/pull/8818/files, which also fixed the contrast ratio.

@oleq oleq merged commit a35881b into master Jan 18, 2021
@oleq oleq deleted the i/8435-empty-embed-preview branch January 18, 2021 09:40
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

Successfully merging this pull request may close these issues.

Show something when embedding something non-previewable
2 participants