Skip to content

Commit 74a718b

Browse files
author
Oleg Zinoviev
committed
MAGETWO-31855: UI improvements
- removed mixins with rem dublicating functionality.
1 parent 3b9abbf commit 74a718b

File tree

3 files changed

+42
-50
lines changed

3 files changed

+42
-50
lines changed

lib/web/css/source/lib/resets.less

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,9 @@
4343

4444
img {
4545
border: 0;
46-
max-width: 100%;
47-
height: auto;
4846
}
4947

48+
img,
5049
object,
5150
video,
5251
embed {

lib/web/css/source/lib/typography.less

Lines changed: 36 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,8 @@
2323

2424
// Rem font size
2525
.font-size(@sizeValue) when not (ispercentage(@sizeValue)) and not (@sizeValue = false) {
26-
@value: unit(@sizeValue);
27-
@remValue: (@value / @font-rem-ratio);
28-
@pxValue: @value;
29-
font-size: ~"@{remValue}rem";
26+
.to-rem(@sizeValue);
27+
font-size: @valueRem;
3028
}
3129

3230
.font-size(@sizeValue) when (ispercentage(@sizeValue)) and not (@sizeValue = false) {
@@ -35,10 +33,8 @@
3533

3634
// Rem line height
3735
.line-height(@heightValue) when not (@heightValue = false) and not (ispercentage(@heightValue)) {
38-
@value: unit(@heightValue);
39-
@remValue: (@value / @font-rem-ratio);
40-
@pxValue: @value;
41-
line-height: ~"@{remValue}rem";
36+
.to-rem(@heightValue);
37+
line-height: @valueRem;
4238
}
4339

4440
.line-height(@heightValue) when (ispercentage(@heightValue)) and not (@heightValue = false) {
@@ -147,7 +143,14 @@
147143
@@_line-height,
148144
@@_font-style
149145
);
150-
.margin-vertical-rem(@@_margin-top, @@_margin-bottom);
146+
& {
147+
.to-rem(@@_margin-top);
148+
margin-top: @valueRem;
149+
}
150+
& {
151+
.to-rem(@@_margin-bottom);
152+
margin-bottom: @valueRem;
153+
}
151154
}
152155

153156
//
@@ -165,7 +168,14 @@
165168
}
166169

167170
p {
168-
.margin-vertical-rem(@p-margin-top, @p-margin-bottom);
171+
& {
172+
.to-rem(@p-margin-top);
173+
margin-top: @valueRem;
174+
}
175+
& {
176+
.to-rem(@p-margin-bottom);
177+
margin-bottom: @valueRem;
178+
}
169179
}
170180

171181
// Abbreviations and acronyms
@@ -279,10 +289,24 @@
279289
.typography-lists() {
280290
ul,
281291
ol {
282-
.margin-vertical-rem(@list-margin-top, @list-margin-bottom);
292+
& {
293+
.to-rem(@list-margin-top);
294+
margin-top: @valueRem;
295+
}
296+
& {
297+
.to-rem(@list-margin-bottom);
298+
margin-bottom: @valueRem;
299+
}
283300
//.typography(@list-font-size-base, @list-color-base);
284301
> li {
285-
.margin-vertical-rem(@list-item-margin-top, @list-item-margin-bottom);
302+
& {
303+
.to-rem(@list-item-margin-top);
304+
margin-top: @valueRem;
305+
}
306+
& {
307+
.to-rem(@list-item-margin-bottom);
308+
margin-bottom: @valueRem;
309+
}
286310
}
287311
ul,
288312
ol {

lib/web/css/source/lib/utilities.less

Lines changed: 5 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,11 @@
22
// * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com)
33
// */
44

5-
.margin-top-rem(
6-
@value
7-
) when not (@value = false) and not (@value = '') {
8-
@_value: unit(@value);
9-
margin-top: @_value * 1rem / @font-rem-ratio;
10-
}
11-
12-
.margin-bottom-rem(
13-
@value
14-
) when not (@value = false) and not (@value = '') {
15-
@_value: unit(@value);
16-
margin-bottom: @_value * 1rem / @font-rem-ratio;
17-
}
18-
19-
.margin-vertical-rem(@val-top, @val-bottom) {
20-
.margin-top-rem(@val-top);
21-
.margin-bottom-rem(@val-bottom);
22-
}
23-
24-
.padding-top-rem(
25-
@value
26-
) when not (@value = false) and not (@value = '') {
27-
@_value: unit(@value);
28-
padding-top: @_value * 1rem / @font-rem-ratio;
29-
}
30-
31-
.padding-bottom-rem(
32-
@value
33-
) when not (@value = false) and not (@value = '') {
34-
@_value: unit(@value);
35-
padding-bottom: @_value * 1rem / @font-rem-ratio;
36-
}
37-
38-
.padding-vertical-rem(@val-top, @val-bottom) {
39-
.padding-top-rem(@val-top);
40-
.padding-bottom-rem(@val-bottom);
5+
// convert to rem
6+
.to-rem(
7+
@_value
8+
) when not (@_value = false) and not (@_value = '') {
9+
@valueRem: (unit(@_value) * 1rem) / @font-rem-ratio;
4110
}
4211

4312
.visibility-hidden() {

0 commit comments

Comments
 (0)