Skip to content

Conversation

Arthie
Copy link
Contributor

@Arthie Arthie commented Mar 28, 2020

This PR prevents CSS variable properties from being camel-cased they are case sensitive and should not be converted.

var root = parse('@media screen { }')
expect(postcssJS.objectify(root)).toEqual({
'@media screen': { }
'@media screen': {}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove this change from the pull request? Just push a new commit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok no problem fixed it!

@ai
Copy link
Member

ai commented Mar 28, 2020

Thanks. I will release it in the next major release with PostCSS 8.0 API changes.

@ai
Copy link
Member

ai commented Mar 28, 2020

One more thing — we need to mention it in docs.

Can you add a variable to some example? https://github.com/postcss/postcss-js#usage

@Arthie
Copy link
Contributor Author

Arthie commented Mar 29, 2020

Sure, I added a variable to the example.

README.md Outdated

postcssJs.objectify(root) //=> { '@media screen': { zIndex: '1' } }
postcssJs.objectify(root) //=> {
// --text-color: '#DD3A0A',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JS object will have quotes here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed!

@ai ai merged commit 89e9c88 into postcss:master Mar 29, 2020
@ai
Copy link
Member

ai commented Mar 29, 2020

Thanks. Be ready for a few weeks before PostCSS 8.0 release.

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