Skip to content

Commit

Permalink
Merge pull request #6 from Polymer/ui-polish
Browse files Browse the repository at this point in the history
Add focus state for shop-button
  • Loading branch information
frankiefu committed May 16, 2016
2 parents 8501111 + ca753f1 commit 90550af
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 24 deletions.
33 changes: 32 additions & 1 deletion src/shop-button.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,53 @@
box-sizing: border-box;
border: 2px solid #000;
background-color: #FFF;
font-weight: 500;
font-size: 14px;
font-weight: 500;
color: var(--app-primary-color);
margin: 0;
padding: 8px 44px;
text-align: center;
text-decoration: none;
text-transform: uppercase;
border-radius: 0;
outline: none;
-webkit-appearance: none;
}

shop-button > *:focus {
background-color: #c5cad3;
}

shop-button > *:active {
background-color: #000;
color: #FFF;
}

@media (max-width: 767px) {

/* Responsive buttons are used in shop-detail, shop-cart and shop-checkout */
shop-button[responsive] {
@apply(--layout-fixed-bottom);
height: 64px;
z-index: 1;
}

shop-button[responsive] > * {
background-color: var(--app-accent-color);
border: none;
color: white;
padding: 20px;
width: 100%;
height: 100%;
font-size: 15px;
}

shop-button[responsive] > *:focus {
background-color: var(--app-accent-color);
}

}

</style>
</template>
</dom-module>
2 changes: 1 addition & 1 deletion src/shop-cart.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ <h1>Your Cart</h1>
</div>
<div class="checkout-box">
Total: <span class="subtotal">[[_formatTotal(total)]]</span>
<shop-button class="action-btn">
<shop-button responsive>
<a href="/checkout">Checkout</a>
</shop-button>
</div>
Expand Down
6 changes: 3 additions & 3 deletions src/shop-checkout.html
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ <h2>Order Summary</h2>
<div class="flex">Total</div>
<div>[[_formatPrice(total)]]</div>
</div>
<shop-button class="action-btn" id="submitBox">
<shop-button responsive id="submitBox">
<input type="button" on-tap="_submit" value="Place Order">
</shop-button>
</section>
Expand All @@ -394,7 +394,7 @@ <h2>Order Summary</h2>
<header state="success">
<h1>Thanks for your purchase!</h1>
<p>[[response.successMessage]]</p>
<shop-button class="action-btn">
<shop-button responsive>
<a href="/">Finish</a>
</shop-button>
</header>
Expand All @@ -403,7 +403,7 @@ <h1>Thanks for your purchase!</h1>
<header state="error">
<h1>We couldn&acute;t process your order</h1>
<p id="errorMessage">[[response.errorMessage]]</p>
<shop-button class="action-btn">
<shop-button responsive>
<a href="/checkout">Try again</a>
</shop-button>
</header>
Expand Down
19 changes: 1 addition & 18 deletions src/shop-common-styles.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
font-size: 12px;
}

header > .action-btn {
header > kart-button[responsive] {
margin-top: 20px;
}

Expand All @@ -44,23 +44,6 @@
font-size: 1.1em;
}

/* Action Buttons are used in shop-detail, shop-cart and shop-checkout */
.action-btn {
@apply(--layout-fixed-bottom);
height: 64px;
z-index: 1;
}

.action-btn > * {
background-color: var(--app-accent-color);
border: none;
color: white;
padding: 20px;
width: 100%;
height: 100%;
font-size: 15px;
}

}

</style>
Expand Down
2 changes: 1 addition & 1 deletion src/shop-detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ <h1>[[item.title]]</h1>
<h4>Description</h4>
<p id="desc"></p>
</div>
<shop-button class="action-btn">
<shop-button responsive>
<button on-tap="_addToCart" aria-label="Add this item to cart">Add to Cart</button>
</shop-button>
</div>
Expand Down

0 comments on commit 90550af

Please sign in to comment.