Social Link: Add a class to the anchor element#28494
Conversation
|
Size Change: -397 B (0%) Total Size: 1.37 MB
ℹ️ View Unchanged
|
|
Could you just get at the element using the selector I'm not opposed, just asking for clarification and more so we can think about it for other blocks and pieces we develop, so for example other nav links and markup we are creating, should we include classes at each element or not? |
|
In Spearhead we have a rule like this: This targets social links, and because of its specificity it is stronger than But this feels unnecessarily complex, which is why I am proposing this change instead. |
|
Thanks for the PR. I'm not personally opposed to this, and the use case seems fine. I would defer to @nosolosw, though — is it correct to do something like And in case it's fine, the only change I'd make is to the classname. We had a bit of a false start with social links, calling the individual social link blocks But the |
Right. Social icons are an interesting use case for link colors, I'd say that's something we'd like to do at some point. The link color is still experimental so we'd have to wrangle support for various kind of themes and wouldn't add it to this block just yet. If this works for you, I don't see anything that prevents us to add support for link color later on. |
|
I've updated the class name. This shouldn't have any impact on behaviour, but it should make things easier for us in the future... |
mkaz
left a comment
There was a problem hiding this comment.
Implementation is straight forward and looks like we have agreement.
👍
Description
Adds a class to the anchor elements inside Social Links. This will make it easier to target/exclude these elements when styling themes. Some themes target all
aelements, and we add exceptions for specific blocks. This is easier to do when the anchor itself has a class.How has this been tested?
Tested with Spearhead theme running latest Gutenberg.
Types of changes
New feature (non-breaking change which adds functionality)
Checklist: