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

Wrap long labels onto multiple lines to prevent text being cut off #12716

Merged
merged 1 commit into from
Aug 27, 2018
Merged

Wrap long labels onto multiple lines to prevent text being cut off #12716

merged 1 commit into from
Aug 27, 2018

Conversation

calbasi
Copy link
Contributor

@calbasi calbasi commented Aug 22, 2018

Overview

In long labels, a width of 17% hides part of the content... Just changing whitespace wrapping back to normal allows them to show the whole label.

Before

captura_2018-08-22_22-50-52

After

captura_2018-08-25_10-48-48

@civicrm-builder
Copy link

Can one of the admins verify this patch?

@civibot
Copy link

civibot bot commented Aug 22, 2018

(Standard links)

@colemanw
Copy link
Member

@calbasi could you post a screenshot? I wonder about having the text wrap instead.

@civicrm-builder add to whitelist.

@calbasi
Copy link
Contributor Author

calbasi commented Aug 22, 2018

Sure! Here you are... 2 screenshots, one before and the second after my change.

Please, take a closest look at the first grey label... Using actual styles, part of their text is not shown, because text color is white, like background color outside the grey label...

captura_2018-08-22_22-50-52
captura_2018-08-22_22-49-23

@calbasi
Copy link
Contributor Author

calbasi commented Aug 22, 2018

About text wrap, the problem could be the "estrange" html used, where background-color is set in the parent container, what has no text...

Here the html output:

<div class="label"><label>  Which Saudi Reps Level are you applying for
     <span class="crm-marker" title="This field is required.">*</span>
</label></div>

@colemanw
Copy link
Member

I suspect the problem is a css rule setting white-space: nowrap. Try inspecting the element's css styling to see.

@calbasi
Copy link
Contributor Author

calbasi commented Aug 23, 2018

I think it's not an overflow issue... Maybe I'm not explaining properly the issue (I beg your perdon, my English is not the best :-p ).
Ok, I'm attaching a new screenshot that show as overflow content text of child SPAN element is visible if selected, or just if text color and background would have different colors, and not bot white).
The problem is that background color don't apply to child SPAN tag, where text is, but the parent DIV, which has a fixed width (17%).
Here my screenshot, while I'm selecting "not visible" text with the mouse:
captura_2018-08-23_13-17-37

@colemanw
Copy link
Member

colemanw commented Aug 25, 2018

Right but if white-space wasn't set to nowrap then I think the line should break and the label would be 2 lines tall. IMO that's the right fix.

@calbasi
Copy link
Contributor Author

calbasi commented Aug 25, 2018

You are partially right: it's a white-space issue. But the solution is using white-space: normal, like this:

.crm-container .crm-section .label label{
  white-space: normal;
}

The output then is this:
captura_2018-08-25_10-48-48

What about it? If it's fine for you I can change PR with this code.

@colemanw
Copy link
Member

Sounds like I'm entirely right, I said that white-space should not be set to nowrap, and indeed setting it to normal fixes the problem :)

@colemanw
Copy link
Member

@calbasi I'm happy with this change if you are. Last thing to do is to clean up the commits in this PR, e.g. squash them into one commit with a helpful description, like "Wrap long labels onto multiple lines to prevent text being cut off". Do you know how do do that with git?

@calbasi
Copy link
Contributor Author

calbasi commented Aug 25, 2018

Hi @colemanw ,
I'm sorry, you are right with your suggestion :-) I read too quickly your reply :-)
Never mind, I've tried to squash the 2 commits, using your commit message :-) Please, review it.
Thanks in advance

@colemanw colemanw changed the title Minimal correction at civicrm.css Wrap long labels onto multiple lines to prevent text being cut off Aug 27, 2018
@colemanw colemanw merged commit 3801c16 into civicrm:master Aug 27, 2018
@calbasi calbasi deleted the patch-1 branch July 23, 2019 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants