Class system thoughts

Hi,

So, to add a bit on the class system…

  1. CREATING/ADDING EXTERNAL CLASSES ON THE FLY

I want to add a custom class (external, with associated custom CSS or not) to a block, so I use the virtual dropdown to create it on the fly.

Once I’ve done that, I thought the class would be available everywhere, like an external class, but it’s not added to the virtual dropdown, so I can’t add it to other blocks, even in the same page, without recreating it by typing it in the virtual dropdown.

So, do I have to add all external classes in the global stylesheet / external classes tab for them to be globally available?

Can’t we create external classes on the fly with virtual dropdown?

Sorry I really have a hard time understanding how external classes can be included in virtual classes, but I might not have practiced enough yet :wink:

(Maybe read this thread to have a bit more context:
How to attach virtual (previously additional) classes to blocks?)

  1. VIRTUAL VS LOCAL

Now, about the virtual class use cases.

It seems to me that if we want to style blocks by choosing a class from another block, thus creating a virtual class, we need to rename this class because its purpose is to group some blocks with the same style, so I would give it with a meaningful name.

So it looks like this class is actually editable like a global class, but only available in the edited post/template, a kind of LOCAL class for me, which makes sense if not used elsewhere.

What are the other use cases?

If it is adding classes from other plugins, then it is external to me, and should be available everywhere, and we shouldn’t have to manually create it everywhere we use it.

Maybe I can’t imagine other use cases myself, so enlighten me please!

So as a conclusion, it seems to me I could use LOCAL / GLOBAL / EXTERNAL class denominations.

  1. DROPDOWN ERGONOMICS

I find it a bit annoying to choose the right dropdown to add global/external class.

Sometimes I need to set a font size or color or any basic stuff via a class, and I’m not sure whether I need a custom external class or global class I created in the current install.

Besides, I find the virtual/external/global distinction very and not very necessary in practice.

It would be so much easier to browse with a single dropdown, especially since Louis separated class types and added folder indicator in the dropdown :wink:

Besides, when typing a class name, we could see if it already exists as global/external, because currently, it is possible to create a global class with the same name as virtual class, and both are added to the block, which is confusing:

image

image

  1. CONCLUSION

Again, I’ve not practiced Cwicly very long so far, but I find it strange to struggle so much for doing such “simple” things as adding classes :wink: This makes me think the ergonomics are not so perfect now.

Of course, please feel free to prove me wrong!!!