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

Uppercase characters not supported in function names? #1

Closed
rlapoele opened this issue Apr 29, 2015 · 3 comments
Closed

Uppercase characters not supported in function names? #1

rlapoele opened this issue Apr 29, 2015 · 3 comments

Comments

@rlapoele
Copy link

Hello Max,

Thanks for the 2 less plugins you created (lists & this functions one) - I personally think both are much needed addition to less. 👍
I played with this less-plugin-functions yesterday and couldn't get it to work when I used uppercase characters in my funtion names.

Example:

.function-getStyleNamespace { return: "namespace-"; }

@style-ns: getStyleNamespace(); 
@{style-ns}box { display: block; color: black; }

Output:


.function-getStyleNamespace {
  return: "namespace-";
}
getStyleNamespace()box {
  display: block;
  color: black;
}

If I lowercase the function name then everything works fine.

Regards,
R.

@seven-phases-max
Copy link
Owner

Less inherits case-insensitivity from CSS, so when you call a function it's name is always internally converted to lowercase... e.g. getstylenamespace. The plugin can't do anything about this (it uses also internal Less mixin search and there the matching is case-sensitive). Thus the camel style of naming is unfortunate and CSS-like naming (e.g. .function-get-style-space) is preferred.

@seven-phases-max
Copy link
Owner

Closing as expected behaviour (yes, sort of bug, but can only be fixed within the Less core).

@rlapoele
Copy link
Author

rlapoele commented May 2, 2015

Hi,
Ok - I understand.
Thanks for taking the time to reply & to explain.
Thanks again for both your lists & functions plugins.

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

2 participants