-
Notifications
You must be signed in to change notification settings - Fork 304
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #475 from openkraken/feat/rem-em
feat: support rem and em unit
- Loading branch information
Showing
42 changed files
with
1,222 additions
and
392 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+725 Bytes
(110%)
integration_tests/snapshots/css/css-flexbox/align-items.ts.c4b9cf121.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.35 KB
integration_tests/snapshots/css/css-position/position-sticky.ts.454f0a8f1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.34 KB
integration_tests/snapshots/css/css-position/position-sticky.ts.454f0a8f2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,255 @@ | ||
describe("em", () => { | ||
it("should works with style of font size", async () => { | ||
let div; | ||
let div2; | ||
let div3; | ||
div = createElement( | ||
"div", | ||
{ | ||
style: { | ||
position: "relative", | ||
width: "200px", | ||
height: "200px", | ||
backgroundColor: "green" | ||
} | ||
}, | ||
[ | ||
(div2 = createElement( | ||
"div", | ||
{ | ||
style: { | ||
width: "150px", | ||
height: "150px", | ||
backgroundColor: "yellow" | ||
} | ||
}, | ||
[ | ||
(div3 = createElement( | ||
"div", | ||
{ | ||
style: { | ||
fontSize: "2em", | ||
width: "100px", | ||
height: "100px", | ||
backgroundColor: "blue" | ||
} | ||
}, | ||
[createText("font-size")] | ||
)) | ||
] | ||
)) | ||
] | ||
); | ||
|
||
BODY.appendChild(div); | ||
|
||
await snapshot(); | ||
}); | ||
|
||
it("should works with style other than font size", async () => { | ||
let div; | ||
let div2; | ||
let div3; | ||
div = createElement( | ||
"div", | ||
{ | ||
style: { | ||
position: "relative", | ||
width: "200px", | ||
height: "200px", | ||
backgroundColor: "green" | ||
} | ||
}, | ||
[ | ||
(div2 = createElement( | ||
"div", | ||
{ | ||
style: { | ||
width: "150px", | ||
height: "150px", | ||
backgroundColor: "yellow" | ||
} | ||
}, | ||
[ | ||
(div3 = createElement( | ||
"div", | ||
{ | ||
style: { | ||
width: "8em", | ||
height: "100px", | ||
backgroundColor: "blue" | ||
} | ||
}, | ||
[createText("font-size")] | ||
)) | ||
] | ||
)) | ||
] | ||
); | ||
|
||
BODY.appendChild(div); | ||
|
||
await snapshot(); | ||
}); | ||
|
||
it("should works with font size of own change", async (done) => { | ||
let div; | ||
let div2; | ||
let div3; | ||
div = createElement( | ||
"div", | ||
{ | ||
style: { | ||
position: "relative", | ||
width: "200px", | ||
height: "200px", | ||
backgroundColor: "green" | ||
} | ||
}, | ||
[ | ||
(div2 = createElement( | ||
"div", | ||
{ | ||
style: { | ||
width: "150px", | ||
height: "150px", | ||
backgroundColor: "yellow" | ||
} | ||
}, | ||
[ | ||
(div3 = createElement( | ||
"div", | ||
{ | ||
style: { | ||
width: "5em", | ||
height: "100px", | ||
backgroundColor: "blue" | ||
} | ||
}, | ||
[createText("font-size")] | ||
)) | ||
] | ||
)) | ||
] | ||
); | ||
|
||
BODY.appendChild(div); | ||
|
||
await snapshot(); | ||
|
||
window.requestAnimationFrame(async () => { | ||
div3.style.fontSize = '30px'; | ||
await snapshot(); | ||
done(); | ||
}) | ||
|
||
}); | ||
|
||
it("should works with font size of parent change when own element has no font size", async (done) => { | ||
let div; | ||
let div2; | ||
let div3; | ||
div = createElement( | ||
"div", | ||
{ | ||
style: { | ||
position: "relative", | ||
width: "200px", | ||
height: "200px", | ||
backgroundColor: "green" | ||
} | ||
}, | ||
[ | ||
(div2 = createElement( | ||
"div", | ||
{ | ||
style: { | ||
width: "150px", | ||
height: "150px", | ||
backgroundColor: "yellow" | ||
} | ||
}, | ||
[ | ||
(div3 = createElement( | ||
"div", | ||
{ | ||
style: { | ||
width: "5em", | ||
height: "100px", | ||
backgroundColor: "blue" | ||
} | ||
}, | ||
[createText("font-size")] | ||
)) | ||
] | ||
)) | ||
] | ||
); | ||
|
||
BODY.appendChild(div); | ||
|
||
await snapshot(); | ||
|
||
window.requestAnimationFrame(async () => { | ||
div.style.fontSize = '30px'; | ||
await snapshot(); | ||
done(); | ||
}) | ||
|
||
}); | ||
|
||
it("should works with font size of parent change when own element has font size", async (done) => { | ||
let div; | ||
let div2; | ||
let div3; | ||
div = createElement( | ||
"div", | ||
{ | ||
style: { | ||
position: "relative", | ||
width: "200px", | ||
height: "200px", | ||
backgroundColor: "green" | ||
} | ||
}, | ||
[ | ||
(div2 = createElement( | ||
"div", | ||
{ | ||
style: { | ||
width: "150px", | ||
height: "150px", | ||
backgroundColor: "yellow" | ||
} | ||
}, | ||
[ | ||
(div3 = createElement( | ||
"div", | ||
{ | ||
style: { | ||
fontSize: '20px', | ||
width: "5em", | ||
height: "100px", | ||
backgroundColor: "blue" | ||
} | ||
}, | ||
[createText("font-size")] | ||
)) | ||
] | ||
)) | ||
] | ||
); | ||
|
||
BODY.appendChild(div); | ||
|
||
await snapshot(); | ||
|
||
window.requestAnimationFrame(async () => { | ||
div.style.fontSize = '30px'; | ||
await snapshot(); | ||
done(); | ||
}) | ||
|
||
}); | ||
|
||
}); |
Oops, something went wrong.