-
Notifications
You must be signed in to change notification settings - Fork 11
feat: header functionality for the list view #806
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
Changes from 6 commits
c5148b0
9c9b6b0
f1403f0
b02a5a7
d547d83
6e799a6
cd27f4f
add59cf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,46 +1,59 @@ | ||
| @import 'font'; | ||
| @import 'color-palette'; | ||
|
|
||
| $key-width: 40%; | ||
| $value-width: 60%; | ||
| $margin-left: 12px; | ||
|
|
||
| @mixin grid-view { | ||
| width: 100%; | ||
| padding: 8px 0; | ||
| display: grid; | ||
| grid-template-columns: $key-width $value-width; | ||
| align-content: center; | ||
| } | ||
|
|
||
| .list-view { | ||
| height: 100%; | ||
| width: 100%; | ||
| overflow: auto; | ||
| display: flex; | ||
| flex-direction: column; | ||
|
|
||
| .data-row { | ||
| flex: 0 0 auto; | ||
| min-height: 40px; | ||
| width: 100%; | ||
| word-break: break-word; | ||
| padding: 8px 0; | ||
| & > * { | ||
| @include grid-view(); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice work isolating column width as variables. I think you can just add these grid properties to list-view class. No need to add it in both header and data row with flex column in list view.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed!!
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh I was thinking more like this Is this something we can do?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But then we'll have to put some styles twice like
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if needed for this, we can take this as follow up work. |
||
| } | ||
|
|
||
| display: flex; | ||
| flex-direction: row; | ||
| align-items: center; | ||
| font-size: 15px; | ||
| font-style: normal; | ||
| line-height: 18px; | ||
| .header-row { | ||
| height: 32px; | ||
| background: $gray-1; | ||
| box-shadow: inset 0px -1px 0px $gray-2; | ||
| border-radius: 6px 6px 0px 0px; | ||
|
|
||
| .key { | ||
| flex: 1 1 auto; | ||
| height: 100%; | ||
| width: 40%; | ||
| display: flex; | ||
| align-items: center; | ||
| margin-left: 12px; | ||
| font-weight: 500; | ||
| .header-key-label, | ||
| .header-value-label { | ||
| @include overline; | ||
| margin-left: $margin-left; | ||
| width: 100%; | ||
| } | ||
| } | ||
|
|
||
| .data-row { | ||
| @include font-placeholder(); | ||
| color: $gray-9; | ||
| min-height: 40px; | ||
| word-break: break-word; | ||
|
|
||
| .key, | ||
| .value { | ||
| flex: 1 1 auto; | ||
| height: 100%; | ||
| width: 60%; | ||
| width: 100%; | ||
| display: flex; | ||
| align-items: center; | ||
| margin-left: 12px; | ||
|
|
||
| /* identical to box height, or 120% */ | ||
| letter-spacing: -0.01em; | ||
| margin-left: $margin-left; | ||
| } | ||
| .key { | ||
| font-weight: 500; | ||
| } | ||
| } | ||
|
|
||
|
|
||
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.
list-view could have a huge number of children. In such cases, this does us more harm than good. We should use a class name here instead of the wildcard.