Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions components/screen.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
@import "utils/imageReplacement";
@import "utils/hide";

/* Functions */
@import "utils/pxToEm";


/* ==========================================================================
Video
========================================================================== */
Expand Down
12 changes: 12 additions & 0 deletions components/utils/_pxToEm.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* Convert px to em
*
* @param $px - the value in pixel you want to convert
* @param $context - the context in pixel e.g. you want to set margin on your text,
* and font size on your text is equivalent to 14px, then your context is 14.
*/

@function pxToEm ($px, $context){
$em: ($px/$context) * 1em;
@return $em;
}