Skip to content

Instantly share code, notes, and snippets.

Created October 8, 2013 05:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/6879748 to your computer and use it in GitHub Desktop.
Save anonymous/6879748 to your computer and use it in GitHub Desktop.
After thinking through it again, I think we have the following options:
* class
* classes
* className
* classNames
* cssClass
* cssClasses
* elementClass
* elementClasses
I would use the *singular* form here, as we expect a *string* and not an array currently.
This way, we could use the *plural form* later in a non-breaking manner. This leaves us with:
* class -> very generic, to be confused with @class from TypoScript
* className
* cssClass
* elementClass
For the "image" object, we add the class directly to the <image> tag, not to the <figure>
surrounding it. so we might add "imageClass" / "imgClass" / "imageClassName" / "imgClassName" to the list in that case?
* imageClass
Image {
className = 'my-image-class'
}
Image {
cssClass = 'my-image-class'
}
Image {
elementClass = 'my-image-class'
}
Image {
imageClass = 'my-image-class'
}
Image {
imgClass = 'my-image-class'
}
Image {
imageClassName = 'my-image-class'
}
Image {
imgClassName = 'my-image-class'
}
MultiColumn {
className = 'fooo'
}
MultiColumn {
cssClass = 'foo'
}
MultiColumn {
elementClass = 'foo'
}
Some more (unsorted) arguments:
* ember uses "elementId" to set the ID property of an element
* Backbone uses "className", same as Ember.JS
After looking through that list, I'm tending towards "className" for the general CSS classes,
and then it must be either "imageClassName" or "imgClassName" for the class applied to <img>.
@bwaidelich
Copy link

Image.cssClassSelector = 'foo bar'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment