Dynamically change color to lighter or darker by percentage CSS (Javascript)

后端 未结 24 1786
-上瘾入骨i
-上瘾入骨i 2020-11-28 01:12

We have a big application on the site and we have a few links which are, let\'s say blue color like the blue links on this site. Now I want to make some other links, but wit

24条回答
  •  清歌不尽
    2020-11-28 01:30

    In LESS, you would use the following variables:

    @primary-color: #999;
    @primary-color-lighter: lighten(@primary-color, 20%);
    

    This would take the 1st variable and lighten it by 20% (or any other percentage). In this example, you'd end up with your lighter color being: #ccc

提交回复
热议问题