-
Notifications
You must be signed in to change notification settings - Fork 354
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
Table theme #426
Table theme #426
Conversation
@Addepar/ice |
I think it's probably better to just allow users to implement their own styles using the provided class names |
but they would have to override many properties in CSS class of our default theme. That's what I want to avoid. If I want to have custom theme, I would create it by my own without overriding default theme. |
In general, addon/styles should only include the bare minimum of CSS required for the addon to function as there is no way for the user to exclude the styles from the build. If a user doesn't want our default styles, they probably also don't want to ship it to all of their users. We can either include the styles in app/styles where they can be optionally imported, or better yet style it internally. We'll likely be creating a second addon to extract the table components we use, so that's the most natural place to add those styles. |
Done. I would rather move the style to |
addon/components/ember-table.js
Outdated
@@ -19,7 +19,7 @@ const SELECTION_MODE_MULTIPLE = 'multiple'; | |||
|
|||
export default class EmberTable2 extends Component { | |||
@property attributeBindings = ['style:style']; | |||
@property classNames = ['et-table']; | |||
@property classNameBindings = ['tableClass']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert this, we should just allow users to style it themselves, no need to add custom class names
addon/components/ember-table.js
Outdated
@@ -57,6 +57,11 @@ export default class EmberTable2 extends Component { | |||
@property selectionMode = 'single'; | |||
|
|||
/** | |||
* Theme of this table. Override this property to have custom theme for the table. | |||
*/ | |||
@property tableTheme = 'et-default-theme'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed
addon/components/ember-table.js
Outdated
@@ -105,6 +110,12 @@ export default class EmberTable2 extends Component { | |||
|
|||
@property lastSelectedIndex = -1; | |||
|
|||
@computed('tableTheme') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed
tests/dummy/app/styles/app.scss
Outdated
@@ -26,3 +26,70 @@ | |||
.custom-row { | |||
background: green; | |||
} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should all be moved to /app/styles/ember-table/default.scss
, not in the Dummy app. Check out how ice-pop
and other internal addons work, this allows users to import the styles optionally.
Done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be under a subdirectory, otherwise it can overwrite other users styles. app/styles/ember-table/default.scss
Why does it override user's style? I thought for SASS, if you don't import it, it won't be used? |
The contents of the |
Done |
Allow table to have custom theme.