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

Allow kebab-cased icons (1.0) #369

Closed
joukevandermaas opened this issue May 9, 2016 · 4 comments · Fixed by #370
Closed

Allow kebab-cased icons (1.0) #369

joukevandermaas opened this issue May 9, 2016 · 4 comments · Fixed by #370

Comments

@joukevandermaas
Copy link
Contributor

Currently the master/1.0 branch only allows underscored icon names:

{{paper-icon 'all_out'}}

However, in released (0.2) ember paper, people are used to kebab cased/dasherized icon names:

{{paper-icon 'all-out'}}

I propose the master/1.0 version also supports dashes, and just converts them to underscores using Ember's underscore function. We should keep the benefits of ligatures, while allowing an easier upgrade path.

To be clear, this means underscore (all_out), spaces (all out), dashes (all-out) and even camel cased (allOut) will all render the ligature all_out. This should be a completely backwards compatible change.

@DanChadwick
Copy link
Contributor

this is going to be a pretty small portion of the upgrade work and it seems a shame to add complexity when a global find would let a developer convert a typical app in a few minutes. How about an assert instead?

@joukevandermaas
Copy link
Contributor Author

IMO making the migration easier and friendlier should be an important goal. It feels like the change from dashes to underscores is arbitrary (even if it isn't). Maybe a find-all will indicate all the occurrences, but there are few developers (in my experience) who could actually write the global find/replace regex to fix them all.

Besides, there is a very low cost (or complexity) to supporting both, because Ember already provides a function for converting the strings. I think the benefits more than outweigh the (tiny) costs.

@miguelcobain
Copy link
Collaborator

@DanChadwick I'd also like to support dasherized names. It aligns better with everything else (we don't have underscores anywhere).

Also, I hope they'll make this change on material icons upstream. Makes so much sense to use the same name as in the classes.
Also, please +1 this issue: google/material-design-icons#184
:P

@miguelcobain
Copy link
Collaborator

From slack:
This should be implemented as an underscore helper, so that the value is cached and we don't incur in a big performance penalty.

joukevandermaas added a commit to joukevandermaas/ember-paper that referenced this issue May 10, 2016
miguelcobain pushed a commit that referenced this issue May 10, 2016
* Add support for kebab-case icon names

Closes #369

* Add back support for icon sizes

Closes #358

* Address comments from code review

* Update changelog
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 a pull request may close this issue.

3 participants