Ticketfly-UI / ember-css-composer

CSS Class Name Macros
MIT License
2 stars 0 forks source link

Initial work #2

Closed spencer516 closed 7 years ago

spencer516 commented 7 years ago

@ksin @BrianSipple @melissaroman

There's a ton to review here. I'll go through and make some initial notes to clarify what's going on here.

ksin commented 7 years ago

Looks like most of these changes are tests and processing in lib/, so I'll take my time reviewing those later, but an immediate question I have is, how does this handle dynamically created class names?

Example: https://github.com/Ticketfly-UI/ember-ticketfly-buttons/blob/master/addon/components/tf-button/component.js#L24

@tf-button--${group} isn't enough here.

spencer516 commented 7 years ago

For now, it'd just be a matter of importing the "classifier" directly — so, in your example:

import classify from 'ember-css-composer/classify';

....

  buttonCategory: computed('utilityGroups', {
    get() {
      return get(this, 'utilityGroups')
        .compact()
        .map(group => classify(`tf-button--${group}`))
        .join(' ');
    }
  })

Though, I do want to put some more thought into that.