How to calculate columns equal to Skeleton

Asked

Viewed 94 times

4

To .col-md-1 is calculated thus: 100/12 = 8.3333...3 in the Skeleton was otherwise calculated which returned the following result:

.one.column,
.one.columns {
  width: 4.66666666667%;
}

What logic did the developer use? Which calculation?

1 answer

3


Indeed, it is a rather complex puzzle to solve. After some tests and some research, it was not possible to obtain the result of 4.66..67%, but I arrived in 4,25%.

According to this problem in the github, it seems that the base of columns of the skeleton formerly was 16, rather than the conventional 12 (used by many today - Bootstrap).

Another point I analyzed was the method many were calculating the Skeleton grid when converted to SASS or LESS, instead of decreasing the margin value for each side (left and right), only 1 of the sides was removed.

See the formula used in this conversion to LESS/SASS:

.one.columns {
    width: @column-width*1-(@column-margin/2)*1%;
}

//Essa área é a interessante para a análise: (@column-margin/2)

whereas the github is not updated 2 years ago and that the developer himself claimed to be absent from the updates, using some values from CSS original of Skeleton and some formulas used in LESS and SASS I came to that calculation:

@Total width = 100;
@columns = 16;
@margin = 4%;
Formula: @widthTotal / @columns - (@margin / 2);


100/16 - (4%/2) = 4,25%

  • Link to Skeleton SASS, here.
  • Link to Skeleton LESS, here.

Remembering that the current formula used in LESS and SASS already differs from the calculation I elaborated, because today the system is based on a grid of 12 colunas, so the account won’t hit. I used calculation logic with 16 colunas (based on the grid used in the past) to try to answer why the value of 4,66..67% found in the archive CSS original of Skeleton.

  • Oloco... I would never get to 4.25%, thank you for your reply, I will mark it as solved, since one can not get 4,66...67%, but face it is not another logic ? I will research deeper, but I think I will not get the different result, yours is the closest.

  • 1

    @Guilhermespinxo As this has been created for a long time and is not updated, perhaps some "good practice" guide was used that no longer applies today. For example, the grid of the first published file (2011) used px instead of %, Perhaps it was some calculation to make this conversion. But I suggest you abandon the attempt to achieve this result, as we have many other excellent and updated frameworks. What is worth it is the final result =D

Browser other questions tagged

You are not signed in. Login or sign up in order to post.