The shadow dom is discouraging you to do this as specified by pmdartus here.
There is an ugly workaround that you can use. You have to use renderedCallback
and set the style specified by Atlas Can here.
JS:
import { LightningElement, track, api } from 'lwc';
export default class App extends LightningElement {
renderedCallback() {
const style = document.createElement('style');
style.innerText = 'input::-webkit-outer-spin-button {display:none;}input::-webkit-inner-spin-button {display:none;}';
this.template.querySelector('lightning-input').appendChild(style);
}
}
Markup:
<template>
<lightning-input label="My Number" type="number" step="0.01">
</lightning-input>
</template>
Playground Link : https://developer.salesforce.com/docs/component-library/tools/playground/i9HYzlT_r/2/edit
Src:
https://hellosnl.blogspot.com/2019/07/lwc-override-css-of-standard-lightning-components.html