Skip to content

Commit 62fef17

Browse files
tsilvapMartijnCuppens
authored andcommitted
Declare font-size mixin for less and add tests (#129)
1 parent c483bca commit 62fef17

File tree

15 files changed

+83
-1
lines changed

15 files changed

+83
-1
lines changed

less.less

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,11 @@
230230
}
231231
}
232232

233-
// The responsive-font-size mixin uses RFS to rescale font sizes
233+
// The font-size & responsive-font-size mixins use RFS to rescale font sizes
234+
.font-size(@fs, @important: false) {
235+
.rfs(@fs, @important);
236+
}
237+
234238
.responsive-font-size(@fs, @important: false) {
235239
.rfs(@fs, @important);
236240
}

test/expected/test-1.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,9 @@
4242
@media (max-width: 1200px) {
4343
.selector-8 {
4444
font-size: calc(1.325rem + 0.9vw) ; } }
45+
46+
.selector-9 {
47+
font-size: 2rem; }
48+
@media (max-width: 1200px) {
49+
.selector-9 {
50+
font-size: calc(1.325rem + 0.9vw) ; } }

test/expected/test-10.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,10 @@
4848
.selector-8 {
4949
font-size: calc(16px + 2vmin) ;
5050
min-width: 0vw; } }
51+
52+
.selector-9 {
53+
font-size: 32px; }
54+
@media (max-width: 50rem), (max-height: 50rem) {
55+
.selector-9 {
56+
font-size: calc(16px + 2vmin) ;
57+
min-width: 0vw; } }

test/expected/test-2.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,6 @@
2424

2525
.selector-8 {
2626
font-size: 2rem; }
27+
28+
.selector-9 {
29+
font-size: 2rem; }

test/expected/test-3.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,11 @@
5353
@media (max-width: 1200px) {
5454
.selector-8 {
5555
font-size: calc(1.325rem + 0.9vw) ; } }
56+
57+
.selector-9,
58+
.disable-responsive-font-size .selector-9, .selector-9.disable-responsive-font-size {
59+
font-size: 2rem; }
60+
61+
@media (max-width: 1200px) {
62+
.selector-9 {
63+
font-size: calc(1.325rem + 0.9vw) ; } }

test/expected/test-4.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,9 @@
4242
@media (max-width: 1200px) {
4343
.enable-responsive-font-size .selector-8, .selector-8.enable-responsive-font-size {
4444
font-size: calc(1.325rem + 0.9vw) ; } }
45+
46+
.selector-9 {
47+
font-size: 2rem; }
48+
@media (max-width: 1200px) {
49+
.enable-responsive-font-size .selector-9, .selector-9.enable-responsive-font-size {
50+
font-size: calc(1.325rem + 0.9vw) ; } }

test/expected/test-5.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,9 @@
4242
@media (max-width: 75em) {
4343
.selector-8 {
4444
font-size: calc(1.325rem + 0.9vw) ; } }
45+
46+
.selector-9 {
47+
font-size: 2rem; }
48+
@media (max-width: 75em) {
49+
.selector-9 {
50+
font-size: calc(1.325rem + 0.9vw) ; } }

test/expected/test-6.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,9 @@
4242
@media (max-width: 1200px) {
4343
.selector-8 {
4444
font-size: calc(1.15625rem + 1.125vw) ; } }
45+
46+
.selector-9 {
47+
font-size: 2rem; }
48+
@media (max-width: 1200px) {
49+
.selector-9 {
50+
font-size: calc(1.15625rem + 1.125vw) ; } }

test/expected/test-7.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,9 @@
4242
@media (max-width: 1200px) {
4343
.selector-8 {
4444
font-size: calc(21.2px + 0.9vw) ; } }
45+
46+
.selector-9 {
47+
font-size: 32px; }
48+
@media (max-width: 1200px) {
49+
.selector-9 {
50+
font-size: calc(21.2px + 0.9vw) ; } }

test/expected/test-8.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,9 @@
4242
@media (max-width: 1200px), (max-height: 1200px) {
4343
.selector-8 {
4444
font-size: calc(1.325rem + 0.9vmin) ; } }
45+
46+
.selector-9 {
47+
font-size: 2rem; }
48+
@media (max-width: 1200px), (max-height: 1200px) {
49+
.selector-9 {
50+
font-size: calc(1.325rem + 0.9vmin) ; } }

0 commit comments

Comments
 (0)