[Solved] The "transition" doesn't work
I just started to work with Vue with SCSS for the first time and I noticed that when I tryed transition like the code below, when I hover over my a elements, they don't have that transition time. I try to do it with normal CSS but that didn't work too but it worked with HTML. So maybe it has to do with Vue? Anyone know how to fix this?
13 Replies
What do you mean it worked with html?
There might be a problem when background is a different color format in different rules. For example here you have rgb and rgba , and you might fix the problem by choosing only one to use everywhere for that element.
Like the html file not vue.
I tried only choose one but that didn't work.
It would be nice to have a replica of this issue on codepen.
A lot of things are going on, over which we would just be speculating
maybe it is because you're not telling what property to transition. also, not all properties/values can transition (such as bg gradients)
Only thing I have is just this
I just started this like a few mins ago, added a nav, added some scss thats it XD
I went to try that and also tried just removing the gradient since maybe that was it
but that didn't seem to work. Then again the gradients worked in html, but when it went to vue it didn't worked out 😦
in the normal <a> state there is no background-color set.
so there is nothing to transition from
AH! it worked! Thanks!
Thats weird tho, never needed to do that normally until Vue. Eh oh well thanks for the help1 🙂
hm, i was just checking, normally it doesn't need it indeed. so maybe there is something else going on aswell.
That's part of the problem with sharing only partial code, we can't see if there are conflicts
I also ran to codePen to test this 😂
but thats all the code I have XD
installed vue@latest
deleted starting files
added nav.scss
added navbar.vue
thats it, nothing else XD
So, @MarkBoots after some tests, it occurred to me.
The transition from transparent bg to a colored bg is normal.
What isn't normal is transitioning background image (The gradient)
So, except the new code has a background color overriding the gradient, that transition isn't actually supposed to work.
Remember the
background
property is the short form for a lot of background sub properties.
So, imagine transitioning from background-color: red;
to background-image: linear-gradient(...)
are you trying to style elements inside a
<template>
tag?