How can I use 3-digit color codes rather than 6-digit color codes in CSS?

后端 未结 9 1577
余生分开走
余生分开走 2020-12-02 12:22

I recently went through my CSS file and switched all my six-digit hexadecimal codes to simple three-digit codes (for example, my #FDFEFF got shortened to

9条回答
  •  旧时难觅i
    2020-12-02 12:34

    It does not matter whether you use shorthand or normal hex colours, so go ahead and convert them if you desire.

    removing them saved me an entire 300 bytes in my CSS file

    Wow, a full 300 bytes! :D, sarcasm for the win

    The thing is, unless you're going to minify, compress and combine all of your CSS, JavaScript, etc. content, 300 bytes is barely worth bothering with, especially as the average Internet speed is increasing.

提交回复
热议问题