Clean up function for classes

If a blocs project gets bigger, you will get more and more custom classes in the class manager, even if an element which has used this class is already deleted. My wish is to integrate a function to clean up the classes. The function should delete all unused classes from the class manager.
Maybe there should be a button at each class, which, when manually activated, tells the function that it is an important class and should not be deleted during clean up, even it is unused. As a standard, this button should not be activated.

Best regards
Michael

4 Likes

It’s already in the works, it’s just super complex so it’s taking a little extra time baking.

12 Likes

Great news !!!

1 Like

It certainly is.

Look forward to this ability as well!

1 Like

@Norm it’s been in the oven for 10 months. Maybe we should set a higher temperature? :slight_smile:

Being a man of compromise, I think some feature is better than no feature and currently we have nothing at all. How about do this… Add a button inside Class Manager that when clicked will delete all Classes that are not used.

In the future, if possible, you could make it automatic. But for now, we really need a way to manually delete those unused classes. Going through each Class one by one is impossible in a large website since Blocs doesn’t tell us if a given Class is used.

I rather agree this needs a solution. Freehand custom classes do delete themselves when no longer in use I gather. For the rest I have found it hugely helpful to apply very specific names with custom classes along the lines of home-page-steve-jobs-quote-h3 for a one off usage or something like global-h1-page-header-top-margin for classes used everywhere.

Nevertheless, I fully recognise this is tricky on larger sites and I wondered about having a numerical notification showing how many times a custom class had been used. This would also focus the user’s attention if they understood that a change would instantly affect 50 items across a site, whereas lesser used custom classes could be deleted or edited more freely. Another thought is that custom classes could have colour IDs applied by the user that indicate how important they are.

1 Like

I agree but also would like the glasses renamed when you copy a page. Then when you change that copy page also the glasses change now of the original page as the glasses have the same name. Or am I the only one who have troubles with this issue

You can always duplicate a class, then rename it and that can be done multiple times if needed, so changes are specific to a particular page or area.

I think what @r_botman might be saying is that it would be nice if Blocs would automatically see we are using an existing Class on an object that is on a page different from the page where the Class was originally created, such that if we make an alteration to that Class (on the other page), Blocs would do something to warn us, such that we won’t inadvertently have that change (which is often page/situation specific) to be blasted across the entire website, wherever that same Class is used.

To avoid this trouble, and the hassle of duplicating and renaming, I just make a new Class. But of course, the number of Classes grows and grows when you do that.

Ultimately, I find myself starting to type a new Class only to stop myself, and then I later find that Class was in fact created but I never used it. Tracking down all those unused Classes to delete them is why I support the feature request of this thread.

I agree it is a problem that only grows with larger project sizes, but I think we need a solution that will cater for diverse ways of working. Adopting the practice of accurate class naming does reduce some stress & confusion, though I’ll add another vote for your idea of being able to delete unused classes.

Something I would like to see is a means of saving custom classes to a central database that could be used in other projects. As a short term aid to make this a little easier I plan to build a page or two filled with frequently used custom classes that are saved inside my draft project used for new projects. When you are building a few new sites every month an ultra efficient workflow becomes vital.

1 Like

@JDW you are right. That is what I mean and for me a big problem as there are many glasses each project and as the contains change each copied page you want to adjust the glasses again but not on the original pages

1 Like

I don’t think I have ever used a freehand class. I do as @Flashman and use specific naming. (well I try to, I am getting more disciplined with it).

If I am planned enough, I will create all the custom classed for a block/bric in the class manager all at the same time, and because of the way css works, I actually often don’t end up applying classes in the side bar at all.

eg.

fp-feature
fp-feature h2
fp-feature p

I am finding this works well for me as a workflow and I can clearly see what the classes are for. Dropping a block and ditching the classes is made easy.

In saying all this a clear unused classes option would be very handy, like in the case above.

They are classes not glasses :wink: :nerd_face:

1 Like

Very often freehand classes are a much faster way of working and they can be renamed like any other.

Probably lol. I just haven’t really embraced it… yet anyway.

Yeah it’s built and ready, its part of the 2020 roadmap For Blocs :+1:

5 Likes

Holy cow! 2020 looks to be a great year! Thank you for the hard work, Norm!

1 Like

How is this new functionality coming Norm? I’m currently working on a project that utilized one of @Eldar’s templates as a starting point, then modifying it for my client. Many sections/blocs were not used and therefore many custom classes are not as well. It would be crazy helpful if there was a way to simply delete all unused classes. Wow, what a time-saver that would be! Warm Regards - Randy

wait almost over.

2 Likes