-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Feat: Add a custom icon #17241
Feat: Add a custom icon #17241
Conversation
Thank you very much @KacperFKorban for the feedback. Just added the corrections that you sent to me, now I'm looking for a better dynamic src for the images. |
One more thing to think about here after speaking with you @Dedelweiss about this today. Keep in mind that with the solution that you outlined it will only work for 1 custom icon. So if the user wants two, then it falls apart. I think whatever solution we come up with it should allow for X amount of custom icons/links. Like the number shouldn't matter. |
After checking, the functionality already allows the addition of several custom links/logos. But I haven't found a way to associate this with a url in the css file path. Do you have any examples that I can use to guide me @Florian3k ? Thank you very much |
I'm not a CSS expert, but maybe it's possible to do something like this: .icon-button.custom::after {
content: attr(data-custom-icon url);
} And in the renderer add this <button data-custom-icon="../../../../path/to/image.svg"> This could possibly be extended for more attributes for dark icon etc. |
I just realised that support for this is practically nonexistent: https://caniuse.com/mdn-css_types_attr_type-or-unit_url |
Thank you @Florian3k, I will look at it too, see if it's possible to do something different. |
- Add setting "custom" - Possible white icon with||without dark icon - Improve tap target
- Change SocialLinks and do a match case - Rephrase ScaladocSetting for custom
d694e04
to
27b0f60
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few nits
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one nit on adding a test, but other than that this should be good to go.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me! Thanks @Dedelweiss!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good now, one last nitpick from me.
Thank you @Dedelweiss!! 🙌🏻 |
Backports #17241 to the LTS branch. PR submitted by the release tooling. [skip ci]
In this PR, I'm adding the new custom icons feature. This allows users to add one or more custom icons (in png or svg format).
Code:
IE:
Dark icon is optional so you can just put:
"-social-links:custom::https://joyofcoding.org/sponsoring.html::joycoding.png,custom::lucasleblanc.com::lucasLogo.svg,github::https://github.com/Dedelweiss"
Result:
I think a next Issue/PR will be needed to improve the tap target of the footer's icons.
Fixes: #16856