Seenthis
•
 
Identifiants personnels
  • [mot de passe oublié ?]

 

b_b

@b_b
http://blog.eliaz.fr
RSS: b_b
tous les messages de b_b
  • @b_b
    b_b @b_b PUBLIC DOMAIN 24/07/2024
    1
    @monolecte
    1

    #Fluid_typography with discrete #steps
    ▻https://css-tip.com/fluid-typography

    Use the round() function and create a fluid typography with a discrete function instead of a continuous one.

    Define the step and get precise values within a specific range. Very useful if you have some calculation based on the font-size like using the em unit. No more rounding issue!

    /* Instead of  */
    p {
      font-size: clamp(1rem,1rem + 3vw,2.5rem);
    }
    /* use */
    p {
      font-size: clamp(1rem,round(down,1rem + 3vw,2px),2.5rem);
    }

    #css

    b_b @b_b PUBLIC DOMAIN
    • @arno
      ARNO* @arno ART LIBRE 24/07/2024

      Je ne vois pas de quel « rounding issue » ça parle : certes j’ai un écran haute densité qui a tendance à masquer les problèmes de rendu, mais il ne me semble pas qu’on ait des problèmes de rendu parce qu’on essaie d’afficher une fonte à 16.33333px.

      ARNO* @arno ART LIBRE
    • @b_b
      b_b @b_b PUBLIC DOMAIN 24/07/2024

      Very useful if you have some calculation based on the font-size like using the em unit

      b_b @b_b PUBLIC DOMAIN
    Écrire un commentaire

thèmes

  • #css
  • #Fluid_typography
  • #steps
Propriété intellectuelle Recommandations API