diff --git a/src/.env.local.js.example b/src/.env.local.js.example index 75a192c..8f4c409 100644 --- a/src/.env.local.js.example +++ b/src/.env.local.js.example @@ -46,6 +46,20 @@ module.exports = { pageTitle: null, // OPTIONAL: The hostname to emulate when testing. hostname: "example.local", + layoutAndClasses : { + // OPTIONAL: Specify the column widths. + gridTemplateColumns: "33% 66%", + // OPTIONAL: Add custom classes. + containerClass: "custom-container", + asideClass: "custom-aside", + mainClass: "custom-main", + // OPTIONAl: Reverse desktop column order. + reverseDesktopColumns: false, + // OPTIONAL: Reverse mobile stack order. + reverseMobileOrder: false, + // Breakpoint for Desktop. Layout will change when wider then the value specifed. + breakpointDesktop: 900, + }, // OPTIONAL: Machine name of those search fields whose facets/filter and current values should be hidden in UI. // Note: if their values are pre-set (i.e. sent in qs to app), they will still be sent in the query. // hiddenSearchFields: [ // Defaults to []; diff --git a/src/components/_fs-aside.scss b/src/components/_fs-aside.scss index 47337d9..2e24127 100644 --- a/src/components/_fs-aside.scss +++ b/src/components/_fs-aside.scss @@ -8,12 +8,15 @@ .fs-aside { margin-left: 0; margin-bottom: rhythm(1); - background-color: $c-bg-gray; +} + +.fs-aside__mobile-reverse { + order: 2; +} +// Layout option to move aside to right on desktop +.fs-aside__desktop-reverse { @include breakpoint($bp2) { - float: left; - clear: both; - width: 22.85714%; - padding-top: rhythm(1); + order: 6; // Should be higher than all mobile orders. } } diff --git a/src/components/_fs-container.scss b/src/components/_fs-container.scss new file mode 100644 index 0000000..01dcc3a --- /dev/null +++ b/src/components/_fs-container.scss @@ -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: 22.85714% 74.28571%; + width: 90%; + padding: 0; + } + @include breakpoint($bp2) { + max-width: 1400px; + } +} diff --git a/src/components/_fs-main.scss b/src/components/_fs-main.scss index 79efd62..0cce59a 100644 --- a/src/components/_fs-main.scss +++ b/src/components/_fs-main.scss @@ -9,11 +9,19 @@ margin-left: 0; margin-right: 0; margin-bottom: rhythm(1); + @include breakpoint($bp2) { + padding-left: 3.703713%; //Default to match previous version 1.x padding. + } + &.fs-main__has-custom-columns { + @include breakpoint($bp2) { + padding-left: 2em; + } + } +} +.fs-main__desktop-reverse { @include breakpoint($bp2) { - float: right; - clear: none; - width: 74.28571%; - padding-top: rhythm(1); + padding-left: 0; + padding-right: 2em; } } diff --git a/src/components/_fs-search-filters.scss b/src/components/_fs-search-filters.scss index 0f5ec45..e3b584a 100644 --- a/src/components/_fs-search-filters.scss +++ b/src/components/_fs-search-filters.scss @@ -5,6 +5,13 @@ * @copyright Copyright (c) 2017-2019 Palantir.net */ +.fs-search-filters { + background-color: $c-bg-gray; + @include breakpoint($bp2) { + padding-top: rhythm(1); + } +} + .fs-search-filters__trigger, .fs-search-accordion__title { @include adjust-font-size-to($sm-heading, 1); @@ -208,6 +215,7 @@ } .fs-search-accordion__title { + margin: 0; @extend %h2; border-bottom: solid 1px $gray-light; padding-top: rhythm(.75); diff --git a/src/components/federated-solr-faceted-search.js b/src/components/federated-solr-faceted-search.js index 19810c5..c3dd389 100644 --- a/src/components/federated-solr-faceted-search.js +++ b/src/components/federated-solr-faceted-search.js @@ -98,14 +98,25 @@ class FederatedSolrFacetedSearch extends React.Component { pageTitle =

{this.props.options.pageTitle}

; } + // Grab env vars. + const { + containerClass = '', + asideClass = '', + mainClass = '', + gridTemplateColumns = '', + reverseDesktopColumns = false, + reverseMobileOrder = false, + } = this.props.options.layoutAndClasses || {}; + return ( -
-