Skip to content

Commit

Permalink
feat: add option to define classes by state
Browse files Browse the repository at this point in the history
  • Loading branch information
darlanalves authored May 8, 2024
1 parent fe49eb4 commit 4cdba99
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,14 @@ theme:

# Components
# Create components to reuse common definitions of styles
# This examples generates `btn`, `btn__icon`
# This examples generates `btn`, `btn__icon` and btn:hover
components:
btn:
apply: px-4 py-2 bg-primary-dark hover:bg-gray
apply: px-4 py-2 bg-primary-dark
parts:
icon: mr-4
states:
hover: bg-gray border-white

# Core Plugins
# Explicitly enable Tailwind features using plugins
Expand Down
1 change: 1 addition & 0 deletions server/presets.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ function defineComponent(name, def) {
generateComponentParts(name, def.parts, '__'),
generateComponentParts(name, def.modifiers, '--'),
generateComponentParts(name, def.variants, '-'),
generateComponentParts(name, def.states, ':'),
]
.flat()
.join('');
Expand Down

0 comments on commit 4cdba99

Please sign in to comment.