Global Search And Replace
Global Search And Replace
I’m new here and new to CMSMS so I apologize if this has been suggested but I would love to have a global search and replace function. It would be great to search all templates and/or style sheets for #fefefe and replace it with #cecece for example.
Re: Global Search And Replace
A global search and replace would be handy but I think would have to come with a version control for "undo" as well, given the damage it could do. That's a pretty massive undertaking but perhaps a module developer would want to take it on.
In the meantime, that's a great reason to use variables for styles, so you only need to change something in one place. In a stylesheet you would do something like:
then to change everything using #fefefe you'd only need to edit the first line. The scope=global makes it available to your other stylesheets, assuming this is the first one in the list. (There's other ways of doing this, and you can get into using modules and/or content blocks to give your client a simple theme editor, but this is the gist of it)
In the meantime, that's a great reason to use variables for styles, so you only need to change something in one place. In a stylesheet you would do something like:
Code: Select all
[[$mybackground = '#fefefe' scope=global]]
.link {
background-color: [[$mybackground]];
}
.button {
background-color: [[$mybackground]];
}
Not getting the answer you need? CMSMS support options
Re: Global Search And Replace
Although I've never used it myself I'd consider using CSS custom properties for this specific example.
https://developer.mozilla.org/en-US/doc ... properties
https://developer.mozilla.org/en-US/doc ... properties
Re: Global Search And Replace
Thanks for the very helpful replies.