Skip to content

Commit

Permalink
fix(UI): Fix font-family override in UITextDisplayer (#7249)
Browse files Browse the repository at this point in the history
Font settings were applied to ".shaka-video-container *", all
descendents of .shaka-video-container. This meant that the font setting
inheritance intended in our UI text displayer was broken, because those
descendents effectively had their own settings and didn't inherit them
from their parents in the subtitle DOM hierarchy. We fix this by
breaking down the CSS and applying those font settings directly to the
top level .shaka-video-container, to be inherited by any descendent
without their own setting.
  • Loading branch information
avelad committed Sep 4, 2024
1 parent b7d1466 commit 5663a20
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
4 changes: 0 additions & 4 deletions lib/text/ui_text_displayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -710,10 +710,6 @@ shaka.text.UITextDisplayer = class {
// Only do this for the text itself.
elem.style.backgroundColor = 'rgba(0, 0, 0, 0.8)';
}
const fontFamily = inherit((c) => c.fontFamily);
if (fontFamily) {
elem.style.fontFamily = fontFamily;
}
}
if (text) {
elem.textContent = text;
Expand Down
7 changes: 3 additions & 4 deletions ui/less/containers.less
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@
}

/* Set the fonts for all other content. */
* {
font-family: Roboto, sans-serif, TengwarTelcontar;
-webkit-font-smoothing: antialiased;
}
font-family: Roboto, sans-serif, TengwarTelcontar;
font-weight: normal;
-webkit-font-smoothing: antialiased;
}

/* Each browser has a different prefixed pseudo-class for fullscreened elements.
Expand Down

0 comments on commit 5663a20

Please sign in to comment.