Skip to content

Object keys created as UpperCamelCase when converting properties #5

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

Open
christowiz opened this issue Mar 5, 2018 · 2 comments
Open

Comments

@christowiz
Copy link

When converting the following CSS the variable properties come out UpperCamelCase.

Note: This is using PostCSS and cssnext.

Source:

:root {
  --header-gray: '#c8c8c8';
  --hover-gold: '#755e1e';
  --link-color: '#8e7329';
}

Result:

root: {
  HeaderGray: '#c8c8c8',
  HoverGold: '#755e1e',
  LinkColor: '#8e7329'
}

Could this be supported or an option to select upper- or lower-case?

@ryanfitzer
Copy link

The issue is that when a key with the value of --my-variable is split by '-', the returned array that's operated on looks like this:

[
  '',
  '',
  'my',
  'variable'
]

The logic in the map is uppercasing every value after the first index in the array.

The key should first be stripped of leading dashes and underscores so it supports not only future spec CSS variables, but also Vendor-specific extensions.

@DoubleU23
Copy link
Member

will be solved via custom filter injected into "humps"
so it depends on #9

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

3 participants