1

I'm making a migration from LESS to CSS3 of an internal React component library.

I have, for example, the following and I can't find a way to do the same in CSS. I found no way to replace the lighten function.

I thought about logging the lightened color and to store it in a variable, but it seems to me that it is not clean!

box-shadow: 0 0 var(--button-small-shadow-width) lighten(var(--colors-primary-blue), var(--button-lighten-percentage));

Thanks for your help.

Zakaria
  • 125
  • 8

1 Answers1

1

CSS does not have a lighten equivalent.

You would need to lighten the colour manually by the amount you want it reduced.

e.g

LESS

.myclass {
   background-color: lighten(hsl(80, 90%, 20%), 10%);
}

CSS

.myclass {
  background-color: hsl(80, 90%, 30%);
}
DreamTeK
  • 32,537
  • 27
  • 112
  • 171