I am looking to make some specific changes to the link and hover color in my design.
I have a solution that can address all 3 changes using BS4 with sass in one go. If you have access to the .scss file in your custom project and can compile it, here is the recommended approach...
For this particular scenario, you can create a custom mixin like this:
@mixin my-variant($bgcolorOff, $borcolorOff, $bgcolorOn, $borcolorOn, $bgcolorAct, $borcolorAct, $txtcolorOff, $txtcolorOn, $txtsize, $txtalign){
@include button-variant($bgcolorOff, $borcolorOff, $bgcolorOn, $borcolorOn, $bgcolorAct, $borcolorAct);
color:#333; /*set a fallback color*/
font-weight:normal; /*customize other attributes like text size, alignment, etc.*/
text-transform:none; /*customize other attributes like text size, alignment, etc.*/
text-decoration:none; /*customize other attributes like text size, alignment, etc.*/
text-align:$txtalign; /*reference parameter values*/
}
Assuming you already have assigned hex colors to sass variables like this:
$m-color-red: #da291c;
$m-color-blue: #004c97;
..etc..
If so, you can call your mixin from any specific location in your sass file. Make sure to properly define your colors to create your custom variant.
.m-variant {
@include my-variant($m-color-white, $m-color-grey-light, $m-color-off-white, $m-color-grey-light, $m-color-blue, $m-color-grey-light, $m-color-grey-light, $m-color-grey-light, 1.200em, 'left');
}
When creating buttons or anchor links, you can include the following in your element structures:
<a class="btn btn-sm m-3 m-variant ">my custom button</a>
By following these 4 simple steps, you can take complete control over your link and hover colors. Feel free to reuse or create as many variants as needed.
I hope this solution works for you.