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

Improve internal box model terminology #355

Closed
alexreardon opened this issue Feb 28, 2018 · 0 comments
Closed

Improve internal box model terminology #355

alexreardon opened this issue Feb 28, 2018 · 0 comments

Comments

@alexreardon
Copy link
Collaborator

Currently we use the following language to describe different areas associated with a dimension:

  • withoutMargin: straight from getBoundingClientRect
  • withMargin: we use window.getComputedStyles(el) to pull the margin from the element it and add it to withoutMargin
  • withoutPadding: we use window.getComputedStyles(el) to obtain the elements padding and then we shrink the withoutMargin dimension by this amount.

These terms have grown organically as needs arose. They also directly map to the box model. To reduce friction we should rename our properties to match their box model equivalents

  • withMargin -> marginBox
  • withoutMargin -> paddingBox
  • withoutPadding -> contentBox

For now we are getting away with ignoring borders 😊 but we could look at adding a borderBox as well. Although, we could do this as a seperate task

4

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

No branches or pull requests

1 participant