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

Any way to style the input itself? #18

Open
simondrabble opened this issue Jun 24, 2020 · 1 comment
Open

Any way to style the input itself? #18

simondrabble opened this issue Jun 24, 2020 · 1 comment

Comments

@simondrabble
Copy link

I use bootstrap and it's nice to be able to apply form-control class to each input. Is there a way to set the class on the input itself (not the vue-numeric-input wrapper) ?

@vanderb
Copy link

vanderb commented Dec 8, 2020

Hi @simondrabble,

I know question was made some month ago.

I've ending in same trouble, so I took a look into code. There is no style- or theme-property to solve that, so you have to override components styles by add custom-class to component.

<vue-numeric-input class="my-numeric-input" .../>

<style lang="scss">
// Use Class-Chain to get higher css-specificity
.vue-numeric-input {
 &.my-numeric-input {
  // Override styles
 }
}
</style>

For component styles take a look into the component-source
https://github.com/JayeshLab/vue-numeric-input/blob/master/src/vue-numeric-input.vue

You may also use CSS-property all to reset styles first before setting your custom css

<style lang="scss">
// Reset component-root styles
.vue-numeric-input {
  all: unset;
}

// Reset styles of child-elements
.vue-numeric-input * {
  all: unset;
}

 // Set custom style
.my-numeric-input {

}
</style>

Maybe the developer will implement such a theme, or style-feature or someone will create a pull-request for that.

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

2 participants