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 assign method to Nodes #1572

Merged
merged 2 commits into from May 17, 2021
Merged

Conversation

jonathantneal
Copy link
Member

This PR adds an assign method to all nodes, allowing authors to assign multiple properties to a node from a single object.

decl.assign({ prop: 'word-wrap', value: 'break-word' })

This can improve code clarity when updating multiple properties while offering a helpful typing experience.

The `assign` function lets authors assign multiple properties to a node from a single object.

This can improve code clarity when updating multiple properties while offering a helpful typing experience.
@ai
Copy link
Member

ai commented May 6, 2021

Looks nice. Just fix CI and I will release it in minor in a next month.

- Fixes the `important` prop of DeclarationProps, which should be optional.
- Adds a test for the `assign` method.
@jonathantneal
Copy link
Member Author

Thanks, @ai. Fixed.

@ai ai changed the base branch from main to murmur May 17, 2021 12:38
@ai ai merged commit 280b4a9 into postcss:murmur May 17, 2021
@ai
Copy link
Member

ai commented May 17, 2021

8.3 will be released when #1582 will be ready

@jonathantneal jonathantneal deleted the jn.node-prototype-assign branch May 17, 2021 12:53
@ai
Copy link
Member

ai commented May 21, 2021

Thanks. Released in 8.3.

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.

None yet

2 participants