Skip to content

Commit

Permalink
fix(cx-footer): make footer 'sticky' to bottom viewport on short pages (
Browse files Browse the repository at this point in the history
#1513)

* fix footer height

* fix(cx-footer): apply to footer styleguide page

Co-authored-by: wodenx <wodenx@gmail.com>
Co-authored-by: Konstantin Mishur <kmishur@its.jnj.com>
  • Loading branch information
3 people committed Apr 12, 2022
1 parent 71f0ee5 commit dfa818a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,17 @@ import { asStyleGuideTemplateToken, cxStyleGuideTemplate } from '@bodiless/cx-te
import { flowHoc, on, replaceWith } from '@bodiless/fclasses';
import { FooterClean, cxFooter } from '@bodiless/cx-layout';

export const Footer = asStyleGuideTemplateToken(cxStyleGuideTemplate.NoLayout, {
// Apply similar method as done in the cxLayout token.
const StickFooterLayout = asStyleGuideTemplateToken({
...cxStyleGuideTemplate.NoLayout,
Theme: {
...cxStyleGuideTemplate.NoLayout.Theme,
Container: 'flex flex-col h-screen',
DescriptionWrapper: 'flex-grow',
},
});

export const Footer = asStyleGuideTemplateToken(StickFooterLayout, {
Meta: flowHoc.meta.term('Token')('Footer'),
Content: {
Title: replaceWith(() => <>Footer</>),
Expand Down
4 changes: 4 additions & 0 deletions packages/cx-layout/src/components/Layout/tokens/cxLayout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ const Base = asLayoutToken({
'sr-only focus:not-sr-only',
),
},
Theme: {
OuterContainer: 'flex flex-col h-screen',
ContainerWrapper: 'flex-grow',
},
});

const Default = asLayoutToken({
Expand Down

0 comments on commit dfa818a

Please sign in to comment.