home.social

#cssvariable — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #cssvariable, 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 What if you need to set `color` to the inverted value of a CSS variable? You can't invert the whole element because the rest of it shouldn't be inverted. And you can't use the Sass `invert()` on a CSS var.

    Here's how! 👇

    (see developer.mozilla.org/en-US/do for more details)

    #css #cssVariable #code #coding #rgb #frontend #web #webDev #webDevelopment #dev

  7. #tinyCSStip What if you need to set `color` to the inverted value of a CSS variable? You can't invert the whole element because the rest of it shouldn't be inverted. And you can't use the Sass `invert()` on a CSS var.

    Here's how! 👇

    (see developer.mozilla.org/en-US/do for more details)

    #css #cssVariable #code #coding #rgb #frontend #web #webDev #webDevelopment #dev

  8. #tinyCSStip What if you need to set `color` to the inverted value of a CSS variable? You can't invert the whole element because the rest of it shouldn't be inverted. And you can't use the Sass `invert()` on a CSS var.

    Here's how! 👇

    (see developer.mozilla.org/en-US/do for more details)

    #css #cssVariable #code #coding #rgb #frontend #web #webDev #webDevelopment #dev

  9. #tinyCSStip What if you need to set `color` to the inverted value of a CSS variable? You can't invert the whole element because the rest of it shouldn't be inverted. And you can't use the Sass `invert()` on a CSS var.

    Here's how! 👇

    (see developer.mozilla.org/en-US/do for more details)

    #css #cssVariable #code #coding #rgb #frontend #web #webDev #webDevelopment #dev

  10. #tinyCSStip What if you need to set `color` to the inverted value of a CSS variable? You can't invert the whole element because the rest of it shouldn't be inverted. And you can't use the Sass `invert()` on a CSS var.

    Here's how! 👇

    (see developer.mozilla.org/en-US/do for more details)

    #css #cssVariable #code #coding #rgb #frontend #web #webDev #webDevelopment #dev