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 8/11/2022
    4
    @rastapopoulos
    @monolecte
    @cy_altern
    @tofulm
    4

    Use cases for #CSS #comparison #functions - Ahmad Shadeed
    ▻http://ishadeed.com/article/use-cases-css-comparison-functions

    https://ishadeed.com/assets/use-cases-comparison-css/twitter-card.jpg

    CSS comparison functions have been supported since almost April 2020, and I wrote an introductory article about them back then. I like to use all of them, but my favorite one of them is #clamp() and it’s the top used one for me.

    In this article, I will explore a few use-cases for comparison functions, and explain each one in detail. Mostly, the use cases will be about situations other than using them for fluid sizing, as this is the most popular use case and I will keep that to the last.

    Le truc qui me cause le plus est cet exemple :

    .hero {
     min-height: 250px;
    }

    @media (min-width: 800px) {
     .hero {
       min-height: 500px;
     }
    }

    peut s’écrire...

    .hero {
     min-height: calc(350px + 20vh);
    }

    @media (min-width: 2000px) {
     .hero {
       min-height: 600px;
     }
    }

    mais aussi...

    .hero {
     min-height: clamp(250px, 50vmax, 500px);
    }
    b_b @b_b PUBLIC DOMAIN
    • @cy_altern
      cy_altern @cy_altern CC BY-SA 9/11/2022

      A lire avant : ▻https://ishadeed.com/article/css-min-max-clamp pour être au point sur min() max() et clamp()

      cy_altern @cy_altern CC BY-SA
    Écrire un commentaire

thèmes

  • #clamp
  • #comparison
  • #CSS
  • #functions
Propriété intellectuelle Recommandations API