In Kirki, a Class serves as a blueprint for creating objects, defining their structure, and initial style attributes.
On the other hand, a Subclass is a child class that inherits the attributes of its parent class while also having the ability to possess its own unique characteristics.
In Kirki, using Classes and Subclasses helps you manage and reuse styles efficiently across your website.
Whenever you customize the style of an element, Kirki automatically creates a class to hold those style rules, eliminating the need to define them from scratch manually.
A Class is a reusable style group applied to one or more elements. To create a class:
You can also rename the class to something meaningful for easier identification and reuse.
A Subclass builds upon an existing class with additional or overridden styles. It’s ideal for cases where you want to slightly tweak a base design without affecting all instances of the main class.
To create a subclass:
This layered styling approach gives you granular control while maintaining consistency across your site.
Once a subclass is added, the count on the Classes dropdown increases to match.
To edit a class in Kirki:
These changes will instantly apply across all elements using the same class, ensuring consistency throughout your design.
Kirki’s class system allows you to efficiently duplicate and manage styles across multiple elements. Instead of manually recreating styles, you can simply apply existing classes or subclasses to new elements.
To make another element adopt the same style, just apply the same class or subclass used in the original element. However, keep in mind that subclasses must be applied after their parent class – this ensures proper inheritance and styling accuracy.
Let’s walk through a practical example:
You can easily rename, duplicate, or detach a class.
This lets you keep your styling system clean, consistent, and easy to manage.
Once detached, the element will lose its shared styling and stop syncing with other elements using that class. You can then create a new class for it, just like creating a subclass, or simply restyle the element to automatically generate a new class.
You can view a class’s CSS Preview in two ways:
Alternatively, you can also:
Beside the Classes dropdown, you’ll also find the Element States dropdown. It lets you style different states of an element, such as hover, focus, active, and more, helping you create more interactive and responsive experiences.
Learn more about Element States.
Was this page helpful?
Our website uses cookies to improve your browsing experience on our website. By continuing to use this website, you agree to their use. For details, please check our Privacy Policy.