Skip to content

Commit

Permalink
fix(item): detail context based in text color
Browse files Browse the repository at this point in the history
  • Loading branch information
manucorporat committed Oct 8, 2018
1 parent f00be0d commit e51f1f3
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 33 deletions.
11 changes: 0 additions & 11 deletions core/src/components/item/item.ios.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
--background-activated: #{$item-ios-background-color-active};
--border-color: #{$item-ios-border-bottom-color};
--color: #{$item-ios-text-color};
--detail-icon-color: #{$item-ios-border-bottom-color};
--highlight-height: 0;
--highlight-color-focused: #{$item-ios-input-highlight-color};
--highlight-color-valid: #{$item-ios-input-highlight-color-valid};
Expand Down Expand Up @@ -125,16 +124,6 @@
@include margin(($item-ios-padding-end / 2));
}

// iOS Item Detail Push
// --------------------------------------------------

.item-detail-icon {
color: var(--detail-icon-color);

font-size: 20px;
}


// TODO: MOVE FROM RADIO
// iOS Radio Item Label: Checked
// -----------------------------------------
Expand Down
15 changes: 4 additions & 11 deletions core/src/components/item/item.md.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
// --------------------------------------------------

:host {
--background: var(--ion-item-background-color, transparent);
--background-activated: #{$item-md-background-color-active};
--border-color: #{$item-md-border-bottom-color};
--color: #{$item-md-text-color};
--transition: background-color 300ms cubic-bezier(.4, 0, .2, 1);
--padding-start: #{$item-md-padding-start};
--background: var(--ion-item-background-color, transparent);
Expand All @@ -14,7 +18,6 @@
--border-color: #{$item-md-border-bottom-color};
--inner-padding-end: #{$item-md-padding-end / 2};
--inner-border-width: #{0 0 $item-md-border-bottom-width 0};
--detail-icon-color: #{$item-md-border-bottom-color};
--highlight-height: 2px;
--highlight-color-focused: #{$item-md-input-highlight-color};
--highlight-color-valid: #{$item-md-input-highlight-color-valid};
Expand Down Expand Up @@ -67,16 +70,6 @@
--show-inset-highlight: 0;
}

// Material Design Item Detail Push
// --------------------------------------------------

.item-detail-icon {
color: var(--detail-icon-color);

font-size: 20px;
}


// Material Design Item Slots
// --------------------------------------------------

Expand Down
21 changes: 16 additions & 5 deletions core/src/components/item/item.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
* @prop --color: Color of the item
*
* @prop --detail-icon-color: Color of the item detail icon
*
* @prop --detail-icon-opacity: Opacity of the item detail icon
* @prop --detail-icon-font-size: Font size of the item detail icon
* @prop --inner-border-width: Width of the item inner border
* @prop --inner-box-shadow: Box shadow of the item inner
* @prop --inner-padding-bottom: Bottom padding of the item inner
Expand Down Expand Up @@ -52,6 +53,9 @@
--inner-box-shadow: none;
--show-full-highlight: 0;
--show-inset-highlight: 0;
--detail-icon-color: currentColor;
--detail-icon-font-size: 20px;
--detail-icon-opacity: 0.25;

@include font-smoothing();

Expand Down Expand Up @@ -83,10 +87,6 @@
border-color: current-color(shade);
}

:host(.ion-color) .item-detail-icon {
color: current-color(shade);
}


// Activated Item
// --------------------------------------------------
Expand Down Expand Up @@ -188,6 +188,17 @@ button, a {
box-sizing: border-box;
}

// Item Detail Icon
// -----------------------------------------

.item-detail-icon {
color: var(--detail-icon-color);

font-size: var(--detail-icon-font-size);

opacity: var(--detail-icon-opacity);
}


// Item Slots
// -----------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion core/src/components/item/test/buttons/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<ion-label>a[ion-item] secondary</ion-label>
</ion-item>

<ion-item button id="attachClick">
<ion-item button color="dark" id="attachClick">
<ion-label>button[ion-item]</ion-label>
</ion-item>

Expand Down
10 changes: 5 additions & 5 deletions core/src/components/item/test/colors/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ <h1>Heading</h1>
</ion-label>
</ion-item>

<ion-item color="dark">
<ion-item button color="dark">
<ion-label>
<h1>Heading</h1>
<p>Paragraph</p>
Expand All @@ -49,13 +49,13 @@ <h1>Heading</h1>
</ion-label>
</ion-item>

<ion-item onclick="testClick(event)" color="secondary">
<ion-item button onclick="testClick(event)" color="secondary">
<ion-label>
button[ion-item]
</ion-label>
</ion-item>

<ion-item onclick="testClick(event)" color="secondary" class="activated">
<ion-item button onclick="testClick(event)" color="secondary" class="activated">
<ion-label>
button[ion-item].activated secondary
</ion-label>
Expand All @@ -70,7 +70,7 @@ <h1>Heading</h1>
<ion-button slot="end" fill="outline">Outline</ion-button>
</ion-item>

<ion-item onclick="testClick(event)" color="dark">
<ion-item button onclick="testClick(event)" color="dark">
<ion-button slot="start">
<ion-icon slot="start" name="home"></ion-icon>
Left Icon
Expand All @@ -83,7 +83,7 @@ <h1>Heading</h1>
</ion-label>
</ion-item>

<ion-item onclick="testClick(event)" disabled color="dark">
<ion-item button onclick="testClick(event)" disabled color="dark">
<ion-button slot="start">
<ion-icon slot="start" name="home"></ion-icon>
Left Icon
Expand Down

0 comments on commit e51f1f3

Please sign in to comment.