1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Not a Bug Use RGBA instead of Hex values for shadows...

Discussion in 'Resolved Bug Reports' started by Erik, Jul 30, 2010.

  1. Erik

    Erik Well-Known Member

    I've noticed that across the site, you're using Hex values for drop shadows (typically on buttons) instead of RGBA values. I would highly encourage you to convert everything to RGBA so that shadows work against any background.

    With the Hex values, buttons with shadows look very ugly against a dark background because the shadow is just a light gray color, not a transparent gray.


    Instead, if you use an RGBA value with a high transparency (like rgba(0,0,0,.25)), it looks much better:


    Thanks guys! :)
  2. Brandon_R

    Brandon_R Guest

    I think the devs are trying to make xF work on all browsers and the RGB might work on older browsers but the alpha im not sure is supported by old browsers.
  3. Mike

    Mike XenForo Developer Staff Member

    The particular feature he's referring to doesn't work in old browsers anyway.

    Rgba is great, but simultaneously evil. Quick technical note: if you dig through the CSS and find an rgba background color, check out the approach to allow it to work in IE. :)
  4. Erik

    Erik Well-Known Member

    Yeah, as you mentioned box-shadows aren't even supported on older browsers anyway, so RGBA support doesn't really matter. Although you could always specify a fallback hex color by declaring background: twice.

    Edit: see here:

    And yeah:
    Very very sneaky! I like it! :D Although it would be even better if you did 0-1 for the alpha scale instead of 0-255. Then it would stay consistent with the other declarations in the CSS. :)

    Edit: or support both:
    if($_GET['a'] <= && $_GET['a'] > ) {
    // we're on the 0-1 scale
    $a $_GET['a']*255;
    } else  if(
    $_GET['a'] < 255 && $_GET['a'] > ) {
    // we're on the 0-255 scale;
    $a $_GET['a'];
    } else die();

    // GD code
    Enigma likes this.
  5. Brandon_R

    Brandon_R Guest

    Ah dude, stop giving away your secrets :p

Share This Page