mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 20:33:32 +08:00
fix(button): bar-button uses inner span as flexbox
- Fixed block/full buttons, now there are display: block - Fixes <ion-segment-button> warnings
This commit is contained in:
@ -97,7 +97,6 @@ $button-ios-small-icon-font-size: 1.3em !default;
|
|||||||
margin-right: 0;
|
margin-right: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// iOS Full Button
|
// iOS Full Button
|
||||||
// --------------------------------------------------
|
// --------------------------------------------------
|
||||||
|
|
||||||
@ -105,11 +104,10 @@ $button-ios-small-icon-font-size: 1.3em !default;
|
|||||||
margin-right: 0;
|
margin-right: 0;
|
||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
border-left: none;
|
border-right-width: 0;
|
||||||
border-right: none;
|
border-left-width: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// iOS Outline Button
|
// iOS Outline Button
|
||||||
// --------------------------------------------------
|
// --------------------------------------------------
|
||||||
|
|
||||||
|
@ -110,28 +110,25 @@ $button-md-small-icon-font-size: 1.4em !default;
|
|||||||
font-size: $button-md-small-icon-font-size;
|
font-size: $button-md-small-icon-font-size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Material Design Block Button
|
||||||
|
// --------------------------------------------------
|
||||||
|
|
||||||
|
.button-block {
|
||||||
|
margin-left: 0;
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
|
|
||||||
// Material Design Full Button
|
// Material Design Full Button
|
||||||
// --------------------------------------------------
|
// --------------------------------------------------
|
||||||
|
|
||||||
.button-full {
|
.button-full {
|
||||||
border-radius: 0;
|
|
||||||
margin-right: 0;
|
margin-right: 0;
|
||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
|
border-radius: 0;
|
||||||
border-right-width: 0;
|
border-right-width: 0;
|
||||||
border-left-width: 0;
|
border-left-width: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Material Design Block Button
|
|
||||||
// --------------------------------------------------
|
|
||||||
|
|
||||||
.button-block {
|
|
||||||
margin-right: 0;
|
|
||||||
margin-left: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Material Design Outline Button
|
// Material Design Outline Button
|
||||||
// --------------------------------------------------
|
// --------------------------------------------------
|
||||||
|
|
||||||
|
@ -29,9 +29,10 @@ $button-round-border-radius: 64px !default;
|
|||||||
@include appearance(none);
|
@include appearance(none);
|
||||||
}
|
}
|
||||||
|
|
||||||
span.button-inner {
|
.button-inner {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
flex-flow: row nowrap;
|
flex-flow: row nowrap;
|
||||||
@ -39,7 +40,7 @@ span.button-inner {
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
a.button {
|
a.button, a[button] {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -54,7 +55,7 @@ a.button {
|
|||||||
// --------------------------------------------------
|
// --------------------------------------------------
|
||||||
|
|
||||||
.button-block {
|
.button-block {
|
||||||
display: flex;
|
display: block;
|
||||||
clear: both;
|
clear: both;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
@ -68,6 +69,7 @@ a.button {
|
|||||||
// --------------------------------------------------
|
// --------------------------------------------------
|
||||||
|
|
||||||
.button-full {
|
.button-full {
|
||||||
|
display: block;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ class MyCmpTest{}
|
|||||||
<button><ion-icon name="star"></ion-icon></button>
|
<button><ion-icon name="star"></ion-icon></button>
|
||||||
</ion-buttons>
|
</ion-buttons>
|
||||||
<ion-buttons end>
|
<ion-buttons end>
|
||||||
<button>S1</button>
|
<button>S1g</button>
|
||||||
</ion-buttons>
|
</ion-buttons>
|
||||||
</ion-navbar>
|
</ion-navbar>
|
||||||
<ion-content>
|
<ion-content>
|
||||||
@ -190,6 +190,9 @@ class FullPage {
|
|||||||
template: `
|
template: `
|
||||||
<ion-navbar *navbar primary>
|
<ion-navbar *navbar primary>
|
||||||
<ion-title>Primary Color Page Header</ion-title>
|
<ion-title>Primary Color Page Header</ion-title>
|
||||||
|
<ion-buttons end>
|
||||||
|
<button>S1g</button>
|
||||||
|
</ion-buttons>
|
||||||
</ion-navbar>
|
</ion-navbar>
|
||||||
<ion-content padding>
|
<ion-content padding>
|
||||||
<p><button class="e2eFrom3To2" (click)="nav.pop()">Pop</button></p>
|
<p><button class="e2eFrom3To2" (click)="nav.pop()">Pop</button></p>
|
||||||
|
@ -9,7 +9,7 @@ import {App, Page, NavController} from 'ionic/ionic';
|
|||||||
</ion-navbar>
|
</ion-navbar>
|
||||||
|
|
||||||
<ion-content padding>
|
<ion-content padding>
|
||||||
<button block (click)="pushPage()">Push Page</block>
|
<button block (click)="pushPage()">Push Page</button>
|
||||||
</ion-content>`,
|
</ion-content>`,
|
||||||
})
|
})
|
||||||
class FirstPage {
|
class FirstPage {
|
||||||
@ -30,7 +30,7 @@ class FirstPage {
|
|||||||
|
|
||||||
<ion-content padding>
|
<ion-content padding>
|
||||||
<h1>Second page</h1>
|
<h1>Second page</h1>
|
||||||
<button block (click)="insertPage()">Insert Page</block>
|
<button block (click)="insertPage()">Insert Page</button>
|
||||||
</ion-content>
|
</ion-content>
|
||||||
`
|
`
|
||||||
})
|
})
|
||||||
|
@ -94,10 +94,12 @@ class ToolbarBackground {
|
|||||||
template:
|
template:
|
||||||
'<div class="toolbar-background"></div>' +
|
'<div class="toolbar-background"></div>' +
|
||||||
'<button class="back-button bar-button bar-button-default" [hidden]="hideBackButton">' +
|
'<button class="back-button bar-button bar-button-default" [hidden]="hideBackButton">' +
|
||||||
|
'<span class="button-inner">' +
|
||||||
'<ion-icon class="back-button-icon" [name]="_bbIcon"></ion-icon>' +
|
'<ion-icon class="back-button-icon" [name]="_bbIcon"></ion-icon>' +
|
||||||
'<span class="back-button-text">' +
|
'<span class="back-button-text">' +
|
||||||
'<span class="back-default">{{_bbText}}</span>' +
|
'<span class="back-default">{{_bbText}}</span>' +
|
||||||
'</span>' +
|
'</span>' +
|
||||||
|
'</span>' +
|
||||||
'</button>' +
|
'</button>' +
|
||||||
'<ng-content select="[menuToggle],ion-buttons[left]"></ng-content>' +
|
'<ng-content select="[menuToggle],ion-buttons[left]"></ng-content>' +
|
||||||
'<ng-content select="ion-buttons[start]"></ng-content>' +
|
'<ng-content select="ion-buttons[start]"></ng-content>' +
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
<ion-toolbar>
|
<ion-toolbar>
|
||||||
<ion-title>This is the title that never ends. It just goes on and on my friend.</ion-title>
|
<ion-title>This is the title that never ends. It just goes on and on my friend.</ion-title>
|
||||||
</ion-toolbar>
|
</ion-toolbar>
|
||||||
@ -62,9 +61,9 @@
|
|||||||
|
|
||||||
<ion-toolbar>
|
<ion-toolbar>
|
||||||
<ion-buttons start>
|
<ion-buttons start>
|
||||||
<button solid class="activated">
|
<a button solid class="activated">
|
||||||
<ion-icon name="contact"></ion-icon>
|
<ion-icon name="contact"></ion-icon>
|
||||||
</button>
|
</a>
|
||||||
<button solid class="activated">
|
<button solid class="activated">
|
||||||
<ion-icon name="contact"></ion-icon>
|
<ion-icon name="contact"></ion-icon>
|
||||||
Solid
|
Solid
|
||||||
@ -126,14 +125,27 @@
|
|||||||
</button>
|
</button>
|
||||||
</ion-buttons>
|
</ion-buttons>
|
||||||
<ion-buttons end>
|
<ion-buttons end>
|
||||||
<button>
|
<a button href="#">Edit
|
||||||
Edit
|
|
||||||
<ion-icon name="create"></ion-icon>
|
<ion-icon name="create"></ion-icon>
|
||||||
</button>
|
</a>
|
||||||
</ion-buttons>
|
</ion-buttons>
|
||||||
<ion-title>Icon/Color Attr</ion-title>
|
<ion-title>Icon/Color Attr</ion-title>
|
||||||
</ion-toolbar>
|
</ion-toolbar>
|
||||||
|
|
||||||
|
<ion-toolbar>
|
||||||
|
<ion-buttons start>
|
||||||
|
<button>
|
||||||
|
Go Back
|
||||||
|
</button>
|
||||||
|
</ion-buttons>
|
||||||
|
<ion-buttons end>
|
||||||
|
<a button href="#">
|
||||||
|
Edit
|
||||||
|
</a>
|
||||||
|
</ion-buttons>
|
||||||
|
<ion-title>Text Only</ion-title>
|
||||||
|
</ion-toolbar>
|
||||||
|
|
||||||
|
|
||||||
<ion-toolbar>
|
<ion-toolbar>
|
||||||
<button menuToggle>
|
<button menuToggle>
|
||||||
@ -167,10 +179,10 @@
|
|||||||
</button>
|
</button>
|
||||||
</ion-buttons>
|
</ion-buttons>
|
||||||
<ion-segment secondary>
|
<ion-segment secondary>
|
||||||
<ion-segment-button>
|
<ion-segment-button value="something">
|
||||||
Something
|
Something
|
||||||
</ion-segment-button>
|
</ion-segment-button>
|
||||||
<ion-segment-button>
|
<ion-segment-button value="else">
|
||||||
Else
|
Else
|
||||||
</ion-segment-button>
|
</ion-segment-button>
|
||||||
</ion-segment>
|
</ion-segment>
|
||||||
@ -178,13 +190,13 @@
|
|||||||
|
|
||||||
<ion-toolbar>
|
<ion-toolbar>
|
||||||
<ion-segment>
|
<ion-segment>
|
||||||
<ion-segment-button>
|
<ion-segment-button value="light">
|
||||||
Light
|
Light
|
||||||
</ion-segment-button>
|
</ion-segment-button>
|
||||||
<ion-segment-button>
|
<ion-segment-button value="toolbar">
|
||||||
Toolbar
|
Toolbar
|
||||||
</ion-segment-button>
|
</ion-segment-button>
|
||||||
<ion-segment-button>
|
<ion-segment-button value="default">
|
||||||
Default Segment
|
Default Segment
|
||||||
</ion-segment-button>
|
</ion-segment-button>
|
||||||
</ion-segment>
|
</ion-segment>
|
||||||
|
@ -5,11 +5,7 @@
|
|||||||
|
|
||||||
.bar-button {
|
.bar-button {
|
||||||
position: relative;
|
position: relative;
|
||||||
display: inline-flex;
|
display: inline-block;
|
||||||
flex-shrink: 0;
|
|
||||||
flex-flow: row nowrap;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
|
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
@ -19,6 +15,7 @@
|
|||||||
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
text-transform: none;
|
text-transform: none;
|
||||||
|
line-height: 1;
|
||||||
|
|
||||||
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
|
||||||
@ -54,7 +51,7 @@
|
|||||||
.back-button {
|
.back-button {
|
||||||
display: none;
|
display: none;
|
||||||
&.show-back-button {
|
&.show-back-button {
|
||||||
display: flex;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,7 +62,6 @@ ion-navbar-section {
|
|||||||
.toolbar-title {
|
.toolbar-title {
|
||||||
font-size: $toolbar-ios-title-font-size;
|
font-size: $toolbar-ios-title-font-size;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
margin-top: 1px;
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
pointer-events: auto;
|
pointer-events: auto;
|
||||||
color: $toolbar-ios-text-color;
|
color: $toolbar-ios-text-color;
|
||||||
@ -123,10 +122,8 @@ ion-buttons[right] {
|
|||||||
// --------------------------------------------------
|
// --------------------------------------------------
|
||||||
|
|
||||||
.bar-button {
|
.bar-button {
|
||||||
margin-top: 0;
|
|
||||||
margin-bottom: 0;
|
|
||||||
padding: 0 5px;
|
padding: 0 5px;
|
||||||
min-height: 32px;
|
height: 32px;
|
||||||
border: 0;
|
border: 0;
|
||||||
font-size: $toolbar-ios-button-font-size;
|
font-size: $toolbar-ios-button-font-size;
|
||||||
border-radius: $bar-button-ios-border-radius;
|
border-radius: $bar-button-ios-border-radius;
|
||||||
@ -225,7 +222,6 @@ ion-buttons[right] {
|
|||||||
// --------------------------------------------------
|
// --------------------------------------------------
|
||||||
|
|
||||||
.bar-button-icon-left ion-icon {
|
.bar-button-icon-left ion-icon {
|
||||||
margin-left: -0.1em;
|
|
||||||
padding-right: 0.3em;
|
padding-right: 0.3em;
|
||||||
font-size: 1.4em;
|
font-size: 1.4em;
|
||||||
line-height: 0.67;
|
line-height: 0.67;
|
||||||
@ -257,7 +253,6 @@ ion-buttons[right] {
|
|||||||
|
|
||||||
.back-button {
|
.back-button {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
margin-top: 2px;
|
|
||||||
min-height: 3.2rem;
|
min-height: 3.2rem;
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
order: map-get($toolbar-order-ios, back-button);
|
order: map-get($toolbar-order-ios, back-button);
|
||||||
@ -268,8 +263,9 @@ ion-buttons[right] {
|
|||||||
.back-button-icon {
|
.back-button-icon {
|
||||||
display: inherit;
|
display: inherit;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
margin-top: -1px;
|
||||||
min-width: 18px;
|
min-width: 18px;
|
||||||
font-size: 3.3rem;
|
font-size: 3.4rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.back-button-text {
|
.back-button-text {
|
||||||
|
@ -125,7 +125,7 @@ ion-buttons[right] {
|
|||||||
margin-left: 0.2rem;
|
margin-left: 0.2rem;
|
||||||
margin-right: 0.2rem;
|
margin-right: 0.2rem;
|
||||||
padding: 0 5px;
|
padding: 0 5px;
|
||||||
min-height: 32px;
|
height: 32px;
|
||||||
border: 0;
|
border: 0;
|
||||||
font-size: $toolbar-md-button-font-size;
|
font-size: $toolbar-md-button-font-size;
|
||||||
border-radius: $bar-button-md-border-radius;
|
border-radius: $bar-button-md-border-radius;
|
||||||
@ -226,7 +226,6 @@ ion-buttons[right] {
|
|||||||
// --------------------------------------------------
|
// --------------------------------------------------
|
||||||
|
|
||||||
.bar-button-icon-left ion-icon {
|
.bar-button-icon-left ion-icon {
|
||||||
margin-left: -0.1em;
|
|
||||||
padding-right: 0.3em;
|
padding-right: 0.3em;
|
||||||
font-size: 1.4em;
|
font-size: 1.4em;
|
||||||
line-height: 0.67;
|
line-height: 0.67;
|
||||||
|
Reference in New Issue
Block a user