Skip to content

Commit

Permalink
feat(layout): makes sticky footer default configurable
Browse files Browse the repository at this point in the history
affects: @buildit/gravity-ui-web

So far the `<body>` element always has a sticky footer effect applied to it, by default. With this
change, this can be disabled in custom Gravity builds by overriding a SASS variable: `$grav-config-body-sticky-footer`.
  • Loading branch information
James Nash committed Sep 2, 2019
1 parent 8363d4d commit f7276b3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
12 changes: 12 additions & 0 deletions packages/gravity-ui-web/src/sass/00-settings/_config.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
////
/// All configuration variables that can be overridden to customise
/// Gravity builds.
///
/// @group config
////

/// Whether or not the `<body>` element should have the
/// sticky footer effect applied by default.
///
/// @type boolean
$grav-config-body-sticky-footer: true !default;
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// === Settings layer ===
// Used with preprocessors and contain font, colors definitions, etc.
// Must not output any CSS.
@import 'config';
@import 'breakpoints';
@import 'typography';
@import 'modularscale-settings';
Expand Down
4 changes: 3 additions & 1 deletion packages/gravity-ui-web/src/sass/02-generic/_layout.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
body {
@include grav-l-container;
@include grav-sticky-footer;
@if $grav-config-body-sticky-footer {
@include grav-sticky-footer;
}

padding-top: $grav-sp-page-content-inset;
padding-bottom: $grav-sp-page-content-inset;
Expand Down

0 comments on commit f7276b3

Please sign in to comment.