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

MBS-12437 / MBS-12438: Limit overflow-wrap even more #2561

Merged
merged 1 commit into from Jun 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion root/components/EntityHeader.js
Expand Up @@ -35,7 +35,7 @@ const EntityHeader = ({
subHeading,
}: Props): React.Element<typeof React.Fragment> => (
<>
<div className={headerClass}>
<div className={'entityheader ' + headerClass}>
Copy link
Member

Choose a reason for hiding this comment

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

any reason url-entity-link is hyphenated but entityheader isn't?

Copy link
Member Author

Choose a reason for hiding this comment

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

Just because we already had non-hyphenated headerClasses here, so it seemed consistent to keep this like that too. But maybe we should hyphenate all...

Copy link
Member

Choose a reason for hiding this comment

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

OK, just wondering. :) No need to fix them here.

{preHeader || null}
<h1>
{heading || <EntityLink entity={entity} />}
Expand Down
4 changes: 2 additions & 2 deletions root/edit/details/EditUrl.js
Expand Up @@ -38,7 +38,7 @@ const EditUrl = ({edit}: Props): React.Element<typeof React.Fragment> => {
<tr>
<th>{addColonText(l('URL'))}</th>
<td className="old">
<a href={uri.old}>
<a className="url-entity-link" href={uri.old}>
<DiffSide
filter={DELETE}
newText={uri.new}
Expand All @@ -47,7 +47,7 @@ const EditUrl = ({edit}: Props): React.Element<typeof React.Fragment> => {
</a>
</td>
<td className="new">
<a href={uri.new}>
<a className="url-entity-link" href={uri.new}>
<DiffSide
filter={INSERT}
newText={uri.new}
Expand Down
9 changes: 8 additions & 1 deletion root/static/scripts/common/components/EntityLink.js
Expand Up @@ -127,7 +127,7 @@ const NoInfoURL = ({allowNew, url}: {+allowNew: boolean, +url: string}) => (
>
{isolateText(url)}
</span>
) : <a href={url}>{url}</a>}
) : <a className="url-entity-link" href={url}>{url}</a>}
{' '}
<DeletedLink
allowNew={allowNew}
Expand All @@ -154,6 +154,7 @@ type EntityLinkProps = {
+subPath?: string,

// ...anchorProps
className?: string,
href?: string,
title?: string,
+target?: '_blank',
Expand Down Expand Up @@ -243,9 +244,15 @@ $ReadOnlyArray<Expand2ReactOutput> | Expand2ReactOutput | null => {
}

anchorProps.href = href;

if (hover) {
anchorProps.title = hover;
}

if (entity.entityType === 'url') {
anchorProps.className = 'url-entity-link';
}

content = disableLink
? (
<span
Expand Down
10 changes: 4 additions & 6 deletions root/static/styles/layout.less
Expand Up @@ -19,7 +19,6 @@ body {
a {
color:@link-default;
text-decoration: none;
overflow-wrap: anywhere;

&:visited {
color:@link-visited;
Expand Down Expand Up @@ -158,11 +157,6 @@ pre code {
margin-right: 16px;
clear: both;

a {
// So menu links don't wrap (TODO: review with responsive header)
overflow-wrap: normal;
}

img.logo {
width: @logo-width;
height: @logo-height;
Expand Down Expand Up @@ -1072,6 +1066,10 @@ div.artwork { position: relative; width: 250px; }
max-height: 125px;
}

.entityheader, .url-entity-link {
overflow-wrap: anywhere;
}

.artwork-image, .artwork-pdf {
position: relative;
display: block;
Expand Down