Skip to content

Commit 3c8fa05

Browse files
committed
MAGETWO-39422: [UI] Assistance with applying new style for Credit card validation
1 parent f92176b commit 3c8fa05

File tree

10 files changed

+40
-16
lines changed

10 files changed

+40
-16
lines changed
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading

app/code/Magento/Payment/view/frontend/web/template/payment/cc-form.html

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,6 @@
55
*/
66
-->
77

8-
<style>
9-
.credit-card-types div.active{
10-
font-weight: bold;
11-
}
12-
</style>
13-
148
<fieldset data-bind="attr: {class: 'fieldset payment items ccard ' + getCode(), id: 'payment_form_' + getCode()}">
159
<!-- ko if: (isShowLegend())-->
1610
<legend class="legend">
@@ -22,18 +16,24 @@
2216
<span><!-- ko text: $t('Credit Card Type')--><!-- /ko --></span>
2317
</label>
2418
<div class="control">
25-
<div class="credit-card-types">
19+
<ul class="credit-card-types">
2620
<!-- ko foreach: {data: getCcAvailableTypesValues(), as: 'item'} -->
27-
<div data-bind="css: {active: $parent.selectedCardType() == item.value} ">
28-
<!-- ko text: item.type --><!-- /ko -->
29-
</div>
21+
<li class="item" data-bind="css: {_active: $parent.selectedCardType() == item.value} ">
22+
<!-- if picture -->
23+
<img data-bind="attr: {
24+
'src': 'Magento_Payment::images/cc/'+ item.value + '.png',
25+
'alt': item.type
26+
}">
27+
<!-- if NOpicture -->
28+
<span><!-- ko text: item.type --><!-- /ko --></span>
29+
</li>
3030
<!--/ko-->
31-
<input type="hidden"
32-
name="payment[cc_number]"
33-
class="input-text"
34-
value=""
35-
data-bind="attr: {id: getCode() + '_cc_type'}, value: creditCardType">
36-
</div>
31+
</ul>
32+
<input type="hidden"
33+
name="payment[cc_number]"
34+
class="input-text"
35+
value=""
36+
data-bind="attr: {id: getCode() + '_cc_type'}, value: creditCardType">
3737
</div>
3838
</div>
3939
<div class="field number required">

app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/checkout/_payment-options.less

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,30 @@
7272
.payment-option-inner {
7373
margin: 0 0 @indent__base;
7474
}
75+
76+
.credit-card-types {
77+
padding: 0;
78+
.item {
79+
display: inline-block;
80+
list-style: none;
81+
margin: 0 @indent__xs 0 0;
82+
&._active {
83+
font-weight: @font-weight__bold;
84+
img {
85+
-webkit-filter: grayscale(0%);
86+
filter: grayscale(0%);
87+
filter: none;
88+
}
89+
}
90+
}
91+
img {
92+
-webkit-filter: grayscale(100%); // For Webkit browsers
93+
-webkit-transition: all .6s ease; // Fade to color for Chrome and Safari
94+
filter: grayscale(100%);
95+
filter: gray; // For IE 6 - 9
96+
filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale"); // Firefox 10+, Firefox on Android
97+
}
98+
}
7599
}
76100
}
77101

0 commit comments

Comments
 (0)