-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Link text does not have its defined color but falsely color from button text #51265
Comments
|
|
IMHO removing the "Beta" from the "Site Editor" seems somehow premature, if fundamental things like link color (the link is the core of HTML so to speak) don't work reliably in TT3, which again is the current reference block theme. |
❗️ IMHO this is a real serious CSS / theme / style-engine bug which should get an expedited investigation
1. Attempt to customize link text color while using the default theme style in TT3:
Link.Color.definition.with.default.TT3.style.fails.in.paragraph.but.at.least.works.in.comment.section.mp42. Attempt to customize link text color while using a particular theme style like "Aubergine" in TT3
Link.Color.definition.completely.ignored.if.particular.style.like.TT3.Aubergine.active.mp43. Setting the seeming "offender", the button style, to something else in the hopes to then at least get your desired link text color
Link.Color.definition.workaround.to.correct.the.seeming.offender.fails.too.mp4 |
Twenty Twenty Three contains this in the theme.json:
This block of code styles links that are within the Post Content block differently from those within the rest of the site. Unfortunately there is no UI to modify these links yet, which is why you are understandably frustrated that it isn't possible to change the color of these links. It would be great to add these to the Global Styles interface, so I created an issue for that here: #51272 |
I think this is expected, albeit confusing behaviour so I'm closing for now. We can track in #51272. |
Thanks
In the meantime…Is there a workaround?
If so, by what approach/paradigm does this work?
|
@porg the easiest workaround would be to add this to the theme.json file of the child theme:
Hope that helps. |
Followup questionFrom a UX designer with understanding of CSS and data structures and serialized formats such as JSON to a certain degree, but not too deep. Understanding interplay of
|
@scruffian Tested your PR and reported my results.
|
@scruffian As I had feared I failed miserably with my attempt in {
"$schema": "https://schemas.wp.org/trunk/theme.json",
"version": 2,
"styles": {
"blocks": {
"core/post-content": {
"elements": {
"link": {
"color": {
// Value in parent theme.json
// "text": "var(--wp--preset--color--secondary)" // which is #345C00
// My override attempts in this child theme.json
// "text": "blue"
// "text": "#0000ff"
"text": "var(--wp--preset--color--custom-plain-inline-links)"
}
}
}
},
}
}
}
|
|
To me this incident today (again 6h wasted) was the nail in the coffin of working with a child block theme.
|
@porg sorry for the frustrations you've been having with this, thank you for your persistence. I have created this demo TT3 child theme which I hope might help: https://github.com/scruffian/themes/tree/trunk/twentytwentythreechild For me, this theme shows links in post content as red. |
Description
Pure links in paragraphs, like
<p>Check out <a href="https://wordpress.org">WordPress</a> as your CMS.<p>
falsely are rendered with the color definitions of button text (e.g. dark green), although in the Site Editor the Style for links is set as default (color variable "Contrast" which is black text on white background).CSS specificity / selector bug. Either in Style Engine or TT3 theme.
Screenshots
Reproduction
<a>
element without any extra classes.Expected: I expect the link to have the style which is defined at: Styles → Colors → Link (definitions for Default + Hover)
Actual: Somehow the styles from Button take precedence.
Further observations: Even if I make the colors for Default/Hover links something striking like red/pink, this has no effect.
Environment
The text was updated successfully, but these errors were encountered: