-
Notifications
You must be signed in to change notification settings - Fork 105
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
Fix #494 : block title overflow behaviour #495
base: main
Are you sure you want to change the base?
Conversation
word-break: break-word; | ||
overflow-wrap: break-word; | ||
justify-content: flex-start; |
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.
Hello @Pawankalyan2023 , thank you for your contribution.
How about we use css elipses instead
text-overflow: ellipsis;
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.
This might not be a good choice when we need to showcase the title completely to the user for better understanding.
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.
We can show the whole text on hover :
.truncated {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
<div class="truncated" title="This is a long text that will be truncated, but showed on hover">
This is a long text that will be truncated, but shown on hover
</div>
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.
Another way of doing it :
.ellipsis {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
position: relative; /* Necessary for positioning the pseudo-element */
}
.ellipsis:hover::after {
content: attr(data-full-title); /* Fetch the full text from the `data-full-text` attribute */
position: absolute;
top: 100%; /* Show below the element */
left: 0;
background-color: #fff; /* Optional: Style for visibility */
color: #000;
padding: 5px;
border: 1px solid #ccc;
box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
z-index: 1000;
white-space: nowrap;
}
<div class="ellipsis" data-full-title="This is the full text that will be shown on hover.">
This is the full title that will...
</div>
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.
Hey @marrouchi I made the changes to the code with ellipses , could you please review this
Screen.Recording.2025-01-06.214723.mp4
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.
@marrouchi is this okay ?
Motivation
Fixed Block Title Overflow: Updated the visual editor CSS to ensure overflowed text breaks and wraps within the container, maintaining a clean and responsive layout.
Fixes # 494
Type of change:
Checklist: