home.social

#cssgotcha — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #cssgotcha, aggregated by home.social.

  1. #CSS gotcha: if you set a list of gradient stops on an element:
    .a { --l: var(--c0), var(--c1) }

    ... and expect to be able to get *a different gradient* if you just modify --c0 & --c1 on its .b children... I have bad news.😾

    You need to set:
    .a, .b { --l: var(--c0), var(--c1) }

    Live demo on @codepen
    codepen.io/thebabydino/pen/rNE

    Particularly annoying when that gradient is used on tens of various children. 😿

    #cssVariable #gotcha #cssGotcha #code #coding #fronten #web #webDev #dev #webDevelopment

  2. #CSS gotcha: if you set a list of gradient stops on an element:
    .a { --l: var(--c0), var(--c1) }

    ... and expect to be able to get *a different gradient* if you just modify --c0 & --c1 on its .b children... I have bad news.😾

    You need to set:
    .a, .b { --l: var(--c0), var(--c1) }

    Live demo on @codepen
    codepen.io/thebabydino/pen/rNE

    Particularly annoying when that gradient is used on tens of various children. 😿

    #cssVariable #gotcha #cssGotcha #code #coding #fronten #web #webDev #dev #webDevelopment

  3. #CSS gotcha: if you set a list of gradient stops on an element:
    .a { --l: var(--c0), var(--c1) }

    ... and expect to be able to get *a different gradient* if you just modify --c0 & --c1 on its .b children... I have bad news.😾

    You need to set:
    .a, .b { --l: var(--c0), var(--c1) }

    Live demo on @codepen
    codepen.io/thebabydino/pen/rNE

    Particularly annoying when that gradient is used on tens of various children. 😿

    #cssVariable #gotcha #cssGotcha #code #coding #fronten #web #webDev #dev #webDevelopment

  4. #CSS gotcha: if you set a list of gradient stops on an element:
    .a { --l: var(--c0), var(--c1) }

    ... and expect to be able to get *a different gradient* if you just modify --c0 & --c1 on its .b children... I have bad news.😾

    You need to set:
    .a, .b { --l: var(--c0), var(--c1) }

    Live demo on @codepen
    codepen.io/thebabydino/pen/rNE

    Particularly annoying when that gradient is used on tens of various children. 😿

    #cssVariable #gotcha #cssGotcha #code #coding #fronten #web #webDev #dev #webDevelopment

  5. #CSS gotcha: if you set a list of gradient stops on an element:
    .a { --l: var(--c0), var(--c1) }

    ... and expect to be able to get *a different gradient* if you just modify --c0 & --c1 on its .b children... I have bad news.😾

    You need to set:
    .a, .b { --l: var(--c0), var(--c1) }

    Live demo on @codepen
    codepen.io/thebabydino/pen/rNE

    Particularly annoying when that gradient is used on tens of various children. 😿

    #cssVariable #gotcha #cssGotcha #code #coding #fronten #web #webDev #dev #webDevelopment

  6. #tinyCSStip (or gotcha) If you want to get the correct result when using smth like
    atan2(var(--y), var(--x))
    with --y and --x having different units...

    then you need to register --x and --y as length values!

    Or how I lost > 30min trying to figure out why my angle was 4° off...

    #maths #mathematics #cssMaths #trigonometry #gotcha #cssGotcha #code #coding #frontend #webDev #web #dev #webDevelopment #houdini #cssVariables #customProperties #cssFunction

  7. #tinyCSStip (or gotcha) If you want to get the correct result when using smth like
    atan2(var(--y), var(--x))
    with --y and --x having different units...

    then you need to register --x and --y as length values!

    Or how I lost > 30min trying to figure out why my angle was 4° off...

    #maths #mathematics #cssMaths #trigonometry #gotcha #cssGotcha #code #coding #frontend #webDev #web #dev #webDevelopment #houdini #cssVariables #customProperties #cssFunction

  8. #tinyCSStip (or gotcha) If you want to get the correct result when using smth like
    atan2(var(--y), var(--x))
    with --y and --x having different units...

    then you need to register --x and --y as length values!

    Or how I lost > 30min trying to figure out why my angle was 4° off...

    #maths #mathematics #cssMaths #trigonometry #gotcha #cssGotcha #code #coding #frontend #webDev #web #dev #webDevelopment #houdini #cssVariables #customProperties #cssFunction

  9. #tinyCSStip (or gotcha) If you want to get the correct result when using smth like
    atan2(var(--y), var(--x))
    with --y and --x having different units...

    then you need to register --x and --y as length values!

    Or how I lost > 30min trying to figure out why my angle was 4° off...

    #maths #mathematics #cssMaths #trigonometry #gotcha #cssGotcha #code #coding #frontend #webDev #web #dev #webDevelopment #houdini #cssVariables #customProperties #cssFunction

  10. #tinyCSStip (or gotcha) If you want to get the correct result when using smth like
    atan2(var(--y), var(--x))
    with --y and --x having different units...

    then you need to register --x and --y as length values!

    Or how I lost > 30min trying to figure out why my angle was 4° off...

    #maths #mathematics #cssMaths #trigonometry #gotcha #cssGotcha #code #coding #frontend #webDev #web #dev #webDevelopment #houdini #cssVariables #customProperties #cssFunction