vue-plyr icon indicating copy to clipboard operation
vue-plyr copied to clipboard

How to override css variables

Open SriNandan33 opened this issue 5 years ago • 7 comments

Hi, I am trying to customize css variables, but they are not reflecting. I tried adding in the :root element

:root {
      --plyr-color-main: red !important;
}

SriNandan33 avatar Jun 24 '20 14:06 SriNandan33

same

ilyasdx91 avatar Sep 09 '20 13:09 ilyasdx91

Same issue

daviddang91 avatar Sep 10 '20 10:09 daviddang91

Same issue any solution for this?

Quasarman avatar Sep 18 '20 16:09 Quasarman

I just interrupted these styles ,!important =)

ilyasdx91 avatar Sep 22 '20 06:09 ilyasdx91

Hello @ilyasdx91,

where exactly did you "interrupt" the styles. Because for me it does not work by just putting a !important behind the variable in :root?

:root {
       --plyr-color-main: #456788 !important; /* Not changing the color */
}

Quasarman avatar Sep 23 '20 06:09 Quasarman

I know it's a bit late, but I'm fairly certain this has been fixed in the latest version. I tried it in a vue-cli project (vue 3), and a nuxt project (vue 2), and it worked perfectly in both of them. Maybe this has something to do with where you're declaring your variables?

To reproduce my setup, go into either of the nuxt or vue-cli folders in examples/, and add the following code to pages/index.vue (nuxt) or src/App.vue (vue-cli):

<style>
  :root {
    --plyr-color-main: red;
  }
</style>

redxtech avatar Nov 03 '20 08:11 redxtech

I solved this problem. I set variable in css file not in vue SFC. Here explained about this https://github.com/sampotts/plyr?tab=readme-ov-file#customizing-the-css

Fozilbek-Raimberdiyev avatar Mar 28 '24 07:03 Fozilbek-Raimberdiyev