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

Vue 3 styling #44

Closed
aBenve opened this issue Jan 24, 2022 · 2 comments
Closed

Vue 3 styling #44

aBenve opened this issue Jan 24, 2022 · 2 comments

Comments

@aBenve
Copy link

aBenve commented Jan 24, 2022

Hey! Hi, I'm trying to use this beautiful slider but I'm no able to aply styling. I used the posted demo so I could see my styles working but nothing on my project.

Code:

<template>
  <div>
    <Slider v-model="value" :tooltips="false"/>
  </div>
</template>

<script>
import Slider from '@vueform/slider'

export default {
  components: {
    Slider,
  },
  data() {
    return {
      value: 20
    }
  }
}
</script>

<style  src="@vueform/slider/themes/default.css">
:root{
  --slider-connect-bg: #a594fe;
  --slider-bg: #252525;
  --slider-height: 20px;
  --slider-handle-width: 20px;
  --slider-handle-height: 20px;
  --slider-handle-bg: radial-gradient(circle, rgba(0,0,0,1) 40%, rgba(165,148,254,1) 60%);
  --slider-tooltip-bg: #a594fe;

  --slider-handle-ring-width: 3px;
  --slider-handle-ring-color: #a594fe30;
}
</style>

Thanks and sorry for my English.

@maksakoviliya
Copy link

maksakoviliya commented Feb 10, 2022

Try to do like that:

<style> :root { <...Your variables here...> --slider-bg: #F4F2F1; <...Your variables here...> } </style> <style src="@vueform/slider/themes/default.css"></style>

@aBenve
Copy link
Author

aBenve commented Feb 15, 2022

Wow it works perfectly now! Thanks for the response!

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

3 participants