B
B
bQ12019-10-31 14:21:37
css
bQ1, 2019-10-31 14:21:37

What are the ways to proportionally compress page content for adaptive layout?

Now in the project I use the sass function:

@function calcFluidSize($f-min, $f-max, $v-min, $v-max) {
  $k: ($f-max - $f-min)/($v-max - $v-min);
  $b: $f-min - $k * $v-min;
  $b: $b * 1px;
  @return calc( #{$k} * 100vw + #{$b} );
}

It compresses content perfectly, but there is one drawback: it’s inconvenient to debug through the code in the browser because the output after sass turns out something like this: What other options are there? padding: 1px calc( .04849 * 100vw + -33.10345px)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Alekseev, 2019-11-01
@bQ1

layout all sizes in 'em'
reducing the font-size of the block will proportionally reduce the entire layout inside, starting at least with the body

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question