Skip to content

Update _pxToEm.scss#163

Merged
mobywhale-chan merged 1 commit intostubbornella:masterfrom
MrFjords:patch-1
Jul 9, 2013
Merged

Update _pxToEm.scss#163
mobywhale-chan merged 1 commit intostubbornella:masterfrom
MrFjords:patch-1

Conversation

@MrFjords
Copy link
Contributor

@MrFjords MrFjords commented Jul 9, 2013

Added a check for if the value 'auto' is passed to the function to deal with cases where auto is desired as an output. for example:

margin: pxToEm(20px auto, 16px); would output -> margin: 1.25em auto;

Added a check for if the value 'auto' is passed to the function to deal with cases where auto is desired as an output.  for example:

margin: pxToEm(20px auto, 16px); would output -> margin: 1.25em auto;
@stubbornella
Copy link
Owner

@mobywhale-chan can you code review this PR?

@mobywhale-chan
Copy link
Collaborator

@MrFjords Looks good. Thanks!

mobywhale-chan added a commit that referenced this pull request Jul 9, 2013
@mobywhale-chan mobywhale-chan merged commit 7bc58bf into stubbornella:master Jul 9, 2013
@drublic
Copy link

drublic commented Jul 9, 2013

You might also want to use percentage based or other values.
I personally use something similar to

@if $value == 0 or type_of($value) != number

in my px to rem mixin over here.

It might be interesting to use a mixin like that for rem too and combine it with the fontSizes mixin.

@MrFjords MrFjords deleted the patch-1 branch July 9, 2013 17:04
@MrFjords
Copy link
Contributor Author

MrFjords commented Jul 9, 2013

If I've needed to use percentages along with ems I tend to go with something like this:

margin: pxToEm(20px, 16px) percentage(20px/$widthOfContent);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants