I’m using the Tainacan plugin with a custom child theme. I’m trying to change some of the CSS for the collections page and single items pages. For instance, I want to increase the font size for the items on the collection page:
I know the selector I need to modify is .tainacan-cards-container .tainacan-card .metadata-title. Normally I would make the change in my child theme’s CSS file, but it isn’t working. Is it because the stylesheets for this are contained in the plugin folders rather than a theme? And if so, how do I reference that?
So, if your css can’t be added lower than Tainacan’s, I’d suggest you add someting else on the selector so that it has higher specificity. E.g.: .archive .tainacan-cards-container .tainacan-card .metadata-title p[data-v-c20b4860]
Haven’t tried it, tough. It is just how I’d try to make it work. And, if nothing works, you can also try adding “!important” to the css. It is not really a good practice, but sometimes there is no other option.
The [data-v-c20b4860] however should not be a reliable target since it is generated by Vue scoped CSS and that may change after compiling changes. So the !important is safer, while ugly. I would add that you could also increase the font size there in two other ways if you want to avoid !important:
Increasing the font size of the whole items list component using its parent css variable:
Increasing the font size of any parent element that has lesser priority. As the font size there is being defined by a relative unit (em), any changes to an anscestor element will reflect on it. For example: