Closed mrantonwinter closed 10 years ago
The luma class is applied to the parent based on the YIQ value. If the YIQ value is < 128, it gets the dark luma class, and the opposite in the light case.
Also, sorry for the delayed reply!
Hi,
so i want to change text color based on its background image. my approach right now is to use jQuery to test if an element hasClass('ab-light') or 'ab-dark'. however, the lumaclasses somehow cannot be detected as a normal class. so the if statement can never be triggered. please see below code attached. any suggestion? thanks!
if ($('.fill').hasClass('ab-light')) {
$('.top-menu-bar a').css('color', 'black');
console.log('sdafasdfsdf');
}
else {
$('.top-menu-bar a').css('color', 'white');
console.log('darkkkkkk');
}
@shangsunset Can you create a Codepen demonstrating the issue? Or, point me in the direction of your demo?
@briangonzalez here is a screen shot
could you include a sample on how to use lumaclasses
not really an issue, but had to post this somewhere.