-
Notifications
You must be signed in to change notification settings - Fork 3.5k
prefactor: generalize filterable index layout and components #13768
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
18 commits
Select commit
Hold shift + click to select a range
33ddc5b
refactor: generalize filterable index layout and components
ericwindmill ebee399
cleaup
ericwindmill 3f6f977
Merge branch 'main' of https://github.com/flutter/website into refact…
ericwindmill f69ee4f
Apply suggestions from code review
ericwindmill 8c0d9c0
address comments
ericwindmill b347a6d
Merge branch 'refactor-filterable-index' of https://github.com/flutte…
ericwindmill 3b4a195
checkin
ericwindmill c6fd796
Address PR comments
ericwindmill c932533
Merge branch 'main' of https://github.com/flutter/website into refact…
ericwindmill 2be1f9f
Apply suggestions from code review
ericwindmill e83045a
Update sites/docs/lib/_sass/components/_filterable-index.scss
ericwindmill 4f89d79
Enable unique drawer checkbox IDs per filter sidebar
parlough 1c40133
Misc clean up and fixes
parlough 386c768
Make filterable index scrollable when necessary
parlough a493f5e
Fix disabled state styling
parlough 7bc0a0b
Make mobile filter header sticky
parlough 3ea40c7
Simplify filter menu header setup
parlough 1263a08
Disable overscroll of filter menu
parlough 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
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
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
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,203 @@ | ||
| // The markup comes from the `FiltersSidebar` and `FilterSearchGroup` | ||
| // components in `filterable_index.dart`, so everything here is keyed off | ||
| // classes. Each page styles its own results list separately, keyed off the | ||
| // id of that list. | ||
|
|
||
| .filterable-index { | ||
| $mobile-breakpoint: 839px; | ||
| $sidebar-width: 220px; | ||
|
|
||
| display: flex; | ||
| flex-direction: row; | ||
|
|
||
| .left-col { | ||
| margin-right: 1rem; | ||
| flex: 2; | ||
| } | ||
|
|
||
| .right-col { | ||
| width: $sidebar-width; | ||
| } | ||
|
|
||
| // The sidebar follows the page as it scrolls on wide screens and stays within | ||
| // the viewport. On narrow screens, it becomes an off-canvas drawer. | ||
| .filter-sidebar { | ||
| position: sticky; | ||
| top: calc(var(--site-header-height) + 1rem); | ||
| display: flex; | ||
| flex-direction: column; | ||
| max-height: calc(100vh - var(--site-header-height) - 2rem); | ||
| } | ||
|
|
||
| .filter-group-wrapper { | ||
| // Scroll expanded filters independently so any sidebar footer stays visible. | ||
| min-height: 0; | ||
| border: 1px solid var(--site-inset-borderColor); | ||
| background-color: var(--site-inset-bgColor); | ||
| border-radius: var(--site-radius); | ||
| overflow-x: hidden; | ||
| overflow-y: auto; | ||
| overscroll-behavior: none; | ||
| } | ||
|
|
||
| // Keep the title visible while the filters scroll. The close control is only | ||
| // shown while the sidebar is a drawer. | ||
| .filter-header { | ||
| position: sticky; | ||
| top: 0; | ||
| z-index: 1; | ||
| display: grid; | ||
| grid-template-columns: 2.25rem 1fr 2.25rem; | ||
| align-items: center; | ||
| background-color: var(--site-raised-bgColor); | ||
| border-bottom: 1px solid var(--site-inset-borderColor); | ||
|
|
||
| .table-title { | ||
| grid-column: 2; | ||
| padding: .5rem 0; | ||
| text-align: center; | ||
| color: var(--site-base-fgColor-alt); | ||
| font-family: var(--site-ui-fontFamily); | ||
| font-weight: 600; | ||
| font-size: .925rem; | ||
| } | ||
|
|
||
| .close-icon { | ||
| display: none; | ||
| grid-column: 3; | ||
| align-items: center; | ||
| justify-self: center; | ||
| cursor: pointer; | ||
| padding: 0.25rem; | ||
| border-radius: 4px; | ||
| background: none; | ||
| border: none; | ||
| color: var(--site-base-fgColor-alt); | ||
| transition: background-color 0.2s ease, color 0.2s ease; | ||
|
|
||
| &:hover { | ||
| background-color: rgba(0, 0, 0, 0.1); | ||
| color: var(--site-primary-color); | ||
| } | ||
|
|
||
| .material-symbols { | ||
| font-size: 20px; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| .filter-group { | ||
| .table-content { | ||
| padding: 1rem; | ||
| } | ||
|
|
||
| ul { | ||
| padding-left: 0; | ||
| margin-bottom: .5rem; | ||
|
|
||
| li { | ||
| list-style: none; | ||
| padding-left: 0; | ||
| padding-bottom: .25rem; | ||
| display: flex; | ||
| align-items: center; | ||
|
|
||
| label { | ||
| padding-left: .35rem; | ||
| font-size: .9rem; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| h4 { | ||
| margin: 0 0 .5rem; | ||
| padding: 0; | ||
| } | ||
|
|
||
| .filter-expansion-button { | ||
| margin-bottom: 1rem; | ||
| } | ||
|
|
||
| .hidden { | ||
| display: none; | ||
| } | ||
| } | ||
|
|
||
| .filter-search-group { | ||
| display: flex; | ||
| flex-direction: column; | ||
|
|
||
| button.show-filters-button { | ||
| @media (min-width: $mobile-breakpoint + 1) { | ||
| display: none; | ||
| } | ||
| } | ||
|
|
||
| .label-row { | ||
| display: flex; | ||
| justify-content: space-between; | ||
| font-size: .925rem; | ||
| margin-top: .25rem; | ||
|
|
||
| label { | ||
| font-family: var(--site-ui-fontFamily); | ||
| color: var(--site-base-fgColor-lighter); | ||
|
|
||
| margin: 0 .5rem 0 0; | ||
| text-align: end; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| // On narrow screens the sidebar becomes a drawer that slides in from the | ||
| // right. Opening and closing is driven entirely by the hidden | ||
| // `.filter-drawer-toggle` checkbox that precedes it. | ||
| @media (max-width: $mobile-breakpoint) { | ||
| flex-direction: column; | ||
|
|
||
| .left-col { | ||
| margin-right: 0; | ||
| } | ||
|
|
||
| // The drawer itself is fixed-positioned, so this column no longer needs to | ||
| // reserve width for it in the flex layout. | ||
| .right-col { | ||
| width: auto; | ||
| } | ||
|
|
||
| .filter-header { | ||
| .close-icon { | ||
| display: flex; | ||
| } | ||
| } | ||
|
|
||
| .filter-sidebar { | ||
| position: fixed; | ||
| top: var(--site-header-height); | ||
| bottom: 0; | ||
| right: -$sidebar-width; | ||
| width: $sidebar-width; | ||
| max-height: none; | ||
| display: flex; | ||
| flex-direction: column; | ||
| background-color: var(--site-inset-bgColor); | ||
| border-left: 1px solid var(--site-inset-borderColor); | ||
| transition: right 0.3s ease-in-out; | ||
| z-index: var(--site-z-top); | ||
| } | ||
|
|
||
| .filter-drawer-toggle:checked + .filter-sidebar { | ||
| right: 0; | ||
| } | ||
|
|
||
| // Fill the drawer rather than floating within it as a card, | ||
| // and scroll on its own so any footer stays in view. | ||
| .filter-group-wrapper { | ||
| flex: 1; | ||
| min-height: 0; | ||
| overflow-y: auto; | ||
| border: none; | ||
| border-radius: 0; | ||
| } | ||
| } | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.