Auto resize drop-down select elements to match the width of the selected option and customize it with CSS
npm install auto-resize-custom-select   
> Auto-resize the width of a select element based on the size of the current selected option.
Fully customizable with CSS without the common styling limitations of a select element.
customSelect. Auto resizes drop-down select html elements to fit the size of the option that has been selected. It also gives you total freedom and control to style the list selector with CSS without the usual constraints on this form elements.
It creates a substitute span element with the .custom-select class, which contains two children span elements, with the selection value (.selection) and the expand figure (.arrow) that you can stylize as you wish.
``html`
value
[::after]
`sh`
$ npm i auto-resize-custom-select
Easiest way to install it is via NPM or including the minified file from the unpkg or jsdelivr CDNs.
`html`
Some examples can be seen on this CodePen: https://codepen.io/alterebro/full/RwopMYp

Just include it on your document and call the customSelect function. The script is available as ES5 minified file and as ES Module.
`html
...
...