cssinjs / jss

JSS is an authoring tool for CSS which uses JavaScript as a host language.
https://cssinjs.org
MIT License
7.06k stars 397 forks source link

[jss-nested] Camel case $refs not found (looking for kebab case) #790

Closed ingermarie closed 5 years ago

ingermarie commented 5 years ago

When trying to reference existing camel case classes with the following: styles.addRule('class': ['& > $existingCamelCaseClass']: {...}) ...an error will be thrown: Warning: [JSS] Could not find the referenced rule existing-camel-case-class in Styles.

Rigging for looking up camel case classes would be a welcome feature, worst case an option would suffice. Please comment if any further information regarding environment is required.

Versions: "jss": "^9.8.7", "jss-nested": "^6.0.1"

source: http://cssinjs.org/jss-nested?v=v6.0.1#use-rulename-to-reference-a-local-rule-within-the-same-style-sheet

HenriBeck commented 5 years ago

Could you please create a codesandbox with the minimal amount of code to reproduce your bug?

EDIT: Seems to be working for me: https://codesandbox.io/s/7k7w390wz0

HenriBeck commented 5 years ago

Maybe check your order of plugins.

See: http://cssinjs.org/plugins?v=v9.8.7

Sent with GitHawk

ingermarie commented 5 years ago

Looks like it was the order of plugins that caused it (i.e. camel case was used before nested) Thank you for the swift reply! :)

kof commented 5 years ago

looks like @HenriBeck is by now better than me in doing the guess work