How can I utilize the same SASS file for two different websites with similar functionality but different color schemes? My goal is to dynamically change the color based on the URL of the page. However, I am facing challenges in extracting the page URL from within the SASS file and incorporating conditional logic using .contains() in CSS.
Is it possible to update SASS variables from JS or JQuery instead?
For instance,
URL1 = ;
URL2 = ;
I want to determine if the page URL contains ".nz", then set the button color to green; otherwise, set it to gray.
I understand that the syntax below is incorrect. Could you please provide the correct syntax and guidelines:
$URL: need to get the page URL;
@if $URL.contains('.nz') {
$bg-color: green;
}@else {
$bg-color: gray;
}
.button{
background : $bg-color
}