-
Notifications
You must be signed in to change notification settings - Fork 1
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
[k82] Add table styles #34
Conversation
@@ -1,6 +1,6 @@ | |||
{ | |||
"name": "@wealthbar/peak-style", | |||
"version": "1.7.5", | |||
"version": "2.0.0", |
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 this styles the <table>
element, it can be considered a breaking change. I've recently done a pre-remptive fix to try to prevent any breaks in WB.
scss/base/tables.scss
Outdated
&:hover { background-color: $neutral-50 } | ||
} | ||
|
||
th, td { padding: 0.5rem 0 0.5rem 0.5rem; } |
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.
In a table you can't just slap padding on a <tr>
so here we are
scss/base/tables.scss
Outdated
// TABLE VARIANT - smaller text | ||
// this class can be applied to the <table> to shrink all text in the table | ||
&.text-small { | ||
font-size: 14px; |
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.
pixels! Not our favourite unit - rems?
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.
fixed, thanks.
scss/base/tables.scss
Outdated
thead { | ||
font-weight: bold; | ||
border-bottom: 1px solid $neutral-300; | ||
font-size: 14px; |
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.
0.875rem
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.
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.
is it tho? 😛
scss/base/tables.scss
Outdated
// intended for use on a row to create a 'total' or 'summary' row style with bold text | ||
.bold { | ||
font-weight: bold; | ||
} |
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.
I think this is already covered by the .strong
class (global) in typography.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.
Right you are, removed it here and updated documentation accordingly
scss/base/tables.scss
Outdated
// this class can be applied to any <th> or <td> | ||
.right { | ||
text-align: right; | ||
} |
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.
I think this could be globalized in the typography styles. Thoughts on that? (.center
already exists there)
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.
Sounds gravy to me. I've made the update.
Note that .center
is not documented anywhere on the typography page. I've not blazed that trail, but I've mentioned both in documentation for tables.
|
||
thead, th { | ||
font-weight: bold; | ||
font-size: 0.875rem; |
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.
are table headers always going to be small
??
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.
yep
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.
just saying this seems exactly like a thing a desinger is going to change in a comp.
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 in the design specs, I dunno what else to tell ya:
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.
Fair enough. For my sanity can you check w/ Julian to make sure he wants ALL tables to have small headers (JIC)
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 is now Julian-confirmed for sanity.
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.
❤️
scss/base/tables.scss
Outdated
// TEXT VARIANT - hyperlink | ||
// applying .link-row-target to a string will give it a link-like appearance | ||
// when the mouse is hovered anywhere over the containing row | ||
.link-row-target { |
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.
I get what is happening here with the targeted cell but this creates a scenario where the linked row has no visible "link" highlight text by default.
IMO it makes more sense to highlight (and underline! – it is a link) all text in the row by default and create a variant for the scenario where we only want to target one cell for highlight. Thoughts?
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.
I think it's easy to imagine a scenario in which a table has many coumns, and there's a need to be clear about where the link goes. For example on k82, the columns show date, client, bank number, and a recent comment. The link's target is specific to the bank numbers. There could be multiple rows for that client, but the two rows would not link to the same place, so it makes sense to emphasize the unique target of the link.
It is true that this makes it possible to mark up a table without a defualt emphasized string, but designers should understand the design pattern here and shouldn't ask us to do that. It's also possible to mark up a tab UI with tabs that contain no content, or mark up a page with a top-level h2 and then have subheadings as h1s. That doesn't mean design is going to ask us to do those things. There's no precedent that sets an expectation that wrong markup should be impossible.
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.
but designers should understand the design pattern here and shouldn't ask us to do that.
LOL.
From an interaction perspective within Peak anything that is a link defaults to $primary and the text has SOME form of hover/focus activated state. Like literally everything has this — the original Peak team defined it as such.
My questions for Julian would be: why is this different? And, how does text read as a link? The hover state mirrors that of a "standard" table but with green as opposed to grey. If there was no hover state on standard tables there would be enough differentiation to read as a link, but because non-link tables have this feature it just reads (to me anyway) as a variant — cursor changes and too subtle and not enough.
If you want I can discuss this with Julian whaile you move on but I really think this is something that should be addressed.
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.
I'm hearing two concerns:
The 'contrast' concern - that the hover style has insufficient contrast.
The 'link' concern - that the link style can be incomplete if not used correctly.
Regarding the contrast: well we could measure it and see if it's up to accessibility standards.
Regarding the link: Can we think of any scenarios where applying the link style to EVERY column is a good idea? Example: You come across a table with columns date, client, bank number, and comment. They all look the same. What will happen when you click? Are you gonna see details about the client? Are you gonna see all activity for the date? Are you going to read the full version of the trancated column? Or, is each column linked separately? Will you go somewhere different depending hwich column you click on? You can't answer this question, so that's not a good solution.
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.
re: contrast: I'd say its more differentiation and readability as a link the contrast per se.
re:link: yes, want to avoid ambiguity of usage as much as possible.
I actually really like the example scenario you gave because it highlights an interesting point: Is applying the link style to EVERY column is a good idea?
In the case we have now we are doing exactly that — highlighting every column in a row and making the whole thing a click target. Where does it go? what AM I going to see? is it this? or that? When in fact it is really just one column or part of a column that is the "link".
Maybe this is being over designed and over built.
if a user sees a green text w/ underline are they going to assume the whole row is a link target by default? probably not unless we tell/infer that it is (which is what we are doing with this interaction). Looking at this:
If we remove the row highlight, would the user not infer that the Desjardin -> Motus
is the link? and really when THAT text highlights my gut would say ~80% of user would click on THAT text. I think this is a worth while interaction to get right and I think you make really valid points on this. TBH we should probably take this back to Julian and discuss the interaction and inference on this with him IMHO.
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.
scss/base/tables.scss
Outdated
|
||
td { | ||
padding-top: 0.75rem; | ||
padding-bottom: 0.75rem; |
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.
why is cell padding different on link rows?
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.
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.
For what it's worth, the design around this has undergone a pretty rigorous design phase. It was designed for k82, then revisited for Peak which involed putting the full specs together and a review within the design department. Not to put too fine a point on it, but at this stage I'd like to gloss over this question.
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.
Ok just seems odd to have a potentally different row in the mix…
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.
a few minor comments but nothing cray. Maybe just verify w/ Julian on some of the implementation details.
|
||
thead, th { | ||
font-weight: bold; | ||
font-size: 0.875rem; |
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.
Fair enough. For my sanity can you check w/ Julian to make sure he wants ALL tables to have small headers (JIC)
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.
Summary
k82's staff-facing UI requires tables.
https://paper.dropbox.com/doc/Tables--A3H49z0w6_fBe746G5FDNyQ~Ag-cUlKW2nUBzFD9b9MgvLXm
Changes are documented in this peak-design-system PR:
WealthBar/peak-design-system#43
Scope
The scope of this addition is to cover the use case of k82: staff-facing desktop view. The above documentation contains a few such notes about k82 scope. Some aspects of the complete table design will be marked for completion ASAP after release of k82.
Testing
You should be able to mark up a table in Wealthbar and have these new styles work well.
<th>
or<td>
by applying the style.right
<th>
actually uses a smaller font sizetext-small
<th>
gets a bold text style.bold
.link-row-target
Screenshot of WIP table as it will be used in k82:
![Screen Shot 2020-07-06 at 11 58 02 AM](https://user-images.githubusercontent.com/53101170/86639205-6a200a00-bf8d-11ea-9280-970392ebd52e.png)
Additionally, this new table style should not affect any existing table styles in WB. A PR was recently merged to solve known cases where it would interfere, if you find more please let me know
Submitter Checklist
Reviewer Checklist: