I am trying to get an ion-input to look something like this:
According to the Ionic V7 documentation I should be able to get the border radius using the --border-radius custom property on ion-input, however it is not applied. I can get the radius by using a plain border-radius property but that does not apply the border radius to the underlying native input so it looks terrible when a field is auto-filled by the browser.
Has anyone come across this? Could you tell me how to overcome it? Here is a minimal reproduction of what I have tried:
<template>
<ion-page>
<ion-content :fullscreen="true">
<ion-grid>
<ion-row>
<ion-col style="padding: 20px;">
<ion-input label="test" class="custom"></ion-input>
</ion-col>
</ion-row>
</ion-grid>
</ion-content>
</ion-page>
</template>
<script setup lang="ts">
import { IonPage, IonContent, IonInput, IonGrid, IonRow, IonCol } from '@ionic/vue';
</script>
<style scoped>
ion-input.custom{
border: 2px solid gray;
--border-radius: 30px; /* does nothing */
border-radius: 30px; /* applies the border radius only to the ion-input, not the underlying input */
}
</style>