-
Notifications
You must be signed in to change notification settings - Fork 1
chore: support Policy Briefs pages (footnotes + table layout) #178
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
0fd257f
chore: create footnotes component
Anca2022 fc61977
Keep policy tables as tables on mobile with min-width and horizontal …
Anca2022 fbaee1b
shorten footnotes divider width to 30%
Anca2022 046bc7c
change file name and bump style version
Anca2022 6881c1c
Merge branch 'main' into am/policy-briefs
Anca2022 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| .footer-notes { | ||
| padding-inline: 5%; | ||
| font-size: var(--step--1); | ||
| } | ||
|
|
||
| .footer-notes .content-wrapper::before { | ||
| content: ""; | ||
| display: block; | ||
| height: 1px; | ||
| width: 30%; | ||
| top: 0; | ||
| left: 0; | ||
| margin-bottom: var(--space-2xs); | ||
| background-color: black; | ||
| } | ||
|
|
||
| .footer-notes ol { | ||
| list-style: none; | ||
| padding: 0; | ||
| } | ||
|
|
||
| .footnote-backlink { | ||
| font-size: var(--step--2); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -68,24 +68,25 @@ | |
| } | ||
|
|
||
| /* Responsive card layout for medium screens and below */ | ||
| /* except for tables on Policy pages */ | ||
| @media (max-width: 1024px) { | ||
| .table-wrapper table thead { | ||
| .table-wrapper table:not(.policy-table) thead { | ||
| display: none; | ||
| } | ||
|
|
||
| .table-wrapper table, | ||
| .table-wrapper table tbody { | ||
| .table-wrapper table:not(.policy-table), | ||
| .table-wrapper table:not(.policy-table) tbody { | ||
| display: block; | ||
| } | ||
|
|
||
| .table-wrapper table tbody { | ||
| border: 1px solid var(---table-border-color-sm); | ||
| border: 1px solid var(--table-border-color-sm); | ||
| border-radius: var(--border-radius); | ||
| overflow: hidden; | ||
| background: var(--table-bg-sm); | ||
| } | ||
|
|
||
| .table-wrapper table tr { | ||
| .table-wrapper table:not(.policy-table) tr { | ||
| display: block; | ||
| } | ||
|
|
||
|
|
@@ -101,8 +102,11 @@ | |
| color: var(--table-fg-sm); | ||
| } | ||
|
|
||
| .table-wrapper table td { | ||
| .table-wrapper table:not(.policy-table) td { | ||
| display: block; | ||
| } | ||
|
|
||
| .table-wrapper table td { | ||
| padding: var(--space-2xs) var(--space-xs); | ||
| position: relative; | ||
| color: var(--table-fg-sm); | ||
|
|
@@ -144,3 +148,17 @@ | |
| padding-bottom: var(--space-2xs); | ||
| } | ||
| } | ||
|
|
||
| /* Policy Briefs page table styling */ | ||
| .table-wrapper table.policy-table { | ||
| min-width: 600px; | ||
| max-width: none; | ||
| } | ||
|
|
||
| .table-wrapper table.policy-table td:first-child { | ||
| white-space: normal; | ||
| } | ||
|
|
||
| .table-wrapper:has(table.policy-table) { | ||
|
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. just a suggestion, for horizontal scroll on mobile, consider adding a visual indicator that the table is scrollable (like a shadow fade on the right edge of the table or make the scrollbar persistent) |
||
| overflow-x: auto; | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
web/themes/interledger/templates/field--node--field-footer-notes.html.twig
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| <ol> | ||
| {% for item in items %} | ||
| <li id="footnote-{{ loop.index }}"> | ||
| <span class="visually-hidden">Footnote | ||
| {{loop.index}} | ||
| </span> | ||
| <sup aria-hidden="true">{{ loop.index }} | ||
| </sup> | ||
| {{ item.content }} | ||
| <a href="#ref-{{ loop.index }}" aria-label="Return to footnote {{ loop.index }} reference in article" class="footnote-backlink">↩</a> | ||
| </li> | ||
| {% endfor %} | ||
| </ol> |
6 changes: 6 additions & 0 deletions
6
web/themes/interledger/templates/node--footer-notes.html.twig
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| <aside class="footer-notes node--{{ node.id }}"> | ||
| <h2 class="visually-hidden">Footnotes</h2> | ||
| <div class="content-wrapper"> | ||
| {{ content }} | ||
| </div> | ||
| </aside> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
nit: The CSS file is named footnote.css but uses .footer-notes as the class. Consider aligning naming (footnote vs footer-notes) for clarity.