Skip to content
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

New admin table layout #1786

Merged
merged 1 commit into from
Mar 27, 2017
Merged

Conversation

tvdeyen
Copy link
Member

@tvdeyen tvdeyen commented Mar 19, 2017

The content of all table headers, state columns and action cells have text wrapping disabled now. For cases where we want to disble text wrapping in data cells we provide the .no-wrap class.

This also makes (very sensitive) use of the Bootstrap default table style. The main advantage is that Bootstrap uses rem (a relative unit) for table cell padding. As we plan to raise the body font size this is a huge win for us.

Before

table-before

After

table-after-13px

@tvdeyen
Copy link
Member Author

tvdeyen commented Mar 19, 2017

@Mandily another preparation for #1777

@tvdeyen tvdeyen requested a review from jhawthorn March 19, 2017 20:02
@tvdeyen tvdeyen added the changelog:solidus_backend Changes to the solidus_backend gem label Mar 19, 2017
Copy link
Contributor

@mamhoff mamhoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes for a much cleaner look.

// If you want to disable this, add the .wrap-text class to the column.
&:not(.wrap-text) {
white-space: nowrap;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about this. I think our default should be to wrap, and to specify areas where wrapping is undesirable (like actions).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the default should be no wrap. Most of the time we display where little information in cells, mostly values (order numbers, email addresses, etc. You don't want to wrap these.

The only occasion where wrapping was useful (not even needed) was the image caption. It would be a much larger change set to add a no-wrapp class to all cells where we want this to happen.

But this is just my preference. I'm also fine with having the opposite being the default. I would then vote for also making the header cells non wrapping. Nobody wants a

"Created
at"

cell, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Took the opposite approach like suggested.

margin-bottom: 15px;
border-collapse: separate;
// Extend all tables with Bootstrap's default table style
@extend .table;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't worse than what was here before (bootstrap's .table sets pretty much the same CSS as we already had here). It would be ideal if we were to move away from styling all table elements like this and instead required a class. That way we avoid needing to un-style the styles when we want a table to be "normal".

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would a "normal" table look like? Browser default? I always thought this is our default table style. But I understand your concern. Im also fine with adding a table class to all tables. The change set will be much larger then, though.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can deal with this later. It's not a new issue and shouldn't block this PR.

@tvdeyen tvdeyen mentioned this pull request Mar 22, 2017
@tvdeyen tvdeyen force-pushed the admin-table-layout branch from 518e0b0 to d3ec27b Compare March 24, 2017 09:32
@tvdeyen
Copy link
Member Author

tvdeyen commented Mar 24, 2017

@jhawthorn I updated the commit and took a more conservative approach. Only table headers, the .actions cell and states have text wrapping disabled. Added a .no-wrap class, so we can decide which cells we want to have text wrapping disabled as well.

localhost-3000-admin-style_guide

The content of all table headers, state columns and action cells have text wrapping disabled now. For cases where we want to disble text wrapping in data cells we provide the `.no-wrap` class.

This also makes (very sensitive) use of the Bootstrap default table style. The main advantage is that Bootstrap uses rem (a relative unit) for table cell padding. As we plan to raise the body font size this is a huge win for us.
Copy link
Contributor

@jhawthorn jhawthorn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Great!

@jhawthorn jhawthorn merged commit 9c4c129 into solidusio:master Mar 27, 2017
@tvdeyen tvdeyen deleted the admin-table-layout branch March 28, 2017 04:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:solidus_backend Changes to the solidus_backend gem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants