less.js icon indicating copy to clipboard operation
less.js copied to clipboard

Add in an opacity() color function

Open ajcates opened this issue 15 years ago • 1 comments

Often times it is useful to take say @darkblue and set its opacity to about 50% for text shadows. Being able todo this like you use the other color functions would be super handy.

For example the following:

@blue : #00f;
h1 {
    text-color: @blue;
    text-shadow: opacity(darken(@blue, 10%), .5);
}

Would produce:

h1 {
    text-color: #00f;
    text-shadow: rgba(0, 0, 230, .5);
}

ajcates avatar Apr 19 '11 22:04 ajcates

Try fadein(@var, 50%) and fadeout(@var, 50%)

cloudhead avatar Apr 20 '11 01:04 cloudhead