New style only applied to transitioned element
See original GitHub issueDescribe the bug If you apply a text color between transitions, the color only applies to the element which transitions, and not the static element. Say you have 10 and want to increment to 11, before you increment, the text color is white. Then when you increment to 11, and you have set the color to be green, or red, only the numer that transitioned (from 0 to 1) will have the new applied text color.
Expected behavior Expected behaviour is to have all number elements be the same numberStyle
Screenshots Before Transition:
After Transition:
Here’s my code for the example in the screenshot:
const Points = ({id}) => {
const card = useRecoilValue(cardItemState(id));
const pointStyle = {
color: ["#f10033", "#fff", "#28c120"][card.vote + 1]
}
return (
<Styled.Points>
<FlipNumbers numberStyle={pointStyle} height={28} width={14} color="" numbers={card.points.toString()} play />
</Styled.Points>
);
}
Desktop:
- OS: Window
- Browser: Chrome
- Version: 85.0.4183.102 (Official Build) (64-bit)
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Using CSS transitions - CSS: Cascading Style Sheets | MDN
transition -property. Specifies the name or names of the CSS properties to which transitions should be applied. Only properties listed here are ...
Read more >css transitions on new elements - Stack Overflow
I found a nicer way to trigger layout and make transitions work just after appending the element to the DOM: window.
Read more >transition | CSS-Tricks
The transition property is a shorthand property used to represent up to four transition-related longhand properties:
Read more >Transition Metals - The Parts of the Periodic Table
The transition elements or transition metals occupy the short columns in the center of the periodic table, between Group 2A and Group 3A....
Read more >CSS ::before and ::after for custom animations and transitions
Pseudo-elements are CSS selectors used to insert artificial or decorative content. ... but just in case, we'll take a cursory look at them....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I did, some pretty tight spaghett. 🍝 😄
not sure man, it’s been awhile… take a look the source code 👀