Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set default colors only if they are null (SASS) #158

Closed
ivanvermeyen opened this issue Feb 4, 2016 · 2 comments
Closed

Set default colors only if they are null (SASS) #158

ivanvermeyen opened this issue Feb 4, 2016 · 2 comments

Comments

@ivanvermeyen
Copy link
Contributor

Hi

I was trying to set some colors for the controls, but it seems you are overwriting the vars $plyr-control-color and $plyr-control-color-hover, based on the lightness of $plyr-controls-bg and $plyr-control-bg-hover.

https://github.com/Selz/plyr/blob/master/src/sass/plyr.scss#L26-L45

I could change the 'gray' vars, but $gray: red; doesn't feel that good :)

Maybe you could add a check to see if $plyr-control-color and $plyr-control-color-hover are null before overwriting them?

Still loving this plugin! 👍

@sampotts
Copy link
Owner

sampotts commented Feb 4, 2016

I think using !default would solve this?
https://robots.thoughtbot.com/sass-default

Sorry, I've always been a LESS person and have been meaning to move over to SASS but just haven't found the time. I'll check it out and get back to you.

Cheers 👍

@ivanvermeyen
Copy link
Contributor Author

Thanks.

EDIT:

Sorry, this seems to be a better, cleaner solution:

// Contrast
@if lightness($plyr-controls-bg) >= 65% {
    $plyr-control-color: $plyr-gray-light !default;
}
@else {
    $plyr-control-color: $plyr-gray-lighter !default;
}
@if lightness($plyr-control-bg-hover) >= 65% {
    $plyr-control-color-hover: $plyr-gray !default;
}
@else {
    $plyr-control-color-hover: #fff !default;
}

And then probably remove these 2 lines :)

https://github.com/Selz/plyr/blob/master/src/sass/plyr.scss#L30-L31

$plyr-control-color:             null !default;
$plyr-control-color-hover:       null !default;

sampotts pushed a commit that referenced this issue Feb 15, 2016
Allow player control colors to be overridden #158
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants