Skip to content

Commit

Permalink
Add custom scrollbar CSS to embedded lyrics popup
Browse files Browse the repository at this point in the history
  • Loading branch information
napieralla committed Aug 1, 2020
1 parent 9785523 commit 0fb2fab
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/app/components/Common/Player/Lyrics/Lyrics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,30 @@ import translate from '../../../../utils/translations/Translations';
import Loader from '../../Loader/Loader';
import classes from './LyricsModal.scss';

// It is not possible to assign CSS dynamically by traversing the DOM in Javascript, the iframe's child elements cannot be accessed.
// It is also not possible to use the embedded content's class-names and assign properties to them in our own CSS files - these will not be applied.
// Our only option seems to be to compile and enter CSS dynamically into the below variable.
// Consider: "https://sass-lang.com/documentation/js-api"
const iframeCss = `
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700" rel="stylesheet">
<style>
body, html {
margin: 0;
padding: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'Roboto', sans-serif;
scrollbar-color: #d4d4d4 #eee;
}
::-webkit-scrollbar {
width: 9px;
}
::-webkit-scrollbar-track {
background: #eee;
}
::-webkit-scrollbar-thumb {
background: #d4d4d4;
}
.rg_embed_body * {
background: none !important;
color: #000 !important;
Expand Down

0 comments on commit 0fb2fab

Please sign in to comment.