J
J
jeruthadam2018-12-26 22:28:43
css
jeruthadam, 2018-12-26 22:28:43

What kind of ingenious calculations vw? How to make awesome rubber text?

Recently, very often come across sites with adaptive text in vw. Yes, not just a selected value, and not just one font-size, that it becomes clear that everything happens according to some principle.

font-size: 9.6875vw;
    line-height: 9.21875vw;
    padding-bottom: 2.26562vw;
    letter-spacing: -.2375vw;

What is it? Where do these numbers come from? What to take into account to make awesome responsive text?
I used to use RucksackCSS, there was also a tricky formula, but the principle was completely different. There was calcon html, and hence there was adaptability. But the effect was not as rubbery and cool as if you made the font in vw. How to count? 9.6875vwthis is obviously not a selection with handles (otherwise why such a rounding), but still line-height, paddings, spacing
Here is an example of mediaelection.com
As you can see, these numbers are in the CSS class, and not added by JS on the client. Those. it's all calculated in advance. How?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey delphinpro, 2018-12-27
@jeruthadam

Those. it's all calculated in advance. How?

Elementary:

P
Peter, 2018-12-26
@Morpheus_God

Ну если говорить про расчет этих самых viewports
то я находил подобную формулу
Размер элемента в макете / Ширина или высота макета * 100.
vw это view width
vh это view height

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question