Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate values #4

Open
dmitrykiselyov opened this issue Feb 1, 2014 · 0 comments
Open

Duplicate values #4

dmitrykiselyov opened this issue Feb 1, 2014 · 0 comments

Comments

@dmitrykiselyov
Copy link

Great mixins, thanks!

Issue:

.margin(10px, 10px);

duplicate values:

margin: 10px 10px;
margin: 1rem 10px;
margin: 10px 1rem;
margin: 1rem 1rem;

whith padding(10px, 10px) same issue

Solution: add condition not

.margin(@vertical, @horizontal) 
when (ispixel(@vertical)) and not (ispixel(@horizontal)){
    @rem-value: ~`pxtorem('@{vertical}')`;
    .margin(@rem-value, @horizontal);
}
.margin(@vertical, @horizontal) 
when (ispixel(@horizontal)) and not (ispixel(@vertical)){
    @rem-value: ~`pxtorem('@{horizontal}')`;
    .margin(@vertical, @rem-value);
}

same for padding

but it would be better to implement solution from Anton Syuvaev

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

No branches or pull requests

1 participant