I am trying to modify the button color in my script from grey to green when it transitions from disabled to enabled status. Despite using both the disabled and enabled properties in my CSS and incorporating vue.js (which I am not very familiar with), the color change does not work as expected. Instead of going from grey to green, it goes from light green to green.
Below is the code snippet:
CSS AND HTML
.disabled {
opacity: 0.4;
background:grey;
}
.ctaBtn_Start,
.ctaBtn_Start a:link,
.ctaBtn_Start a:visited {
background: pink;
text-align: center;
border-radius: 0.625rem;
border: none;
font-size: 1.5rem;
font-weight: 700;
cursor: pointer;
color: #ffffff;
margin-bottom: 1.25rem;
padding: 0.5rem 2rem;
}
.ctaBtn_Start:hover {
background: #00cc00;
}
.ctaBtn_Start:disabled,
button[disabled] {
background: yellow;
color: #ffffff;
}
.ctaBtn_Start:enabled,
button[enabled] {
background: #049804;
}
// HTML Button with vue.js binding to the css
<button enabled disabled class="ctaBtn_Start" type="submit" v-bind:class="{ 'disabled' : $v.$invalid || isLoading }">
Start
</button>