Reputation: 465
In my ionic v2 app is a button, no matter which text I type in, it's always capitalized. I don't want to add css-utilities, because i have mixed lower and upper case words.
Here is my code:
<button ion-button large block color="danger" (click)="openPage($event, 0)">
This is my test Text.
</button>
I've tried to remove all properties from the button tag, but that did not worked. Any suggestions?
Upvotes: 10
Views: 14323
Reputation: 11
To set it globally add
.button {
text-transform: none;
}
Inside global.scss
Upvotes: 1
Reputation: 33
For IONIC 4
Add text-capitalize="false"
to your button.
Eg:
<ion-button text-capitalize="false" shape="round">Click</ion-button>
Upvotes: 0
Reputation: 1795
add text-capitalize in your button like this
<button ion-button text-capitalize (click)="openPage($event, 0)">This is my test Text.</button>
Upvotes: 1
Reputation: 451
Put the following in the variables.scss
$button-md-text-transform: none;
By default, the value is uppercase for Android platform. Change it to none. This will be applied to every button in your app.
Upvotes: 9
Reputation: 8736
Change your template as below:
<button class="removeTextTransform" ion-button large block color="danger" (click)="openPage($event, 0)">
This is my test Text.
</button>
Add following code in your app.scss
:
.removeTextTransform {
text-transform: none;
}
Use removeTextTransform
class whenever you want to remove text transform from your ionic button.
Upvotes: 4
Reputation: 151
You can use Platform Specific Styles to style the buttons in your application.
Ionic2 has four platforms:
Overriding the Mode Styles. You can use the class that is applied to the body to override specific properties in mode components. In this case you would like to override the button style to have no text transform.
Place the code down here in the variables.scss file. Scroll down untill you see the section "App iOS Variables" or "App Material Design Variables"
// Style Android buttons
.md button {
text-transform: none;
}
// Style iOS buttons
.ios button {
text-transform: none;
}
// Style Windows Phone buttons
.wp button {
text-transform: none;
}
More about theming your app: Theming your Ionic App
More about CSS text-transform property: Here
Upvotes: 4
Reputation: 820
It seems the button has text-transform set to uppercase in CSS. Add the following CSS to your button: text-transform: none;
to override the CSS property set.
Your code becomes something like this:
<button ion-button large block color="danger" style="text-transform: none;" (click)="openPage($event, 0)">
This is my test Text.
</button>
For more information on the text-transform property CSS text-transform Property
Upvotes: 25