Copying / Reusing Same style on different elements

Author Posts

balticsamurai

I’ve created box style with shadows and backgrounds and I’d like to use the same style on other elements (say different plugin). What’s the easiest/fastest way to do that? It seems manually re-doing all the styling over and over again is like a lot of redundant work. Thank you.


Sebastian

Hey,

If you want to apply the same styling to different elements that aren’t related I recommend creating a selector called “Shadow and background” that targets your box, but only includes shadow and background styles – no styles that will apply to the box and nothing else, create a separate “Box” selector for adding those.

Then start to create a selector for the other element in Microthemer, with the advanced targeting options expand. But instead of creating a new selector, copy the selector code from the Targeting suggestions pane and tack it onto the Shadow and background selector using a comma to join the two selectors. You can edit the Shadow and background selector’s code via the selectors menu at the top left of the interface BTW.

So you would change it from this:

.orig-box

To this

.orig-box, .other-box

And you can do this every time you want to apply the background and shadow to a new element:

.orig-box, .other-box, .something-else

The other advantage of this method is that if you ever want to change the shadow or colour you can do this for all elements by making the edits in just one place (on the Shadow and background selector).

This video demonstrates the process: https://screencast-o-matic.com/watch/cbiU6klaX5

And this video shows how to create comma joined selectors when first creating a selector: https://screencast-o-matic.com/watch/cFV224oIkN

I hope that helps, please let me know if you need further assistance.

Thanks,
Sebastian


balticsamurai

Sebastian, as always, you are awesome! Thank you.


Sebastian

You’re welcome 🙂

You must login or register to reply to this topic.