fix(label): move default flex and margin to item (#16461)

This moves item-specific margin and flex values out of label and into item as a slotted style to prevent those styles from leaking into labels further down the tree.

closes #15393
This commit is contained in:
octicon-git-branch(16/)
octicon-tag(16/)
Cam Wiegert
2018-11-26 18:30:17 -06:00
committed by GitHub
gitea-unlock(16/)
parent 09d69b9bf6
commit 723d17b868
octicon-diff(16/tw-mr-1) 8 changed files with 37 additions and 12 deletions

8
core/src/components/item-divider/item-divider.ios.scss
View File

@@ -38,6 +38,14 @@
}
// Material Design Slotted Label
// --------------------------------------------------
::slotted(ion-label) {
@include margin(10px, 8px, 10px, 0);
}
// iOS Item Divider Content
// --------------------------------------------------

8
core/src/components/item-divider/item-divider.md.scss
View File

@@ -31,6 +31,14 @@
}
// Material Design Slotted Label
// --------------------------------------------------
::slotted(ion-label) {
@include margin(13px, 0, 10px, 0);
}
// Material Design Slotted Icon
// --------------------------------------------------

8
core/src/components/item/item.ios.scss
View File

@@ -140,6 +140,14 @@
}
// iOS Slotted Label
// --------------------------------------------------
::slotted(ion-label) {
@include margin(10px, 8px, 10px, 0);
}
// iOS Stacked & Floating Inputs
// --------------------------------------------------

9
core/src/components/item/item.md.scss
View File

@@ -177,6 +177,15 @@
}
// Material Design Slotted Label
// --------------------------------------------------
::slotted(ion-label) {
@include margin(13px, 0, 10px, 0);
}
// Material Design Floating/Stacked Label
// --------------------------------------------------

4
core/src/components/item/item.scss
View File

@@ -213,6 +213,10 @@ button, a {
z-index: 1;
}
::slotted(ion-label) {
flex: 1;
}
// Item Input
// -----------------------------------------

4
core/src/components/label/label.ios.scss
View File

@@ -4,10 +4,6 @@
// iOS Label
// --------------------------------------------------
:host-context(.item) {
@include margin($label-ios-margin-top, $label-ios-margin-end, $label-ios-margin-bottom, $label-ios-margin-start);
}
:host([text-wrap]) {
font-size: $label-ios-text-wrap-font-size;

4
core/src/components/label/label.md.scss
View File

@@ -4,10 +4,6 @@
// Material Design Label
// --------------------------------------------------
:host-context(.item) {
@include margin($label-md-margin-top, $label-md-margin-end, $label-md-margin-bottom, $label-md-margin-start);
}
:host([text-wrap]) {
line-height: $label-md-text-wrap-line-height;
}

4
core/src/components/label/label.scss
View File

@@ -10,12 +10,8 @@
*/
--color: initial;
@include margin(0);
display: block;
flex: 1;
color: var(--color);
font-family: $font-family-base;