Skip to content

Commit

Permalink
docs: elements > code > accordion + table layout tweaks (#1613)
Browse files Browse the repository at this point in the history
* docs: elements > code > accordion + table layout tweaks

* docs: code table design revisions

* docs: darken code table mobile/hover row color

* docs: move Code page accordion + table CSS to its own file

* docs: allow horizontal scrollbars on `rh-table`

* docs: move `link` tag to new layout

---------

Co-authored-by: Benny Powers - עם ישראל חי! <[email protected]>
  • Loading branch information
adamjohnson and bennypowers authored Jul 9, 2024
1 parent a5b51e6 commit 203f3d4
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
3 changes: 3 additions & 0 deletions docs/_includes/layouts/pages/elements.njk
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ eleventyComputed:
{%- if hasToc %}
<link rel="stylesheet" href="/assets/javascript/elements/uxdot-toc-lightdom.css">
{%- endif %}
{% if doc.pageTitle == 'Code' %}
<link rel="stylesheet" href="{{ '/styles/pages/code.css' | url }}">
{% endif %}
<link rel="stylesheet" href="/assets/packages/@rhds/elements/elements/rh-table/rh-table-lightdom.css">
<link rel="stylesheet" href="/assets/packages/@rhds/tokens/css/global.css">
{%- if slug == 'audio-player' %}
Expand Down
26 changes: 26 additions & 0 deletions docs/styles/pages/code.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/**
* Elements > Code > Accordion Panel & Table customizations
* Only loaded on the {Element} > Code pages
**/
rh-accordion-panel[expanded]::part(container) {
background-color: var(--rh-color-surface-lighter, #f2f2f2);
}

rh-accordion-panel[expanded] rh-table {
--rh-table-row-background-hover-color: #f8f8f8;

background-color: var(--rh-color-surface-lightest, #ffffff);
margin: 0;
}

rh-accordion-panel[expanded] rh-table tbody tr:last-child {
border-block-end: 0 !important;
}

rh-accordion-panel[expanded] rh-table th {
font-size: var(--rh-font-size-body-text-sm, 0.875rem);
}

rh-accordion-panel[expanded] rh-table :is(th, td) p {
margin-block: 0;
}
2 changes: 1 addition & 1 deletion docs/styles/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@

/* TODO: Document this bug table overflows vertically causing a scrollbar when it shouldn't */
rh-table {
overflow: unset;
overflow-y: unset;
}

/* Compact tile + Uxdot Example reduce overall spacing */
Expand Down

0 comments on commit 203f3d4

Please sign in to comment.