TV primero, tipografía receptiva o cómo no olvidarse de todos los tamaños de dispositivos

Buenas tardes, Khabrovites! No hace mucho tiempo, publiqué una traducción del artículo "El diseño totalmente receptivo es más que solo solicitudes de medios" . En esa publicación, prometí contarte cómo utilicé esta técnica en mi proyecto, qué tuve que enfrentar y todas las características asociadas con esta técnica a las que definitivamente debes prestar atención durante el desarrollo. En la publicación de hoy, intentaré cumplir mi promesa. Si está interesado en la experiencia del uso práctico de la técnica de fuente receptiva en un proyecto real, le pido gato.



Entonces empecemos. Brevemente recuerde la técnica en sí:


html {
  font-size: minimumPixel + range * ((viewportWidth - minScreenWidth) / maxScreenWidth)
}

/* Example */

html {
  font-size: calc(14px + 10 * ((100vw - 769px) / 2048));
}

Formulé la tesis principal de la siguiente manera:


La tipografía receptiva y el diseño receptivo construido sobre ella pueden ahorrar mucho tiempo y simplificar el desarrollo cuando se aplica correctamente.

, , :


  1. ?
  2. , ?
  3. ?
  4. .

.


. , , :


— , , , .

, — , , .

, .


.



, . , fullstack . , - . fullstack , , backend Python. , JQuery VueJs. . . , , MVP. SPA -. BI-. BI-, , backend-. (, , ), . , - .


- — TV first. , . . . , . ? . , , , . . , . . , . . , .


MVP . , . CSS, JS . . - . , , , , .


, . , . .




, :


— -, .

. .


? . , . , . -. . , . , . . . — . . . . . rem. . :


:



:


  • . .
  • . , .

. . , , , . - .


, . — google chrome. , , , .


:



. google.com . . google . . .


— . . , , . .


- , . , . medium.com 2018 Pixels vs. Ems: Users DO Change Font Size, https://archive.org. , 3.08%. ? . , . - , .


? . , . , . ? . . , . , .


, -. Pixels vs. Relative Units in CSS: why it’s still a big deal. - , - , .



. , , . - . .



, :


font-size: minimumPixel + range * ((viewportWidth - minScreenWidth) / maxScreenWidth)

Range . , 10 769px 2048px . ? . . , , minimumPixel + range. , 769px 2048px 14px 20px : 14px + 10 * ((2048 — 769px) / 2048.


360px.


:


@media screen and (max-width: 360px) {
  html {
    font-size: calc(14px + 2 * ((100vw - 320px) / 360));
  }
}

30px 15.


/* Excessively large screens */
@media screen and (min-width: 2049px) {
  html {
    font-size: calc(30px + 15 * ((100vw - 2049px) / 4096));
  }
}

, . . . , , . .


. rem. , , . rem. , .


. , , , iphone 5. , . , . , .


, — . . , . .


, :


/* Small mobile */
@media screen and (max-width: 360px) {
  html {
    font-size: calc(14px + 2 * ((100vw - 320px) / 360));
  }
}

@media screen and (min-width: 361px) and (max-width: 768px) {
  html {
    font-size: calc(16px + 2 * ((100vw - 361px) / 768));
  }
}

/* Laptop and Desktops screens */
@media screen and (min-width: 769px) and (max-width: 2048px) {
  html {
    font-size: calc(14px + 5 * ((100vw - 769px) / 2048));
  }
}

/* Excessively large screens */
@media screen and (min-width: 2049px) {
  html {
    font-size: calc(30px + 15 * ((100vw - 2049px) / 4096));
  }
}

— , - . , .


. , — rem :


@media screen and (min-width: 361px) and (max-width: 768px) {
  html {
    font-size: calc(1rem + 2 * ((100vw - 361px) / 768));
  }
}

. , , . , . , . , . 16px. , : People don't change the default 16px font size in their browser (You wish!). . , Opera Mini , Kindle 3, . 2016 . . . , - . , . .


, . . . . : . , , . , . , . . , . .


, . , . , .


- , .


:



PD: Si desea ver una traducción de cualquiera de estos artículos en el futuro, escríbalo en los comentarios.


All Articles