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

 
  • #r
  • #re
  • #rel
RSS: #relative

#relative

  • @b_b
    b_b @b_b PUBLIC DOMAIN 22/03/2026
    1
    @rastapopoulos
    1

    #CSS #Relative #Colors: Build UI #Palettes Without a Color Picker
    ▻https://theosoti.com/blog/css-relative-colors

    Relative colors shine when a component needs multiple accents. Here is a compact pattern for a callout card:

    Keep derived tokens in one space so the relationships stay coherent. Mixing spaces is valid, but remember the source is converted to the output space for every calculation, which can subtly change the result.

    The component only needs one input (—tone). Everything else follows.

    .callout {
    	--tone: #4b6bff;
    	--tone-strong: hsl(from var(--tone) h s calc(l - 12));
    	--tone-soft: hsl(from var(--tone) h calc(s - 20) calc(l + 28));
    	--tone-border: rgb(from var(--tone) r g b / 0.2);
    	--tone-shadow: rgb(from var(--tone) r g b / 0.25);
    
    	border: 1px solid var(--tone-border);
    	background-color: var(--tone-soft);
    	box-shadow: 0 12px 24px var(--tone-shadow);
    }
    
    .callout strong {
    	color: var(--tone-strong);
    }

    via ▻https://css-tricks.com/whats-important-6

    b_b @b_b PUBLIC DOMAIN
    • @rastapopoulos
      RastaPopoulos @rastapopoulos CC BY-NC 23/03/2026

      Attention quand même : ▻https://caniuse.com/mdn-css_types_color_hsl_relative_syntax

      93% en France et 89,5% dans le monde, c’est pas 98% ni même 95% comme seuil acceptable de « presque tout le monde ok ».

      RastaPopoulos @rastapopoulos CC BY-NC
    Écrire un commentaire
  • @nhoizey
    Nicolas Hoizey @nhoizey CC BY-NC-SA 23/02/2015

    STPo › Portfolio › Direction artistique › Jérémie Do Van Lanh
    ▻http://www.stpo.fr/portfolio/direction-artistique/jeremie-do-van-lanh-2

    « la #CSS a été codée intégralement en unités relatives (em), ce qui lui assure une interopérabilité robuste et une accessibilité renforcée » Tags : #em #intégration CSS #relative accessibilité

    #accessibilité

    Nicolas Hoizey @nhoizey CC BY-NC-SA
    Écrire un commentaire
  • @nhoizey
    Nicolas Hoizey @nhoizey CC BY-NC-SA 28/02/2014
    1
    @reka
    1

    Confused About #rem and #em?
    ▻http://j.eremy.net/confused-about-rem-and-em

    Tags : em rem #px unité #CSS #taille #dimension #relative

    #unité

    • #Paris
    Nicolas Hoizey @nhoizey CC BY-NC-SA
    • @nhoizey
      Nicolas Hoizey @nhoizey CC BY-NC-SA 28/02/2014
      @nicod_

      @nicod_ cet héritage est pourtant très important, comme il l’indique et comme je l’ai montré aussi à Paris Web et dans mon article sur 24joursdeweb

      Nicolas Hoizey @nhoizey CC BY-NC-SA
    • @nhoizey
      Nicolas Hoizey @nhoizey CC BY-NC-SA 28/02/2014
      @nicod_

      @nicod_ Oups, j’ai mal interprété, désolé !

      Nicolas Hoizey @nhoizey CC BY-NC-SA
    Écrire un commentaire

Thèmes liés

  • #css
  • #em