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

Add calc support for margin and padding #175

Merged
merged 1 commit into from
Sep 7, 2024
Merged

Conversation

BramMeerten
Copy link
Contributor

@BramMeerten BramMeerten commented Jun 26, 2024

Add support for calc for margin and padding. Other properties such as width, top, ... already support calc.

More properties should support calc, but I haven't included them all in this PR:

  • background-position: calc(100% - 0%) calc(100% - 10%). Not included because parse function splits on whitespace, but whitespace can also occur inside calc parentheses.
  • border-bottom-width (and other "length" types): uses parseLength (from parsers.js), didn't want to change because too many usages. It could be done though, for example parseMeasurement already allows calc.

This PR should fix #154

@BramMeerten BramMeerten changed the title Add support for margin and padding #154 Add calc support for margin and padding #154 Jun 26, 2024
@BramMeerten BramMeerten changed the title Add calc support for margin and padding #154 Add calc support for margin and padding Jul 5, 2024
@BramMeerten
Copy link
Contributor Author

@domenic could you please have a look at this small PR?

@domenic domenic merged commit 25bace5 into jsdom:main Sep 7, 2024
3 checks passed
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.

Allow usage of calc for margins
2 participants