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

Captions with hyperlinks have a dark colour that's not compatible with the black captions banner - Twenty Twenty One theme #6734

Closed
jamesozzie opened this issue Nov 22, 2021 · 7 comments · Fixed by #6907
Labels
Bug Something isn't working Changelogged Whether the issue/PR has been added to release notes. CSS P1 Medium priority
Milestone

Comments

@jamesozzie
Copy link
Collaborator

Bug Description

When there is a caption with a hyperlink in a gallery block this hyperlink is unreadable when it's displayed as a carousel on AMP URLs. This is only applicable for the Twenty Twenty One theme and was identified by one user in the support forums.

Recording of this experience.

Gif of experience below:

2021-11-22-16-12-19

This is not an issue with the Twenty Twenty or Twenty Nineteen themes, with the hyperlink font color white and underlined. The same approach would be suitable for Twenty Twenty One.

Expected Behaviour

The figcaption color should be more readable.

The below CSS rule works as a temporary solution:

figcaption.amp-wp-gallery-caption a {
    color: #fff;
}

Screenshots

No response

PHP Version

No response

Plugin Version

2.2.0 Alpha

AMP plugin template mode

Standard

WordPress Version

5.8

Site Health

No response

Gutenberg Version

No response

OS(s) Affected

No response

Browser(s) Affected

No response

Device(s) Affected

No response

Acceptance Criteria

No response

Implementation Brief

No response

QA Testing Instructions

No response

Demo

No response

Changelog Entry

No response

@jamesozzie jamesozzie added the Bug Something isn't working label Nov 22, 2021
@westonruter
Copy link
Member

The .amp-wp-gallery-caption currently has this white color alread:

amp-carousel .amp-wp-gallery-caption {
position: absolute;
bottom: 0;
left: 0;
right: 0;
text-align: center;
background-color: rgba(0, 0, 0, 0.5);
color: #fff;
padding: 1rem;
}

So yeah, I think it's just a matter of adding:

amp-carousel .amp-wp-gallery-caption a {
    color: #fff; 
}

@westonruter westonruter added this to the v2.2 milestone Nov 22, 2021
@westonruter westonruter added the P1 Medium priority label Nov 22, 2021
@bartoszgadomski
Copy link
Contributor

I think this is more a Gutenberg stylesheet issue rather than AMP, as the same appears in Block editor:

Twenty Twenty-Two theme (editor)
Screenshot 2021-12-1 at 13 09 28

For Twenty Twenty theme, this issue is resolved in editor only, the same black link text appears on front-end:

Twenty Twentytheme (editor) Twenty Twentytheme (front)
Screenshot 2021-12-1 at 13 22 24Screenshot 2021-12-1 at 13 22 31 Screenshot 2021-12-1 at 13 23 06

I think could suggest adding new CSS property here: https://github.com/WordPress/gutenberg/blob/trunk/packages/block-library/src/gallery/style.scss#L48-L66, something like:

figcaption {
    [...]

    a {
        color: inherit;
    }
}

This should resolve reported bug as well.

@bartoszgadomski
Copy link
Contributor

Gutenberg issue: WordPress/gutenberg#37032
PR with fix: WordPress/gutenberg#37033

@westonruter
Copy link
Member

What about when the gallery has “Display as carousel” enabled?

image

I think that's the issue here. However, it seems that the new carousel is not working with the latest Gallery block in WordPress 5.9-beta (and the latest Gutenberg).

Could you double check that? Try enabling carousel on a Gallery block in WordPress 5.8, and then try doing the same in WordPress 5.9-beta1 (or the latest Gutenberg). Set the gallery to link to the attachment page so that the captions get hyperlinks.

@maitreyie-chavan
Copy link
Collaborator

@delawski please could you take a look at this and see if any further updates need to be made by us?

@delawski
Copy link
Collaborator

@maitreyie-chavan There still was an issue with the caption colors. It's addressed and now waits for a code review (#6907).

@pooja-muchandikar
Copy link

QA Passed ✅

Captions with hyperlinks looks better.
Themes Tested: Twenty Twenty One, Twenty Twenty Two and Twenty Twenty

Twenty Twenty One
2021


Twenty Twenty Two
2022


Twenty Twenty
2020

@westonruter westonruter added the Changelogged Whether the issue/PR has been added to release notes. label Apr 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Changelogged Whether the issue/PR has been added to release notes. CSS P1 Medium priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants