Refining Your Search
By default, Klassco scans all available classes. However, there may be
instances where you want to focus on specific classes. This guide will
demonstrate how to do so using -f
or --find
.
Class naming conventions vary across methodologies, resulting in a range of
formats such as: menu
, menu__item
, hover:bg-gray-50
, and menu__item--visible
.
Examples
To filter classes without prefixes or infixes:
$ klassco -f none
To filter classes with specific modifiers only:
$ klassco -f "--visible --hidden --disabled --active"
To mix different styles (prefixes and infixes):
$ klassco -f "dark: hover: --visible __item"
To select Tailwind prefixes:
$ klassco -f "dark: hover:"
Even with complex prefixes:
$ klassco -f "dark:md:hover:active:focus"
To simplify the process further, there's no need to provide the correct order. Klassco will figure it out:
$ klassco -f "dark:md:hover:active:focus"
or
$ klassco -f "active:md:dark:active:focus"
or
$ klassco -f "focus:active:dark:md:hover"
etc ...
Conclusion
This guide has demonstrated how to refine your search in Klassco using the
-f
or --find
flags. By specifying your search criteria, you can focus on
specific classes, making your search more efficient and targeted. Whether
you're dealing with simple or complex prefixes, Klassco has the flexibility to
handle your needs.
Next steps
-
Quick Recipes [↗] provides useful examples for your daily workflow.