I am building a very simple static site on Rails. I am using a Bootstrap nav bar. The Bootstrap link default color is grey, so I have used this in my SASS file to reset it:
nav {
a {
color: white !important;
}
}
Not rocket science. The problem arises when I try to use JQuery to override that setting. I want the link to turn a bluish color when people hover over it. Here is my JQuery:
$(document).on('turbolinks:load', function() {
$('a').hover(function(){
$(this).animate({'color':'#00ddda !important'},400);
},
function(){
$(this).animate({'color':'white !important'},400);
});
})
This does not work unless I remove the !important statement from the original SASS file. But if I remove the !important statement from the SASS file, the links start out grey. It works AFTER you hover and it returns to white, but at the start they are grey, which is not what I want. Can someone help? I'm not sure what to do.