Explain Command
The explain command helps you understand Tailwind CSS classes and generated output by providing human-readable explanations.
Overview
The explain command breaks down Tailwind utility classes into plain English.
This is useful when:
- Learning Tailwind CSS
- Understanding generated output
- Debugging utility classes
- Exploring unfamiliar styles
Basic syntax:
intentcss explain "<classes>"
intentcss explain "<classes>"
Example:
intentcss explain "flex items-center justify-between"
intentcss explain "flex items-center justify-between"
Output:
flex
Enables flexbox layout.
items-center
Centers items vertically.
justify-between
Places items at opposite ends of the container.
flex
Enables flexbox layout.
items-center
Centers items vertically.
justify-between
Places items at opposite ends of the container.
Why Use Explain?
IntentCSS can generate long utility strings.
Example:
fixed inset-0 flex items-center justify-center w-full max-w-lg p-6 backdrop-blur-md bg-white/30 border border-white/20 rounded-xl shadow-lg
fixed inset-0 flex items-center justify-center w-full max-w-lg p-6 backdrop-blur-md bg-white/30 border border-white/20 rounded-xl shadow-lg
The explain command helps break this into understandable pieces.
intentcss explain "fixed inset-0 flex items-center justify-center"
intentcss explain "fixed inset-0 flex items-center justify-center"
Output:
fixed
Uses fixed positioning.
inset-0
Stretches the element to all viewport edges.
flex
Enables flexbox layout.
items-center
Centers content vertically.
justify-center
Centers content horizontally.
fixed
Uses fixed positioning.
inset-0
Stretches the element to all viewport edges.
flex
Enables flexbox layout.
items-center
Centers content vertically.
justify-center
Centers content horizontally.
Basic Examples
Layout
Input:
intentcss explain "flex flex-col gap-4"
intentcss explain "flex flex-col gap-4"
Output:
flex
Enables flexbox.
flex-col
Stacks children vertically.
gap-4
Adds spacing between children.
flex
Enables flexbox.
flex-col
Stacks children vertically.
gap-4
Adds spacing between children.
Spacing
Input:
intentcss explain "p-6 px-8 py-4"
intentcss explain "p-6 px-8 py-4"
Output:
p-6
Adds padding on all sides.
px-8
Adds horizontal padding.
py-4
Adds vertical padding.
p-6
Adds padding on all sides.
px-8
Adds horizontal padding.
py-4
Adds vertical padding.
Colors
Input:
intentcss explain "bg-blue-600 text-white"
intentcss explain "bg-blue-600 text-white"
Output:
bg-blue-600
Applies a blue background color.
text-white
Sets text color to white.
bg-blue-600
Applies a blue background color.
text-white
Sets text color to white.
Effects
Input:
intentcss explain "shadow-lg rounded-xl"
intentcss explain "shadow-lg rounded-xl"
Output:
shadow-lg
Applies a large shadow.
rounded-xl
Applies extra-large rounded corners.
shadow-lg
Applies a large shadow.
rounded-xl
Applies extra-large rounded corners.
Generated Output Example
Generate:
intentcss generate --prompt "large red button"
intentcss generate --prompt "large red button"
Output:
rounded-lg bg-red-600 px-6 py-3 text-lg text-white hover:bg-red-700
rounded-lg bg-red-600 px-6 py-3 text-lg text-white hover:bg-red-700
Explain:
intentcss explain "rounded-lg bg-red-600 px-6 py-3 text-lg text-white hover:bg-red-700"
intentcss explain "rounded-lg bg-red-600 px-6 py-3 text-lg text-white hover:bg-red-700"
Output:
rounded-lg
Applies large rounded corners.
bg-red-600
Applies a red background.
px-6
Adds horizontal padding.
py-3
Adds vertical padding.
text-lg
Uses a large font size.
text-white
Sets text color to white.
hover:bg-red-700
Uses a darker red background on hover.
rounded-lg
Applies large rounded corners.
bg-red-600
Applies a red background.
px-6
Adds horizontal padding.
py-3
Adds vertical padding.
text-lg
Uses a large font size.
text-white
Sets text color to white.
hover:bg-red-700
Uses a darker red background on hover.
Multiple Classes
The explain command accepts multiple classes in a single string.
Example:
intentcss explain "w-full max-w-md mx-auto"
intentcss explain "w-full max-w-md mx-auto"
Output:
w-full
Uses the full available width.
max-w-md
Limits maximum width.
mx-auto
Centers the element horizontally.
w-full
Uses the full available width.
max-w-md
Limits maximum width.
mx-auto
Centers the element horizontally.
Learning Tailwind
Many developers can use the explain command to learn Tailwind CSS faster.
Example workflow:
intentcss generate --prompt "glass login form"
intentcss generate --prompt "glass login form"
Output:
flex flex-col gap-4 backdrop-blur-md bg-white/30 border border-white/20 rounded-xl shadow-md p-6 space-y-2
flex flex-col gap-4 backdrop-blur-md bg-white/30 border border-white/20 rounded-xl shadow-md p-6 space-y-2
Then:
intentcss explain "flex flex-col gap-4 backdrop-blur-md bg-white/30 border border-white/20 rounded-xl shadow-md p-6"
intentcss explain "flex flex-col gap-4 backdrop-blur-md bg-white/30 border border-white/20 rounded-xl shadow-md p-6"
This provides a detailed breakdown of each utility class.
Current Status
The explain command is currently in active development.
Supported explanations include:
- Layout utilities
- Flexbox utilities
- Spacing utilities
- Sizing utilities
- Color utilities
- Border utilities
- Shadow utilities
- Typography utilities
Support will continue expanding in future releases.
Future Improvements
Planned enhancements include:
- CSS explanation support
- Interactive explanations
- Visual examples
- Utility grouping
- Color previews
- Component-level explanations
Related Commands
Generate styles:
intentcss generate --prompt "glass modal"
intentcss generate --prompt "glass modal"
View help:
intentcss explain --help
intentcss explain --help
View CLI reference:
intentcss --help
intentcss --help
Next Steps
Continue with:
- Architecture
- Testing
- Contributing
- Development Guide