Chrome text shadow showing when set to 0

后端 未结 5 1587
礼貌的吻别
礼貌的吻别 2021-01-02 21:37

So, I\'m in the process of building a website designer and I have come across something strange, if you set the text-shadow: 0 0 0 someColor on a element the sh

5条回答
  •  死守一世寂寞
    2021-01-02 22:08

    If you're building a page builder and want initial "empty" values (which they're not empty, the first two zeroes indicate positioning and the last how much blur) you may just want to set the color as a default to the element background color. Or you can change your blur value to -1.

    text-shadow: 0 0 -1px red;
    

    The other option I can think is to have them enable text-shadow and then put in your 0 0 0 red using an if else statement. Pseudocode:

    if text-shadow option is checked
        use text-shadow:0 0 0 red;
    
    else
        use text-shadow:none;
    

    Good luck.

提交回复
热议问题