You can do it ... whether you should is another matter ๐
Here's some untested code to essentially copy all the host attributes to the inner input - (you could filter out the ones you care about).
@Element() host: HTMLElement;
@State() attrs: {[key: string]: string}[];
private mo: MutationObserver;
setAttrs() {
this.attrs = Array.from(this.host.attributes).flatMap(att => att.specified ? {[att.nodeName]: att.nodeValue} : []);
}
attachSlotObserver() {
if (!!this.mo || !window['MutationObserver']) return;
this.mo = new MutationObserver(() => this.setAttrs());
this.mo.observe(this.host, { attributes: true });
}
connectedCallback() {
this.setAttrs();
this.attachSlotObserver();
}
disconnectedCallback() {
if (this.mo) this.mo.disconnect();
}
render() {
return <input {...this.attrs} />
}
Then to ignore all the host styling, do something like
:host { display: contents; }