Transition Utilities
NuvoUI provides a set of transition utilities that allow you to easily add movement and animation to your interface components. These utilities make it simple to create smooth state changes and interactive effects.
Configuration
The transition system is built on configurable variables and maps:
Parent Selector
All transition utilities are scoped under the VAR.$parent-selector
which can be configured to change the global selector context:
Utility Class Generation
Transition utility classes are only generated if VAR.$generate-utility-classes
is set to true
:
Timing Functions
The system uses a set of predefined timing functions:
Durations
Duration values define how long transitions take:
Delays
Delay values control when transitions start:
Breakpoints
Responsive variants are generated based on the breakpoints defined in VAR.$breakpoints
:
Basic Usage
Add the base .transition
class to enable transitions for all properties:
Transition Properties
Control which CSS properties will transition:
Transition Durations
Control how long transitions take:
Timing Functions
Control the acceleration curve of transitions:
Transition Delays
Add a delay before transitions start:
Combining Transition Properties
Combine multiple transition properties for complete control:
Responsive Transitions
Apply different transition behaviors at different breakpoints:
Common UI Patterns
Button Hover Effect
Card Elevation on Hover
Hover Cards
Fade-in Content
Menu Item Hover
Scale Transforms
Accordion Expansion
Loading and Spinner Animations
Transition Utilities Reference Table
Transition Property Classes
Class | CSS Property | Description |
---|---|---|
.transition | transition-property: all | Transitions all properties |
.transition-none | transition-property: none | Disables transitions |
.transition-colors | transition-property: color, background-color, ... | Transitions only color properties |
.transition-opacity | transition-property: opacity | Transitions only opacity |
.transition-shadow | transition-property: box-shadow | Transitions only shadow |
.transition-transform | transition-property: transform | Transitions only transform |
Duration Classes
Class | CSS Property | Description |
---|---|---|
.duration-0 | transition-duration: 0ms | Instant transition (no delay) |
.duration-75 | transition-duration: 75ms | Very fast transition |
.duration-100 | transition-duration: 100ms | Fast transition |
.duration-150 | transition-duration: 150ms | Quick transition |
.duration-200 | transition-duration: 200ms | Moderate transition |
.duration-300 | transition-duration: 300ms | Standard transition |
.duration-500 | transition-duration: 500ms | Slow transition |
.duration-700 | transition-duration: 700ms | Very slow transition |
.duration-1000 | transition-duration: 1000ms | Extra slow transition |
Timing Function Classes
Class | CSS Property | Description |
---|---|---|
.ease-linear | transition-timing-function: linear | Constant speed transition |
.ease-in | transition-timing-function: cubic-bezier(0.4, 0, 1, 1) | Starts slow, ends fast |
.ease-out | transition-timing-function: cubic-bezier(0, 0, 0.2, 1) | Starts fast, ends slow |
.ease-in-out | transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1) | Starts and ends slow |
Delay Classes
Class | CSS Property | Description |
---|---|---|
.delay-0 | transition-delay: 0ms | No delay |
.delay-75 | transition-delay: 75ms | Very short delay |
.delay-100 | transition-delay: 100ms | Short delay |
.delay-150 | transition-delay: 150ms | Brief delay |
.delay-200 | transition-delay: 200ms | Moderate delay |
.delay-300 | transition-delay: 300ms | Standard delay |
.delay-500 | transition-delay: 500ms | Long delay |
.delay-700 | transition-delay: 700ms | Very long delay |
.delay-1000 | transition-delay: 1000ms | Extra long delay |
Responsive Classes
Add @{breakpoint}
suffix to any transition class to apply it at a specific breakpoint:
.transition@md
.transition-colors@lg
.duration-300@sm
.ease-in-out@xl
.delay-100@md
SCSS Mixins
NuvoUI provides a comprehensive set of transition mixins for use in your SCSS:
Property Mixins
Mixin | Description | Parameters |
---|---|---|
@include transition-none | Disables transitions | None |
@include transition | Transitions all properties | None |
@include transition-colors | Transitions only color properties | None |
@include transition-opacity | Transitions only opacity | None |
@include transition-shadow | Transitions only shadow | None |
@include transition-transform | Transitions only transform | None |
Duration Mixin
Mixin | Description | Parameters |
---|---|---|
@include duration($time) | Sets transition duration | $time : Time value (e.g., 300ms ) |
Timing Function Mixins
Mixin | Description | Parameters |
---|---|---|
@include ease-linear | Sets linear timing function | None |
@include ease-in | Sets ease-in timing function | None |
@include ease-out | Sets ease-out timing function | None |
@include ease-in-out | Sets ease-in-out timing function | None |
Delay Mixin
Mixin | Description | Parameters |
---|---|---|
@include delay($time) | Sets transition delay | $time : Time value (e.g., 200ms ) |
Example SCSS Usage
Best Practices
When to Use Transitions
- Use transitions to provide visual feedback for user interactions
- Apply transitions for non-disruptive UI changes like hover states, expansions, and color shifts
- Keep transitions subtle and purposeful, avoiding excessive animation
- For content-heavy sites, consider using minimal or no transitions to prioritize performance
Performance Considerations
- Transition only the properties you need to change (use
.transition-colors
instead of.transition
) - Avoid transitioning expensive properties like
width
andheight
when possible - For smoother animations, prefer transitioning
transform
andopacity
- Keep durations short for common interactions (75ms-300ms)
- Test transitions on mobile devices to ensure they feel responsive
Accessibility
- Respect user preferences by checking for
prefers-reduced-motion
- Avoid transitions that could trigger vestibular disorders
- Ensure interactive elements are clearly distinguishable without hover effects
- Don't rely solely on transitions to communicate state changes
Theme Integration
When using with NuvoUI theme system, transitions can enhance