Skip to content
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

Sticky footer #161

Open
ayozemr opened this issue Oct 26, 2020 · 1 comment
Open

Sticky footer #161

ayozemr opened this issue Oct 26, 2020 · 1 comment

Comments

@ayozemr
Copy link

ayozemr commented Oct 26, 2020

Hello!

Its possible to create a sticky footer with this library? I have been trying different solutions but any seems to work properly. If I set layout container to "display: flex; flex-direction: column; min-height: 100vh;" so content row has "flex: 1" in order to extend to fill the vertical space.... fluid containers shrink. Any recommended examples for compatibility I see use grid or flex, but the combination of display block and flex this library uses makes difficult to do this basic layout.

I have been checking the documentation but there is no mention to vertical spacing, everything is focused on cols.

I have something like this. The combination of container fluid and container is to be able to have a full width background for header, and menu items boxed in container width of 1300px for example.

The idea is that contentContainer expands vertically so footer is sticky at the bottom of the viewport, so there is no space below the footer.

<div className={styles.layout}>
  <container fluid>
    <Row align={"center"} className={styles.topContainer}>
      <Col>
        <Container className={styles.top}>
          <Row justify="end">
            <Col xs="content">
              {!currentUser && <Link to="/register">register</Link>}
            </Col>
            <Col xs="content">
              {currentUser && (
                <Link to="/user/1">{currentUser.displayName}</Link>
              )}
            </Col>
            <Col xs="content">
              {!currentUser && <Link to="/login">logi</Link>}
              {currentUser && <Link to="/logout">logout</Link>}
            </Col>
          </Row>
        </Container>
      </Col>
    </Row>
  </Container>
  <div className={styles.contentContainer}>{children}</div>
  <Container fluid className={styles.footerContainer}>
    <Container className={styles.footerColsContainer}>
      <Row>
        <Col xxl={3}>
          <Row justify={"center"}>
            <Col xs="content">
              <div>Logo centered</div>
            </Col>
          </Row>
        </Col>
        <Col xxl={9}>
          <Row>
            <Col>
              <Row>
                <Col>
                  <div className={styles.footerColHeading}>
                    col 1 heading
                  </div>
                </Col>
                <Col>
                  <div className={styles.footerColHeading}>
                    col 2 heading
                  </div>
                </Col>
                <Col>
                  <div className={styles.footerColHeading}>
                    col 3 heading
                  </div>
                </Col>
              </Row>
            </Col>
          </Row>
          <Row>
            <Col>
              <ul>
                <li>item</li>
                <li>item</li>
                <li>item</li>
                <li>item</li>
                <li>item</li>
              </ul>
            </Col>
            <Col>
              <ul>
                <li>item</li>
                <li>item</li>
                <li>item</li>
                <li>item</li>
                <li>item</li>
              </ul>
            </Col>
            <Col>
              stuff
            </Col>
          </Row>
        </Col>
      </Row>
    </Container>
  </Container>
</div>

I dont know if I am maybe using the library wrong.

Many thanks!

@ayozemr
Copy link
Author

ayozemr commented Oct 26, 2020

I just saw the problem was "margin-left: auto; margin-right: auto" in container fluid styles. Overwriting them with "margin: 0 !important;" with a className, allowed me to use the grid approach.

Is there a prop to prevent that style from applying?

Thanks again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant