mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 03:32:21 +08:00
fix(all): improve text customization
This commit is contained in:
@ -954,7 +954,7 @@ presentPopover(ev: any) {
|
|||||||
async presentPopover(ev: any) {
|
async presentPopover(ev: any) {
|
||||||
const popover = await this.popoverController.create({
|
const popover = await this.popoverController.create({
|
||||||
component: PopoverComponent,
|
component: PopoverComponent,
|
||||||
ev: event,
|
event: event,
|
||||||
translucent: true
|
translucent: true
|
||||||
});
|
});
|
||||||
return await popover.present();
|
return await popover.present();
|
||||||
|
@ -8,6 +8,14 @@
|
|||||||
|
|
||||||
color: #{current-color(base)};
|
color: #{current-color(base)};
|
||||||
pointer-events: all;
|
pointer-events: all;
|
||||||
|
|
||||||
|
text-align: center;
|
||||||
|
text-decoration: none;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
text-transform: none;
|
||||||
|
|
||||||
|
white-space: nowrap;
|
||||||
|
font-kerning: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
:host-context(.can-go-back > ion-header),
|
:host-context(.can-go-back > ion-header),
|
||||||
@ -16,6 +24,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.back-button-native {
|
.back-button-native {
|
||||||
|
@include text-inherit();
|
||||||
@include font-smoothing();
|
@include font-smoothing();
|
||||||
|
|
||||||
display: block;
|
display: block;
|
||||||
@ -27,21 +36,11 @@
|
|||||||
|
|
||||||
outline: none;
|
outline: none;
|
||||||
|
|
||||||
color: inherit;
|
|
||||||
|
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
|
|
||||||
text-align: center;
|
|
||||||
text-decoration: none;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
text-transform: none;
|
|
||||||
|
|
||||||
white-space: nowrap;
|
|
||||||
|
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
z-index: 0;
|
z-index: 0;
|
||||||
font-kerning: none;
|
|
||||||
appearance: none;
|
appearance: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,6 +21,8 @@
|
|||||||
user-select: none;
|
user-select: none;
|
||||||
vertical-align: top; // the better option for most scenarios
|
vertical-align: top; // the better option for most scenarios
|
||||||
vertical-align: -webkit-baseline-middle; // the best for those that support it
|
vertical-align: -webkit-baseline-middle; // the best for those that support it
|
||||||
|
|
||||||
|
font-kerning: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
:host([disabled]) {
|
:host([disabled]) {
|
||||||
@ -123,7 +125,6 @@
|
|||||||
|
|
||||||
transition: var(--transition);
|
transition: var(--transition);
|
||||||
|
|
||||||
|
|
||||||
border-width: var(--border-width);
|
border-width: var(--border-width);
|
||||||
border-style: var(--border-style);
|
border-style: var(--border-style);
|
||||||
border-color: var(--border-color);
|
border-color: var(--border-color);
|
||||||
@ -139,11 +140,9 @@
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
opacity: var(--opacity);
|
opacity: var(--opacity);
|
||||||
overflow: var(--overflow);
|
overflow: var(--overflow);
|
||||||
vertical-align: top; // the better option for most scenarios
|
|
||||||
vertical-align: -webkit-baseline-middle; // the best for those that support it
|
|
||||||
z-index: 0;
|
z-index: 0;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
font-kerning: none;
|
|
||||||
appearance: none;
|
appearance: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,6 +18,13 @@
|
|||||||
color: #{current-color(contrast)};
|
color: #{current-color(contrast)};
|
||||||
|
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
|
|
||||||
|
text-align: center;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
text-transform: none;
|
||||||
|
|
||||||
|
white-space: nowrap;
|
||||||
|
font-kerning: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -26,6 +33,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.fab-button-native {
|
.fab-button-native {
|
||||||
|
@include text-inherit();
|
||||||
@include border-radius(50%);
|
@include border-radius(50%);
|
||||||
@include margin(var(--padding-top), var(--padding-end), var(--padding-bottom), var(--padding-start));
|
@include margin(var(--padding-top), var(--padding-end), var(--padding-bottom), var(--padding-start));
|
||||||
|
|
||||||
@ -45,25 +53,14 @@
|
|||||||
|
|
||||||
background: var(--background);
|
background: var(--background);
|
||||||
background-clip: padding-box;
|
background-clip: padding-box;
|
||||||
color: inherit;
|
|
||||||
|
|
||||||
font-size: inherit;
|
|
||||||
font-weight: inherit;
|
|
||||||
|
|
||||||
line-height: var(--size);
|
line-height: var(--size);
|
||||||
|
|
||||||
text-align: center;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
text-transform: none;
|
|
||||||
|
|
||||||
white-space: nowrap;
|
|
||||||
|
|
||||||
box-shadow: var(--box-shadow);
|
box-shadow: var(--box-shadow);
|
||||||
contain: strict;
|
contain: strict;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
z-index: 0;
|
z-index: 0;
|
||||||
font-kerning: none;
|
|
||||||
appearance: none;
|
appearance: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -86,8 +83,6 @@
|
|||||||
flex-flow: row nowrap;
|
flex-flow: row nowrap;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
@ -7,9 +7,18 @@
|
|||||||
pointer-events: all;
|
pointer-events: all;
|
||||||
|
|
||||||
color: #{current-color(base)};
|
color: #{current-color(base)};
|
||||||
|
|
||||||
|
text-align: center;
|
||||||
|
text-decoration: none;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
text-transform: none;
|
||||||
|
|
||||||
|
white-space: nowrap;
|
||||||
|
font-kerning: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
button {
|
button {
|
||||||
|
@include text-inherit();
|
||||||
@include margin(0);
|
@include margin(0);
|
||||||
@include padding(0);
|
@include padding(0);
|
||||||
@include font-smoothing();
|
@include font-smoothing();
|
||||||
@ -30,21 +39,12 @@ button {
|
|||||||
outline: none;
|
outline: none;
|
||||||
|
|
||||||
background: transparent;
|
background: transparent;
|
||||||
color: inherit;
|
|
||||||
|
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
|
|
||||||
text-align: center;
|
|
||||||
text-decoration: none;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
text-transform: none;
|
|
||||||
|
|
||||||
white-space: nowrap;
|
|
||||||
|
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
z-index: 0;
|
z-index: 0;
|
||||||
font-kerning: none;
|
|
||||||
appearance: none;
|
appearance: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,6 +11,12 @@
|
|||||||
--icon-size: 1em;
|
--icon-size: 1em;
|
||||||
|
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
|
||||||
|
text-decoration: none;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
|
||||||
|
white-space: nowrap;
|
||||||
|
font-kerning: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
:host(:first-of-type) .segment-button-native {
|
:host(:first-of-type) .segment-button-native {
|
||||||
@ -30,6 +36,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.segment-button-native {
|
.segment-button-native {
|
||||||
|
@include text-inherit();
|
||||||
@include margin(var(--margin-top), var(--margin-end), var(--margin-bottom), var(--margin-start));
|
@include margin(var(--margin-top), var(--margin-end), var(--margin-bottom), var(--margin-start));
|
||||||
@include padding(var(--padding-top), var(--padding-end), var(--padding-bottom), var(--padding-start));
|
@include padding(var(--padding-top), var(--padding-end), var(--padding-bottom), var(--padding-start));
|
||||||
|
|
||||||
@ -46,22 +53,10 @@
|
|||||||
border-color: var(--border-color);
|
border-color: var(--border-color);
|
||||||
|
|
||||||
background: var(--background);
|
background: var(--background);
|
||||||
color: inherit;
|
|
||||||
|
|
||||||
font-size: inherit;
|
|
||||||
font-weight: inherit;
|
|
||||||
|
|
||||||
text-align: center;
|
|
||||||
text-decoration: none;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
text-transform: inherit;
|
|
||||||
|
|
||||||
white-space: nowrap;
|
|
||||||
|
|
||||||
contain: content;
|
contain: content;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
font-kerning: none;
|
|
||||||
|
|
||||||
&:active,
|
&:active,
|
||||||
&:focus {
|
&:focus {
|
||||||
|
@ -36,13 +36,14 @@
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|
||||||
background: var(--background);
|
background: var(--background);
|
||||||
|
color: var(--color);
|
||||||
}
|
}
|
||||||
|
|
||||||
:host(.ion-color) {
|
:host(.ion-color) {
|
||||||
background: initial;
|
background: initial;
|
||||||
}
|
}
|
||||||
|
|
||||||
:host(.ion-color) .native-textarea {
|
:host(.ion-color) {
|
||||||
color: current-color(base);
|
color: current-color(base);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -73,7 +74,6 @@
|
|||||||
outline: none;
|
outline: none;
|
||||||
|
|
||||||
background: transparent;
|
background: transparent;
|
||||||
color: var(--color);
|
|
||||||
|
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
resize: none;
|
resize: none;
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
--color: #{$toast-ios-title-color};
|
--color: #{$toast-ios-title-color};
|
||||||
|
|
||||||
font-family: $toast-ios-font-family;
|
font-family: $toast-ios-font-family;
|
||||||
|
font-size: $toast-ios-title-font-size;
|
||||||
}
|
}
|
||||||
|
|
||||||
.toast-ios .toast-wrapper {
|
.toast-ios .toast-wrapper {
|
||||||
@ -48,10 +49,6 @@
|
|||||||
|
|
||||||
.toast-ios .toast-message {
|
.toast-ios .toast-message {
|
||||||
@include padding($toast-ios-title-padding-top, $toast-ios-title-padding-end, $toast-ios-title-padding-bottom, $toast-ios-title-padding-start);
|
@include padding($toast-ios-title-padding-top, $toast-ios-title-padding-end, $toast-ios-title-padding-bottom, $toast-ios-title-padding-start);
|
||||||
|
|
||||||
color: var(--color);
|
|
||||||
|
|
||||||
font-size: $toast-ios-title-font-size;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.toast-ios .toast-button {
|
.toast-ios .toast-button {
|
||||||
|
@ -6,9 +6,10 @@
|
|||||||
|
|
||||||
.toast-md {
|
.toast-md {
|
||||||
--background: #{$toast-md-background};
|
--background: #{$toast-md-background};
|
||||||
--color: #{toast-md-title-color};
|
--color: #{$toast-md-title-color};
|
||||||
|
|
||||||
font-family: $toast-md-font-family;
|
font-family: $toast-md-font-family;
|
||||||
|
font-size: $toast-md-title-font-size;
|
||||||
}
|
}
|
||||||
|
|
||||||
.toast-md .toast-wrapper {
|
.toast-md .toast-wrapper {
|
||||||
@ -42,8 +43,4 @@
|
|||||||
|
|
||||||
.toast-md .toast-message {
|
.toast-md .toast-message {
|
||||||
@include padding($toast-md-title-padding-top, $toast-md-title-padding-end, $toast-md-title-padding-bottom, $toast-md-title-padding-start);
|
@include padding($toast-md-title-padding-top, $toast-md-title-padding-end, $toast-md-title-padding-bottom, $toast-md-title-padding-start);
|
||||||
|
|
||||||
color: var(--color);
|
|
||||||
|
|
||||||
font-size: $toast-md-title-font-size;
|
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,8 @@ ion-toast {
|
|||||||
width: $toast-width;
|
width: $toast-width;
|
||||||
height: $toast-width;
|
height: $toast-width;
|
||||||
|
|
||||||
|
color: var(--color);
|
||||||
|
|
||||||
contain: strict;
|
contain: strict;
|
||||||
z-index: $z-index-overlay;
|
z-index: $z-index-overlay;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
|
@ -361,22 +361,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sets correct text align with support for old browsers
|
|
||||||
// @param {string} $direction - text direction
|
|
||||||
// @param {string} $decorator - !important
|
|
||||||
// ----------------------------------------------------------
|
|
||||||
@mixin text-align($direction, $decorator: null) {
|
|
||||||
@if $direction == start {
|
|
||||||
text-align: left;
|
|
||||||
text-align: start $decorator;
|
|
||||||
} @else if $direction == end {
|
|
||||||
text-align: right;
|
|
||||||
text-align: end $decorator;
|
|
||||||
} @else {
|
|
||||||
text-align: $direction $decorator;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add direction for all directions
|
// Add direction for all directions
|
||||||
// @param {string} $dir - Direction on LTR
|
// @param {string} $dir - Direction on LTR
|
||||||
@mixin direction($dir) {
|
@mixin direction($dir) {
|
||||||
|
Reference in New Issue
Block a user