Skip to content

Add assign method to Nodes#1572

Merged
ai merged 2 commits intopostcss:murmurfrom
jonathantneal:jn.node-prototype-assign
May 17, 2021
Merged

Add assign method to Nodes#1572
ai merged 2 commits intopostcss:murmurfrom
jonathantneal:jn.node-prototype-assign

Conversation

@jonathantneal
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

2 participants