Recommended way to theme up third party icons?

Created on 5 May 2023, over 1 year ago
Updated 27 July 2023, over 1 year ago

Problem/Motivation

I am using Sticky Local Tasks alongside a Bootstrap 3 subtheme.

I have a number of other local tasks that, by default use the modules' icon--shortcuts.svg (the star) but I have been able to override one or two using

...

#sticky-local-tasks__items > ul > li:nth-child(6) i.nav-link__icon {
  background-image: url(/modules/contrib/sticky_local_tasks/assets/img/icon--references.svg);
}

#sticky-local-tasks__items > ul > li:nth-child(7) i.nav-link__icon {
  background-image: url(/modules/contrib/sticky_local_tasks/assets/img/icon--results.svg);
}

But I'm no themer and I'm sure that's not the right way to do it but unlike the standard core (View, Edit, Delete etc.) where the <li> elements which have dedicated classes attached to them such as nav-item__view, nav-item__edit, and nav-item__delete respectively, the extra tab items are all in class nav-item__shortcuts.

All that li:nth-child stuff doesn't seem very robust to me!

What is the best (and proper!) way to add my own icons?

I can easily create new SVGs if I need to.

Thanks

💬 Support request
Status

Fixed

Version

1.0

Component

Miscellaneous

Created by

🇬🇧United Kingdom SirClickALot Somerset

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024