Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Animating a border when class is applied?

How do we animate the change to a border that occurs when a class is applied.

For example:

el-item {
    border-left: 6px solid red;
}

 el-item.onSelected {
    border-left: 6px solid blue;
}

When the onSelected class is added to the el-item element, the border color changes to blue. How do we animate that transition?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You can add in css

.el-item{
    border-left: 6px solid red;
    transition: all .5s;
}

and

.el-item.onSelected{
    border-color: blue;
}

I create a exemple here: codepen

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading