Deleting and renaming classes without routine

Hello!
Could you give the user the possibility to customize the logic of deleting and renaming classes in html and css?
At the moment when a class is irrevocably deleted from the css panel, the class name remains in html, and I would like that when a class is irrevocably deleted in the css panel - this class is deleted everywhere in html (everywhere where there is a mention of this class). I would also like that when changing the name of a class, the name would be changed everywhere in html, not just in the css panel.

This would speed up and simplify things a lot, taking away some of the chore from the user. Right now, unfortunately, I have to avoid deleting and renaming classes.
Thanks for your attention :slight_smile:

Welcome @Eern

A tool for finding abandoned CSS Classes would be helpful.
For now i would use Search&Replace whenever i remove a Class form CSS.

Some CSS Classes might be needed for JS or get styling from external CSS (for example if you create WordPress Themes / Blocks). So a fully automated removal of CSS classes would not be a feasible solution.

1 Like

Hi @MichelyWeb Thanks for the suggestion.
A good solution to our problem might be to choose between irrevocably deleting the class in css and all its references in html, or deleting only in css. But why did the developers decide to leave everything in its current state?

Dear @creer,

Since 2014, we read and discuss EACH of the requests we receive here (and in our support inbox), but indeed, some may never meet the qualifications.

While we’d like to claim complete thoroughness, Pinegrow should be viewed as a tool in your arsenal rather than the solution to ALL your web-development needs.

We’ve already discussed the risks associated with this type of automation, and at Pinegrow, the longevity of your content is one of our main concerns. We’re sorry, but as of now, we haven’t found a practical and reliable solution that allows for such feature/automation.

Here’s a list - that isn’t mine - but highlights the drawbacks of automating this kind of process :

  1. Unintended Removals: Automated tools might inadvertently remove classes that are still needed. For instance, if you have a class named ‘button’ in one CSS file that you want to remove, but it’s also used in another CSS file or framework, an automated tool might remove all instances, breaking your design.
  2. Dynamic Class Applications: Many modern web applications use JavaScript to dynamically add or remove classes. Automated tools might not account for these dynamic changes, potentially leading to unexpected behavior in your application.
  3. Specificity Issues: Removing a class could alter the specificity of your CSS selectors, potentially changing how styles are applied to elements. This could lead to subtle visual inconsistencies that are hard to track down.
  4. Performance Impact: While cleaning up unused CSS can improve performance, the process of scanning and modifying multiple files can be resource-intensive, especially for large projects.
  5. Version Control Complications: Automated large-scale changes can make code reviews more challenging and potentially complicate merge processes in version control systems.
  6. Context Loss: Automated tools lack the human understanding of design intent. A class that appears unused might be kept for future use or consistency across different pages.
  7. Framework Compatibility: If you’re using CSS frameworks like Bootstrap or Tailwind, automated removal tools might not fully understand the framework’s class structure, potentially removing essential classes.
  8. Maintenance Overhead: Setting up and maintaining automated tools requires time and expertise. The effort needed to keep these tools updated and functioning correctly should be weighed against the benefits.
  9. False Sense of Security: Relying too heavily on automated tools might lead to less careful manual code review, potentially allowing other issues to slip through.

@Emmanuel Thank you very much for your detailed answer.

I am not a developer and I come from the world of no-code platforms, also I don’t know anything about the peculiarities of developing such complex applications as Pinegrow.
I can only compare Pinegrow with other visual editors and give my opinion.

My suggestion in the post (link) was not to change the logic of working with selectors towards automation, but to provide a choice.
Why not let the user customize Pinegrow by himself using the menu you see on the screenshot?
removeClass
rename Class

This is just my fantasies, I’m not a UX/UI designer, I can’t evaluate how usable this would be. But it seems to me that with such a choice, people who create simple and small sites will be able to work faster due to automation, and those who thoughtfully develop complex projects will also get a choice in selector management to optimize development.

I don’t know how difficult it is to develop and maintain such a solution, but it seems to me that many users would love the provision of choice. You can even set up a poll if you want to know what users think.

@Emmanuel

It seems to me that Pinegrow is literally a few steps away from the title of “the solution to all web development needs”, at least for developing themes for wordpress, creating marketing sites without looking at VS code and other code editors.

@creer
Thanks for this mockup.
In fact, It’s not really an issue of UX or “user story,” but rather the implications that come with such a feature.

To keep it short, if you take a look at the list of points I posted earlier, it’s not as simple as it might seem :slight_smile:

@Emmanuel
It looks like it will take me a while to fully understand all the points you cited in your post.
Perhaps my suggestions are ridiculous because I’m not in the context of a problem that you currently can’t solve, since I’m not a techie. Perhaps I should use page builders, and go back to Pinegrow when the “simplified” version I managed to read about on the forum comes out, instead of wasting your time.

If it’s no secret, is the “simplified” version of Pinegrow still in your plans or have you decided to invest your time in another project?

To be honest, you’re in a situation that’s not necessarily the same as other developers. The feature you’re dreaming of—which would also be useful for me at times—can have completely different implications depending on the framework you choose, whether you’re working in a team or not, etc. (see list)… and because we can’t safely and simply cover all use cases, that’s why we don’t currently offer a solution.

If it’s no secret, is the “simplified” version of Pinegrow still in your plans or have you decided to invest your time in another project?

Ah yes, this simplified version is still our own holy grail, but I’ll let @matjaz respond if he wants to.

1 Like

Hey @creer, @travelgasm @Eern @MichelyWeb @Pinegrow_User

Awesome news about that Find & Replace feature you were waiting for! It’s coming in Pinegrow 8.1, and I think it’s actually way cooler than you could have imagined :slight_smile:

You’ll be able to search through your project using tags, classes, attributes, text, or selectors - or mix them all together. Then you can make changes like updating classes, replacing text, or even using AI transformations (if you have an OpenAI/Anthropic subscription). Plus, you can see and click the elements directly in your page view.

Should be out really soon - can’t wait to hear what you think about it!

Note: A big thank you to everyone who has mentioned this feature recently or in the past; you’ve been a true inspiration!

4 Likes

Sounds great! Thanks!

@ me :thinking: , I don’t believe I’ve ever directly weighed in on the “Search and Replace” / “Find and Replace” desires of users over the years. This approach looks quite promising and encompassing so I hope it will meet most the historical requirements and desires of users. Maybe it will also enable you to remove this verbiage from the Pinegrow Faqs page. Congrats!

Please @ me when Theme Convertor is updated, Thanks.

1 Like

@Pinegrow_User

Great! You’ll be happy to know that your suggestion has been taken into account and the changes should appear soon on the FAQ.

However, we won’t be removing the previous “verbiage” because there are still many users of the perpetual versions who haven’t updated and don’t plan to do so anytime soon.
So we’re addressing the question for both BEFORE and AFTER 8.1 :wink: QED

Regarding Theme Converter, which isn’t relevant to this topic, don’t worry—I’ll make sure to contact you personally when an update is available.

3 Likes

Valid point regarding the need for versioning verbiage, a milestone to finally state that addition there.

I did a quick test of the update and liked everything. Thank you very much!
Only I wasn’t able to mass rename an existing class :thinking: , but that’s minor things, overall Find & Replace looks awesome :slight_smile:

This should work, are you able to share a video recording?

Did you select Project for the action to run on?