primer / brand

React components and Primitives for GitHub marketing websites
https://primer.style/brand
MIT License
67 stars 31 forks source link

[modification request] table styling in Prose #692

Open nsolerieu opened 1 month ago

nsolerieu commented 1 month ago

Problem

SWP asked for getting HTML table support for SEO and solution page using the Prose component. It is not supported as of today

Historical context:

Solution

Per discussion between Site and Primer Brand, we would like to implement basic styling (aka- support) for of the <table> markup.

Here is an in-situ suggestion using our text, color, border primitives Image

We cant restrict the amount of column but would highly suggest to limit to 5 or perhaps fix the min-width of <td> and have an overflow-y: scroll Image

I do not recommend using a boxed design to minimize the visual noise and fit the editorial styling we have been moving toward brand-wise Image

Urgency

No major urgency, SWP is working on scaling the template and could use capability anytime

rezrah commented 1 month ago

Discussed at Planning:

nsolerieu commented 1 month ago

Scope

This is not the data table component, we do not have the same control since the user is the one shaping the table DOM structure - thsu we can't create a "shell" only style the native HTML markup


Current version of table styling int he github ecosystem: the blog

Design notes:

Desktop Mobile
Image Image

Test with real content

Without overriding the native behavior of the table markup, things will squich on mobile which is not working on mobile and could use a collapse specific styling with sticky header.

Text content

Desktop Mobile
Image Image

Data

Desktop Mobile
Image Image

Suggestion

The only mobile solution to fix this mobile issue is to collapse and keep the table header for context like the example here. This is achieve by adding a data-label to each <td>

Desktop Mobile
Image Image
nsolerieu commented 3 weeks ago

Primer Brand x Site design

We decided to not pursue the suggested approach for these reasons:

Guidelines