
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
css-transit
Advanced tools
A tiny modern library for fast, smooth, and controllable CSS transitions.
npm install css-transit
Libraries like GSAP
or Popmotion
are not needed when dealing with basic CSS transitions, and can significantly reduce performance.
css-transit
uses a common method of triggering layout to allow inline css transitions on demand, keeping DOM changes to a minimum which allows the browser to animate smoothly.
It has been used in multiples of large client production applications over several years.
gsap
-like usage with from
, to
, ease
, stagger
, and delay
Promise
which resolves when the transition is finished (through the ontransitionend
event)easing
curves included 🎁css-transit
uses a single method,cssTransition()
, which does different things based on the supplied arguments.
See below examples for more detail.
![]() |
Basic usage
|
![]() |
Easing
You can also supply your own
|
![]() |
Showing / Hiding
|
![]() |
Staggering
When transitioning multiple items, the last argument can be used to stagger the animations (this adds a |
![]() |
Callbacks / Promises
|
![]() |
Function props
|
css-transit
simply sets and unsets inline styles and support any standard css props that would go into the HTMLElement.style
property. It also includes a few special props to ease development.
ease: "<value>"
cubic-bezier()
display: "<value>"
delay: 500
transition-delay
clearStyles: true
css-transit
uses a single method for all transitions based on context.
// Element transition to end props
cssTransition(
element: HTMLElement,
ms: Number,
endProps: Object
)
// Element transition from starting props, to end props
cssTransition(
element: HTMLElement,
ms: Number,
fromProps: Object,
endProps: Object
)
// Multiple element transition to end props
cssTransition(
elements: Array,
ms: Number,
endProps: Object
)
// Multiple element transition from starting props, to end props
cssTransition(
elements: Array,
ms: Number,
fromProps: Object,
endProps: Object
)
// Multiple element staggered transition to end props
cssTransition(
elements: Array,
ms: Number,
endProps: Object,
staggerInterval: Number
)
// Multiple element staggered transition from starting props, to end props
cssTransition(
elements: Array,
ms: Number,
fromProps: Object,
endProps: Object,
staggerInterval: Number
)
FAQs
A tiny library for fast, smooth, and controllable CSS transitions.
The npm package css-transit receives a total of 0 weekly downloads. As such, css-transit popularity was classified as not popular.
We found that css-transit demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.