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

后端 未结 24 1792
-上瘾入骨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:50

    If you're using a stack which lets you use SASS, you can use the lighten function:

    $linkcolour: #0000FF;
    
    a {
      color: $linkcolour;
    }
    
    a.lighter {
      color: lighten($linkcolour, 50%);
    }
    

提交回复
热议问题