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

[jss-plugin-camel-case] Support css vars better #1017

Merged
merged 4 commits into from
Feb 2, 2019

Conversation

HenriBeck
Copy link
Member

What would you like to add/fix?
Currently, css variables are also being hyphenated.

Corresponding issue (if exists): #1012

@HenriBeck HenriBeck requested a review from kof February 2, 2019 18:18
@@ -12,7 +12,9 @@ function convertCase(style) {
const converted = {}

for (const prop in style) {
converted[hyphenate(prop)] = style[prop]
const key = prop.startsWith('--') ? prop : hyphenate(prop)
Copy link
Member

Choose a reason for hiding this comment

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

created a bench, https://esbench.com/bench/5c55f3b54cd7e6009ef620ec
prop[0] === '-' && prop[1] === '-' seems to be much faster, its on a level where it probably doesn't matter but still kinda nice to have

@HenriBeck HenriBeck merged commit b14d1ac into master Feb 2, 2019
@HenriBeck HenriBeck deleted the camel-case-plugin/support-css-vars branch February 2, 2019 22:18
HenriBeck pushed a commit that referenced this pull request Feb 2, 2019
…g' into feat/themed-styles-misuse-warning

* origin/feat/themed-styles-misuse-warning:
  [react-jss] Export the context as __Context from react-jss (#1014)
  [jss-plugin-camel-case] Support css vars better (#1017)
  [docs] Add badges to readmes (#1016)
  Revert "Add tests for css variables in camel case plugins"
  Revert "Fix css variables being hyphenated"
  Revert "Run prettier"
  Run prettier
  Fix css variables being hyphenated
  Add tests for css variables in camel case plugins
HenriBeck pushed a commit that referenced this pull request Feb 12, 2019
… update-jss-types

* jss-plugin-rule-value-function/fix-process-styles: (35 commits)
  Add formatting TS files
  Update typings
  Use types jss definitions
  Fix TS type definitions (#1030)
  v10.0.0-alpha.10
  Update publish scripts (#1027)
  [docs] Update SSR setup with react-jss (#1018)
  temporarily remove the link to the docs, we need perma links instead #1006
  [jss] Update SheetsManager (#1019)
  warn consumers if themed styles are misused. fix #1005 (#1006)
  Added TypeScript Usage documentation for React JSS (#1009)
  [react-jss] Export the context as __Context from react-jss (#1014)
  [jss-plugin-camel-case] Support css vars better (#1017)
  [docs] Add badges to readmes (#1016)
  Revert "Add tests for css variables in camel case plugins"
  Revert "Fix css variables being hyphenated"
  Revert "Run prettier"
  Run prettier
  Fix css variables being hyphenated
  Add tests for css variables in camel case plugins
  ...

# Conflicts:
#	packages/jss/src/index.d.ts
bhupinderbola pushed a commit to bhupinderbola/jss that referenced this pull request Sep 17, 2019
* Add failing tests

* Fix tests

* Update changelog

* Format code
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