Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bootstrap
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 263
    • Issues 263
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 114
    • Merge requests 114
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Bootstrap
  • bootstrap
  • Merge requests
  • !26411

Update docs to account for col-width bug

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/dankreiger/col-width-bug into v4-dev Apr 28, 2018
  • Overview 0
  • Commits 14
  • Pipelines 0
  • Changes 1

Created by: dankreiger

This example from the docs (and a few others) outline a way that I don't think Bootstrap 4 can be used.

In this PR I removed these examples from the docs.

The Problem

  • using .col-* (or .col#{$infix}-*) and .col (or .col#{$infix}) in the same layout results with rows of unequal length.

Here is an example from the Bootstrap docs in CodePen:

bootstrap bug 2 bootstrap bug

See example 1 in this CodePen. You will notice it especially when resizing the screen width.


Using column classes with an explicit number alone isn't always good either. Here is the problem with this example from the docs

a pen by dan kreiger 2018-04-28 17-47-57

See example 2 in this CodePen



There is a good use case for using .col or .col#{infix} classes by themselves in multiple rows.

Since these classes utilize the power of flow-grow, they can solve a problem that existed in Bootstrap 3, and still exists in Bootstrap 4 (such as the example directly above) when using only .col-* classes.

Problem: when one row has 2 columns and another row has 3 columns, the rows have different lengths

We see rows uneven in length in Bootstrap 3:

bildschirmfoto 2018-04-28 um 17 14 56

CodePen

We see rows uneven in length in Bootstrap 4 when using only the number specific .col-* or .col#{infix}-* syntax:

bildschirmfoto 2018-04-28 um 17 22 37

CodePen


All this unevenness becomes especially noticeable when there are multiple rows:

bildschirmfoto 2018-04-28 um 21 24 33

CodePen


I'm not sure if there is a global solution for this, but I updated the docs so that users aren't encouraged to combine .col columns with .col-* columns.

Perhaps we could let users know about the benefits of using the .col classes alone (e.g. how they solve the 2-col row vs. 3-col row conundrum).


The result of very slight unevenness on these columns can be pretty jarring to the eye.

I have a Stack Overflow post about this when I first noticed the problem after setting the $container-max-width. However, I realized this problem can be reproduced without setting max-width (like in the examples above). It seems to be a core problem in the library.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/dankreiger/col-width-bug