-
Notifications
You must be signed in to change notification settings - Fork 3.4k
refactor(list): simplify list component scss #9194
Conversation
d80ad21
to
77ff050
Compare
@@ -0,0 +1,300 @@ | |||
/** External component calculations */ | |||
$md-checkbox-width: 3 * $baseline-grid !default; | |||
//TODO(devversion): use shared variable from buttons.scss |
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.
If it's for future work please file an issue and write it's number on the comment
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.
Since it's an issue, which is not depending on that PR, it would make sense to create it.
See #9196
I really like the approach we should consider future work on dense components to behave the same.
|
@EladBezalel - Yeah as discussed in our talk. I'll create a follow-up PR, which makes the dense helpers more generic and usable for other components. I'll create an issue once this PR is available. |
9f48da1
to
1a49b9e
Compare
@@ -99,6 +99,8 @@ $md-list-item-subheader-height: 6 * $baseline-grid !default; | |||
margin-top: $baseline-grid; | |||
margin-bottom: $baseline-grid; | |||
border-radius: 50%; | |||
|
|||
flex-shrink: 0; // Per https://bugs.webkit.org/show_bug.cgi?id=146020 |
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 looks like its resolved already
Status: RESOLVED FIXED
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's resolved in the latest Webkit version, but it's not resolved in the latest Safari version (probably in the Technology Preview).
I tested that on my Mac Book and the bug is still valid.
78eeda9
to
203e2f8
Compare
203e2f8
to
fa8529d
Compare
fa8529d
to
b410e20
Compare
@topherfangio Friendly ping for review if you find some time ;) |
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.
Codewise looks pretty good. Found a few issues when running a visual diff (manual..no automation yet):
You can view my diff along with the comments at You can view comments at https://invis.io/2D8TWLO7S
- The avatars on the Basic Usage > Normal > 3 line item demo appear to be top-aligned instead of middle-aligned (Screens 1 & 2).
- In the same demo, the Dense mode "Classes" section looks better in this PR than in latest, so good work there 👍 (Screens 3 & 4)
- The List Controls demo is vastly different regarding spacing/padding (Screens 5 & 6). Is the PR aligned with the spec?
@@ -381,7 +380,8 @@ function mdListItemDirective($mdAria, $mdConstant, $mdUtil, $timeout) { | |||
secondaryItem = buttonWrapper[0]; | |||
} | |||
|
|||
if (secondaryItem && (!hasClickEvent(secondaryItem) || (!tAttrs.ngClick && isProxiedElement(secondaryItem)))) { | |||
if (secondaryItem && !tAttrs.ngClick && !hasClickEvent(secondaryItem) |
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.
Can you describe why this logic has changed?
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 logic was invalid, but not really often causing any issues.
We should not remove the
md-secondary
class when the element just doesn't have anyng-click
on it (-> this means it will be marked as a proxied element)
- Now it only targets the element for being a proxied element when all conditions are met .
See issue #6152
|
||
expect($rootScope.isChecked).toBeFalsy(); | ||
|
||
var clickListener = listItem[0].querySelector('div'); |
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.
Can we rename this to something more descriptive about the actual container? listener
immediately makes me think this is an event listener rather than a DOM element.
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.
Yeah I agree with that. Just changed and also added a comment :)
b410e20
to
36ce2f0
Compare
36ce2f0
to
545d706
Compare
@devversion can you rebase? |
545d706
to
c406c34
Compare
* Simplifies the List components SCSS * Fixes Dense Mode for List and introduces super elegant approach * Make SCSS more modular by having a base and dynamic variables * Remove unnecessary DOM node level for button wrap. * No longer wrap proxied elements inside of buttons * Multiple Secondary Items should align properly and have consistent spacing. * Dense Mode should not cut characaters on different environments. Fixes angular#6152. Fixes angular#8890 References angular#8482.
c406c34
to
a4ff3c5
Compare
@jelbourn Done. |
This reverts commit 085c5fd.
Fixes angular#6152. Fixes angular#8890. References angular#8482.
@EladBezalel and I had a short meeting and I showed him some of the new approaches.
R: @EladBezalel
Fixes #6152. Fixes #8890 References #8482.