# how to create smooth CSS transitions

A web-development technique for making changes to CSS properties interpolate over time with configurable duration, delay, and timing functions.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Four new CSS features for smooth entry and exit animations

DevFeed: [Four new CSS features for smooth entry and exit animations](<https://devfeed.tech/articles/four-new-css-features-for-smooth-entry-and-exit-animations-28752.md>)

Original publisher: [Read original article](<https://una.im/2023-08-16-entry-exit-animations/>)

Published: 2023-08-16T00:00:00Z

Content type: tutorial

Language: en

Sources: [Una Kravets](<https://devfeed.tech/sources/una-kravets.md>)

Topics: [CSS](<https://devfeed.tech/topics/css.md>), [how to create smooth CSS transitions](<https://devfeed.tech/topics/how-to-create-smooth-css-transitions.md>), [Web Development](<https://devfeed.tech/topics/web-development.md>)

Tags: [behavior](<https://devfeed.tech/tags/behavior.md>), [css](<https://devfeed.tech/tags/css.md>), [display](<https://devfeed.tech/tags/display.md>), [features](<https://devfeed.tech/tags/features.md>), [property](<https://devfeed.tech/tags/property.md>), [visibility](<https://devfeed.tech/tags/visibility.md>)

### AI overview

The article presents four CSS features for creating smooth entry and exit animations: animating display and content-visibility in keyframe timelines, the transition-behavior property, the @starting-style rule, and the overlay property.

### Source excerpt

These four new features include: animating display and content-visibility on a keyframe timeline, the transition-behavior property, the @starting-style rule, and the overlay property.

## Dynamically Load CSS with the Angular CLI

DevFeed: [Dynamically Load CSS with the Angular CLI](<https://devfeed.tech/articles/dynamically-load-css-with-the-angular-cli-21350.md>)

Original publisher: [Read original article](<https://juri.dev/blog/2019/08/dynamically-load-css-angular-cli/>)

Published: 2019-08-22T00:00:00Z

Content type: tutorial

Language: en

Sources: [Juri Strumpflohner](<https://devfeed.tech/sources/juri-strumpflohner.md>)

Topics: [Angular](<https://devfeed.tech/topics/angular.md>), [Angular CLI](<https://devfeed.tech/topics/angular-cli.md>), [CSS](<https://devfeed.tech/topics/css.md>), [how to create smooth CSS transitions](<https://devfeed.tech/topics/how-to-create-smooth-css-transitions.md>), [modern web development](<https://devfeed.tech/topics/modern-web-development.md>), [Web Development](<https://devfeed.tech/topics/web-development.md>)

Tags: [angular](<https://devfeed.tech/tags/angular.md>), [cli](<https://devfeed.tech/tags/cli.md>), [css](<https://devfeed.tech/tags/css.md>), [development](<https://devfeed.tech/tags/development.md>), [lazy-loading](<https://devfeed.tech/tags/lazy-loading.md>), [themes](<https://devfeed.tech/tags/themes.md>), [tooling](<https://devfeed.tech/tags/tooling.md>)

### AI overview

This tutorial explains how to configure the Angular CLI to produce separate CSS or Sass entry points and lazy load them at runtime. It describes using independent styles for themes or clients, preventing all styles from being included together, and adding the selected stylesheet dynamically through a link element.

### Source excerpt

Lorem ipsum dolor sit amet

## CSS only elastic hover effect

DevFeed: [CSS only elastic hover effect](<https://devfeed.tech/articles/css-only-elastic-hover-effect-37266.md>)

Original publisher: [Read original article](<https://muffinman.io/blog/elastic-hover-effect/>)

Author: Stanko

Published: 2018-03-19T00:00:00Z

Content type: tutorial

Language: en

Sources: [Stanko Tadić](<https://devfeed.tech/sources/stanko-tadic.md>)

Topics: [CSS](<https://devfeed.tech/topics/css.md>), [how to create smooth CSS transitions](<https://devfeed.tech/topics/how-to-create-smooth-css-transitions.md>), [Web Development](<https://devfeed.tech/topics/web-development.md>)

Tags: [css](<https://devfeed.tech/tags/css.md>), [custom](<https://devfeed.tech/tags/custom.md>), [effect](<https://devfeed.tech/tags/effect.md>)

### AI overview

A tutorial explaining how to create an elastic hover effect for buttons using CSS. It uses ellipse pseudo-elements that scale on hover, slight button zooming, and custom elastic Bézier easing; a wireframe version is also included.

### Source excerpt

Some CSS fun. Lately I've stumbled upon couple of websites with elastic hover effect on buttons. Each one was using SVG morphing, which is fine, but I was wondering how hard would it be to implement it in CSS. It ended up up being pretty easy. I created four pseudo elementsOnly two pseudo elements (::before and ::after) can be created per element, therefore each button has one additional div inside it.. Each of these is ellipse, running along one edge of the button. By default these are scaled to zero by relevant axis. On hover, they scale back to their full size. For effect, whole button zoom in a little bit. Combine all of that with custom elastic bezier easing, and it looks quite convincing. Wireframe version is included as well, to make it easier to see how it works.

## Animate React component by calling 'setState' in 'componentDidMount'

DevFeed: [Animate React component by calling 'setState' in 'componentDidMount'](<https://devfeed.tech/articles/animate-react-component-by-calling-setstate-in-componentdidmount-37337.md>)

Original publisher: [Read original article](<https://muffinman.io/blog/react-rerender-in-component-did-mount/>)

Author: Stanko

Published: 2017-06-23T00:00:00Z

Content type: tutorial

Language: en

Sources: [Stanko Tadić](<https://devfeed.tech/sources/stanko-tadic.md>)

Topics: [React](<https://devfeed.tech/topics/react.md>), [React UI animations](<https://devfeed.tech/topics/react-ui-animations.md>), [how to create smooth CSS transitions](<https://devfeed.tech/topics/how-to-create-smooth-css-transitions.md>), [CSS](<https://devfeed.tech/topics/css.md>), [browser](<https://devfeed.tech/topics/browser.md>)

Tags: [animation](<https://devfeed.tech/tags/animation.md>), [browser](<https://devfeed.tech/tags/browser.md>), [code](<https://devfeed.tech/tags/code.md>), [css](<https://devfeed.tech/tags/css.md>), [react](<https://devfeed.tech/tags/react.md>), [react-component](<https://devfeed.tech/tags/react-component.md>)

### AI overview

A tutorial explains why changing a React component's state in componentDidMount may fail to produce a CSS transition. It attributes the behavior to browsers merging changes made within the same animation frame, and discusses using a timeout or animation-frame approach to separate the rendered states, including inconsistent Firefox behavior.

### Source excerpt

On the frontend, we do a lot of animations. Most of the simple animations I create by using CSS transitions. Either I will change class or inline style of the element, and define transitions in CSS file. Easiest way to do this in React is to render initial state, and then when it renders, change the state to apply class or style to animate. The easiest way to do it in React is to change state in componentDidMount. Setting state in componentDidMount is considered to be anti-pattern, as it forces rerender and can lead to property/layout thrashing. But in our case, that is exactly what we want to do. When we do that, we hit the wall - only second state is rendered and there is no transition between two states. It happens because of browsers optimization - browsers are not rerendering stuff that changed in the same animation frame. But they merge changes and render the end result. The problem I just described is not React exclusive, but browser related. Same will happen if we try something like this: const element = document.querySelector('.AnimateMe'); element.style.height = '50px'; element.style.height = '250px'; So let's start with example of the problem. Animate component by changing state in componentDidMount doesn't work # The scenario I described above. Element height depends on this.state.animation property. It is initially set to false and element height should be 50px. In componentDidMount we'll change the value of this.props.animation to true and element height should be 250px. As we added transition, it should animate. But it doesn't as all of this happens really fast, and browser decides to merge changes and render only the end result. This way our element immediately gets height of 250px. import React, { Component } from 'react'; export default class AnimateMe extends Component { constructor(props) { super(props); this.state = { animate: false, }; } componentDidMount() { this.setState({ animate: true }); } render() { return ( <div style={ { background: '#e

## React animate height (slide up/down) component

DevFeed: [React animate height (slide up/down) component](<https://devfeed.tech/articles/react-animate-height-slide-up-down-component-37333.md>)

Original publisher: [Read original article](<https://muffinman.io/blog/react-animate-height-slide-up-down/>)

Author: Stanko

Published: 2017-03-06T00:00:00Z

Content type: tutorial

Language: en

Sources: [Stanko Tadić](<https://devfeed.tech/sources/stanko-tadic.md>)

Topics: [React](<https://devfeed.tech/topics/react.md>), [React Component](<https://devfeed.tech/topics/react-component.md>), [how to create smooth CSS transitions](<https://devfeed.tech/topics/how-to-create-smooth-css-transitions.md>), [CSS](<https://devfeed.tech/topics/css.md>), [JavaScript](<https://devfeed.tech/topics/javascript.md>)

Tags: [component](<https://devfeed.tech/tags/component.md>), [css](<https://devfeed.tech/tags/css.md>), [github](<https://devfeed.tech/tags/github.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [npm](<https://devfeed.tech/tags/npm.md>), [react](<https://devfeed.tech/tags/react.md>)

### AI overview

This tutorial presents a small React component for animating height between collapsed, expanded, and specific pixel values. It explains how the component uses CSS transitions by temporarily replacing auto with numeric heights, then restores the appropriate height and overflow values after the transition.

### Source excerpt

Most JavaScript developers used jQuery's .slideUp() and .slideDown() methods, and got used to them. As component based frameworks usually do not include such functionality, the first logic choice is to turn to CSS. But alas, CSS transitions do not work with height: auto. (Transitions can do a tween only between two numeric values.) As we use this a lot in our company, I tried to find React component that does it. Found a couple, didn't like them, as most of them rely on a tone of dependencies. Again, I decided to write my own - small, fast and with no dependencies. Demo # You can see it live here. Same page has the documentation and links to the npm and GitHub. Component can animate from (and to) 0 (collapsed), auto (expanded), and to any specific value in pixels. Usage # Install it from npm npm install --save react-animate-height Import it in your React project, and wrap the content you want to animate in it. import AnimateHeight from 'react-animate-height'; <AnimateHeight duration={ 500 } height={ 'auto' } > <h1>Your content goes here</h1> <p>Put as many React or HTML components here.</p> </AnimateHeight> For more detailed documentation and all props explained, check the GitHub repo, How it works # Component is using CSS transitions, but with a small trick to make it work. We mentioned that transitions only work between two numeric values. We'll replace auto with numeric value just before transition happens. There are three possible cases: Specific height to the other specific height This is the easiest one. Element will have overflow: hidden and translate from one height value to the other. Piece of cake. Specific height (0 included) to auto This one is a bit more interesting. As we can't transition to auto, component will take the content height, apply it to the element, and transition will happen. But important thing is that after the transition is complete, component will reset height to auto and overflow to visible This is important if you add more content to

## A primer to vestibular disorders

DevFeed: [A primer to vestibular disorders](<https://devfeed.tech/articles/a-primer-to-vestibular-disorders-9419.md>)

Original publisher: [Read original article](<https://a11yproject.com/posts/understanding-vestibular-disorders/>)

Author: Dennis Gaebel

Published: 2013-05-05T00:00:00Z

Content type: article

Language: en

Sources: [The A11Y Project](<https://devfeed.tech/sources/the-a11y-project.md>)

Topics: [CSS animations](<https://devfeed.tech/topics/css-animations.md>), [web animation](<https://devfeed.tech/topics/web-animation.md>), [how to create smooth CSS transitions](<https://devfeed.tech/topics/how-to-create-smooth-css-transitions.md>), [browser](<https://devfeed.tech/topics/browser.md>), [Web Development](<https://devfeed.tech/topics/web-development.md>)

Tags: [animation](<https://devfeed.tech/tags/animation.md>), [browser](<https://devfeed.tech/tags/browser.md>), [css](<https://devfeed.tech/tags/css.md>), [css-animations](<https://devfeed.tech/tags/css-animations.md>), [web](<https://devfeed.tech/tags/web.md>), [web-animation](<https://devfeed.tech/tags/web-animation.md>)

### AI overview

This article introduces vestibular disorders, explaining how inner-ear dysfunction can affect balance, visual perception, concentration, and mobility. It then discusses how animations, parallax scrolling, sliders, videos, and rapid movement can worsen symptoms, and recommends accessible practices such as avoiding autoplay, indicating expected movement, providing controls to disable motion, and using the CSS prefers-reduced-motion media query.

### Source excerpt

Your Vestibular system is the sensory mechanism in the inner ear that detects movement of the head and helps to control balance. Imagine a world where your internal gyroscope is not working properly. Very similar to being intoxicated, things seem to move of their own accord, your feet never quite seem to be stable underneath you, and your senses are moving faster or slower than the rest of your body. Your personal steady-cam is broken. Whatever you look at tends to move regardless of if you are moving. Let's take that feeling and check out that great new website with animations and parallax scrolling. Does your stomach want to jump out of your throat? Well for many people it does. What is it? People with vestibular disorders have a problem with their inner ear. It affects their balance as well as their visual perception of their world around them. Sometimes the sensation lasts only a short while, but others can experience it for years. Walking can become a challenge and they may experience a constant risk of falling. Concentration can be diminished, leaving a person unfocused and consequently unproductive. It is often viewed as a "hidden" disability because it has no outward showing symptoms. Who is at risk? The cause may be from illness, injury, or a genetic condition, but anyone can suffer from a vestibular disorder. According to vestibular.org, a resource for people with vestibular disorders, as many as 35% of adults aged 40 years or older in the United States have experienced some form of vestibular dysfunction. What should you consider? Don't make animations, sliders, videos, or rapid movement start automatically. Give an indicator of what movement will happen on the site when someone takes action. Allow the option to turn off any animation and movement at any point in the process. Also, with the CSS prefers-reduced-motion media query you can write conditional CSS animations and transitions based on the user's preference exposed from the browser settings. For e