Skip to content

Conversation

@AbdelatefElshafei
Copy link

@AbdelatefElshafei AbdelatefElshafei commented Dec 12, 2025

Link to related issue (if applicable)

Fixes #2873

Summary of proposed changes

  • Kept the SCSS variable $plyr-font-smoothing and CSS custom property --plyr-font-smoothing so users can override it.
  • Updated the plyr-font-smoothing mixin to respect the $mode argument, ensuring that explicit calls like @include plyr-font-smoothing(true) work correctly.
  • Default font smoothing is now true (antialiased for webkit, grayscale for Firefox).
  • Ensures font smoothing now applies consistently across all elements.

@AbdelatefElshafei
Copy link
Author

@sampotts Could you please review this PR? Thanks!

@sampotts
Copy link
Owner

Ideally, we'd keep the CSS custom property so folks can still set it somehow?

@AbdelatefElshafei
Copy link
Author

@sampotts Thanks for the clarification!

Just to confirm — would you prefer keeping the CSS custom property
(--plyr-font-smoothing) but removing the unused SCSS variable only?

I can update the PR so the custom property remains available for users to override,
while still applying the default smoothing value internally.

Let me know and I'll push an update!

@gardiner
Copy link

gardiner commented Dec 12, 2025

@AbdelatefElshafei Just out of curiosity, could you elaborate on your changes? It looks as if $plyr-font-smoothing is still in the code (you said it should have been removed?). Also I don't get why you are ignoring the method argument $mode in the mixin plyr-font-smoothing()? Thanks for your efforts! Cheers, Ole.

Edit: To clarify, I meant that in your changed code, the mixin plyr-font-smoothing() changes its behavior depending on the setting of the scss variable. If you set $plyr-font-smoothing to false and call plyr-font-smoothing(true), font-smoothing will still be disabled, right?

@AbdelatefElshafei
Copy link
Author

@AbdelatefElshafei Just out of curiosity, could you elaborate on your changes? It looks as if $plyr-font-smoothing is still in the code (you said it should have been removed?). Also I don't get why you are ignoring the method argument $mode in the mixin plyr-font-smoothing()? Thanks for your efforts! Cheers, Ole.

Edit: To clarify, I meant that in your changed code, the mixin plyr-font-smoothing() changes its behavior depending on the setting of the scss variable. If you set $plyr-font-smoothing to false and call plyr-font-smoothing(true), font-smoothing will still be disabled, right?

@gardiner Hi Ole,

Thanks a lot for your detailed feedback! You're absolutely right.

I've updated the PR to address your concerns:

The SCSS variable $plyr-font-smoothing is still present as the default, so users can override it via CSS or SCSS.

The mixin plyr-font-smoothing($mode) now respects the $mode argument — calling @include plyr-font-smoothing(true) will enable font smoothing regardless of the default variable.

The default behavior remains consistent, and all elements now apply font smoothing correctly.

This should fix the issue you pointed out about the mixin ignoring the argument.

Thanks again for reviewing — happy to make any further adjustments if needed!

Best,
Abdelatef

@gardiner
Copy link

@AbdelatefElshafei Awesome, thank you!

@AbdelatefElshafei
Copy link
Author

@AbdelatefElshafei Awesome, thank you!
You are Welcome, Thanks For your FeedBack, Ole!

@AbdelatefElshafei
Copy link
Author

@sampotts Can You Take another look i made some changes to make it better

$plyr-font-weight-regular: var(--plyr-font-weight-regular, 400) !default;
$plyr-font-weight-bold: var(--plyr-font-weight-bold, 600) !default;
$plyr-line-height: var(--plyr-line-height, 1.7) !default;
$plyr-font-smoothing: var(--plyr-font-smoothing, false) !default;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should keep the default as false.

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

Successfully merging this pull request may close these issues.

There is no use of the --plyr-font-smoothing variable inside CSS source code

3 participants