-
Notifications
You must be signed in to change notification settings - Fork 5
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
FS-9 Mess around with layout (proof of concept) #74
base: 3.x
Are you sure you want to change the base?
Changes from 16 commits
98191a8
484dd7a
5e54afd
f9e6b79
8a1d512
5b45520
b68284f
a4fb9c8
e7bbbd3
19c2a6a
3382e1f
cbf2347
23a4e26
8b4d040
4d6dd5a
85c2b2e
a8e9762
127bf45
c2fd448
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/** | ||
* container.scss | ||
* Define container styles. | ||
* | ||
* @copyright Copyright (c) 2017-2020 Palantir.net | ||
*/ | ||
|
||
.fs-container { | ||
box-sizing: border-box; | ||
display: flex; | ||
flex-direction: column; | ||
width: 100%; | ||
min-width: 260px; | ||
padding: 0 1.46667em; | ||
margin: 0 auto; | ||
@include breakpoint($bp2) { | ||
display: grid; | ||
grid-column-gap: 0; | ||
grid-template-columns: 25% 75%; | ||
width: 90%; | ||
padding: 0; | ||
} | ||
@include breakpoint($bp2) { | ||
max-width: 1400px; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -98,14 +98,25 @@ class FederatedSolrFacetedSearch extends React.Component { | |
pageTitle = <h1>{this.props.options.pageTitle}</h1>; | ||
} | ||
|
||
// Grab env vars. | ||
const { | ||
containerClass = '', | ||
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. Did we lose some default values here? 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. The optional custom classes would be additional to existing classes if needed so the default is to have none, so I think this is ok as is. |
||
asideClass = '', | ||
mainClass = '', | ||
gridTemplateColumns = '', | ||
reverseDesktopColumns = false, | ||
reverseMobileOrder = false, | ||
} = this.props.options.layoutAndClasses || {}; | ||
|
||
return ( | ||
<LiveAnnouncer> | ||
<div className="fs-container"> | ||
<aside className="fs-aside"> | ||
<div className={`fs-container ${containerClass}`} style={{ gridTemplateColumns: gridTemplateColumns }}> | ||
<aside className={`fs-aside ${asideClass} ${reverseDesktopColumns ? 'fs-aside__desktop-reverse' : ''} ${reverseMobileOrder ? 'fs-aside__mobile-reverse' : ''}`}> | ||
<SearchFieldContainerComponent | ||
bootstrapCss={bootstrapCss} | ||
onNewSearch={this.resetFilters} | ||
resultsCount={this.props.results.numFound} | ||
options={this.props.options} | ||
> | ||
{/* Only render the visible facets / filters. | ||
Note: their values may still be used in the query, if they were pre-set. */} | ||
|
@@ -137,7 +148,7 @@ class FederatedSolrFacetedSearch extends React.Component { | |
} | ||
</SearchFieldContainerComponent> | ||
</aside> | ||
<div className="fs-main"> | ||
<div className={`fs-main ${mainClass} ${reverseDesktopColumns ? 'fs-main__desktop-reverse' : ''} ${reverseMobileOrder ? 'fs-main__mobile-reverse' : ''} ${gridTemplateColumns ? 'fs-main__has-custom-columns' : ''}`}> | ||
{pageTitle} | ||
<div className="fs-search-form" autoComplete="on"> | ||
<FederatedTextSearch | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,70 @@ | |
margin: rhythm(1) 0; | ||
} | ||
|
||
.fs-search-scope__filter { | ||
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. @nstriedinger When I was reviewing to see if padding and other previous styling was getting lost I caught these styles from #70 and adding them back in without singularity. Let me know if we decided this styling was not needed. It looks like they may have been removed accidentally. |
||
width: 48.57143%; | ||
clear: right; | ||
float: left; | ||
margin-left: 0; | ||
margin-right: 2.85714%; | ||
|
||
@include breakpoint($bp1) { | ||
width: 31.42857%; | ||
clear: right; | ||
float: left; | ||
margin-left: 0; | ||
margin-right: 2.85714%; | ||
} | ||
|
||
&:nth-of-type(3n+1) { | ||
width: 48.57143%; | ||
clear: right; | ||
float: left; | ||
margin-left: 0; | ||
margin-right: 2.85714%; | ||
clear: both; | ||
|
||
@include breakpoint($bp1) { | ||
width: 31.42857%; | ||
float: left; | ||
margin-right: -100%; | ||
margin-left: 0; | ||
clear: both; | ||
} | ||
} | ||
|
||
&:nth-of-type(3n+2) { | ||
width: 48.57143%; | ||
clear: right; | ||
float: right; | ||
margin-right: 0; | ||
|
||
@include breakpoint($bp1) { | ||
width: 31.42857%; | ||
float: left; | ||
margin-right: -100%; | ||
margin-left: 34.28571%; | ||
clear: none; | ||
} | ||
} | ||
|
||
&:nth-of-type(3n+3) { | ||
width: 48.57143%; | ||
clear: right; | ||
float: left; | ||
margin-left: 0; | ||
margin-right: 2.85714%; | ||
clear: both; | ||
|
||
@include breakpoint($bp1) { | ||
width: 31.42857%; | ||
float: right; | ||
margin-left: 0; | ||
margin-right: 0; | ||
clear: none; | ||
} | ||
} | ||
} | ||
.fs-search-scope__select { | ||
@extend %select; | ||
@include adjust-font-size-to($label, .8); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,17 @@ | |
|
||
.fs-search-form__autocomplete-container { | ||
display: flex; | ||
@include breakpoint($bp1) { | ||
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. @nstriedinger these styles as well were removed in pr #70. |
||
width: 75%; | ||
} | ||
|
||
@include breakpoint($bp3) { | ||
width: 50%; | ||
} | ||
|
||
.fs-search-form__input-wrapper { | ||
width: 100%; | ||
} | ||
} | ||
|
||
/** These classes are outside of Federated Search app namespace. **/ | ||
|
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.
this doesn't exactly work with clean percentages because the gap width needs to be subtracted, so we might want to make some preset styles with the widths calculated for the most common percentages. Or use padding instead of the grid gap...