Additional Classes?

I created a div and added an additional class of h1-style.

Now I want to add it to the next div. My expectation is that I can start typing h1-style and it would appear in the drop-down, but it is not doing that. It is asking me to create another class. What am I doing wrong? Thanks.

Hello @jtk,

Additional classes can be two things:

  • The main class of another Cwicly block that contains the styling for this particular block

  • Created by the user on the spot and not linked to any particular block or global class (particularly useful for targeting etc.)

In your case, the reason the h1-style cannot be simply added to another block is that as an additional class, it has no block to relate to.

So you would either have to:

  • Rename the original block class to h1-style (and style that block accordingly). Then, on any other block, the h1-style will appear correctly in the additional classes field.

  • Create a global class with the appropriate stylings you want to add.

Hope that clears things out a little :slight_smile:

Thanks. I would love to see a video about the classes. Maybe some use cases and specifically how this system came about and how we manage them. For example, I want to build blocks that I can use within a current website but use best-practices so I can use blocks repeatedly on different sites.

I haven’t seen classes used like this (say on Webflow or Oxygen, etc). Maybe I am overthinking it.

Hi @jtk,

We are definitely planning a video to go over the details of our class system.

I always recommend going for global classes when re-using elements throughout a website, since that will prove to be much easier to maintain throughout time.

Additional classes are extremely useful on a per-page basis, when you want to repeat elements only for that specific page and don’t plan on reusing them somewhere else.

1 Like

Hope that helps until a tutorial is ready.

Thanks @Marius. I just got it right before you posted this. I’m slow.

1 Like

No worries, you are not the only one who gets stuck here, as you explained right, it is a kind of new system.
So the upcoming tutorial is important, also to have a reference if someone is asking for help with it.

I’m interested in how to approach a site with this method. What are best practices now that we are in a component/block environment? Granted, if my CSS was better, this might not be a big question. And I’m not asking you to answer, of course, but this is where I need to get better.

I want to have the option to take a block that I’ve created and use it on other sites. So maybe it is creating a page to build blocks/fragments and then pasting in the generic elements pre-CSS? So many questions.

Again, thanks for the video.

Interesting question.
I don’t have an answer for this yet, since there are a couple of unclear variables of how things get solved/handeled in the future.

For instance:

Copy/paste blocks from one to another site is easy aleady, but the best approach how to handle your classes or class system, for me this depends on various factors which are unclear by now.