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

Try using a scaling value in combination with calc() #20

Closed
rijkvanzanten opened this issue Feb 28, 2017 · 1 comment
Closed

Try using a scaling value in combination with calc() #20

rijkvanzanten opened this issue Feb 28, 2017 · 1 comment

Comments

@rijkvanzanten
Copy link

F.e. this

:root {
  --margin-none: 0;
  --margin-small: 1em;
  --margin-medium: 2em;
  --margin-big: 3em;
}

el {
  margin: --margin-medium;
}

could be rewritten as

:root {
  --scale: 1;
}

el {
  margin: calc(2em * --scale);
}

That way, when editing the scale, you don't have to edit each version of the variable

@dandevri
Copy link
Owner

dandevri commented Mar 1, 2017

That's a really good tip! Only need to use one variable to change the whole whitespace of a document.

@dandevri dandevri closed this as completed Mar 1, 2017
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

2 participants