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

Fix: Paragraph: Link colors #10171

Merged
merged 1 commit into from
Sep 26, 2018
Merged

Conversation

jorgefilipecosta
Copy link
Member

Description

If a paragraph block contained a custom text color that color was not applied to hyperlinks inside it.

This PR's fixes that. In order to fix the problem, a new class 'has-text-color' was added to every paragraph that has a custom text color (set using a class or an inline style). The allows us to target paragraphs with a color which until now was not possible.

How has this been tested?

Add the following block:

<!-- wp:paragraph {"textColor":"pale-pink"} -->
<p class="has-text-color has-pale-pink-color">link: <a href="http://www.wordpress.org">WordPress</a></p>
<!-- /wp:paragraph -->

Verify the link appears in pale pink in both the front end and the editor.

Screenshots

Before:

screen shot 2018-09-25 at 18 12 04

After:

screen shot 2018-09-25 at 18 11 47

@jorgefilipecosta jorgefilipecosta added the [Type] Bug An existing feature does not function as intended label Sep 25, 2018
@jorgefilipecosta jorgefilipecosta changed the title Fix: Paragraph: Hyperlink colors Fix: Paragraph: Link colors Sep 25, 2018
Copy link
Member

@mkaz mkaz left a comment

Choose a reason for hiding this comment

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

Looks good, testing with different paragraphs, links, and colors and didn't see an issue.

Implementation looks straight-forward and makes sense. 👍

@Sixtina1990
Copy link

bildschirmfoto 2018-11-12 um 08 47 05

Hello :)

Sorry for asking dumb questions but I tried to copy paste the code up there in my CSS and get the red X/error. Can you explain me which part I need to leave out or where the mistake is? :) I don't understand much of CSS. Thank you all so much in advance.

@Sixtina1990
Copy link

to add to my previous comment. Someone told me to do: "You can adjust this in CSS with the p.has-text-color a selector", but I didn't understand what to do. Apologies for that.

@Sixtina1990
Copy link

Could someone help me explain the exact steps and what I need to copy since I got an error? Much appreciated. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants