lessphp icon indicating copy to clipboard operation
lessphp copied to clipboard

contrast() now accepts percentage threshold

Open atkaye opened this issue 11 years ago • 9 comments

Fixes leafo/lessphp#501

atkaye avatar Dec 21 '13 17:12 atkaye

spec? :smiley:

leafo avatar Dec 21 '13 18:12 leafo

@threshold as percentage string rather than just decimal as per http://lesscss.org/#reference: contrast(@color1, [@darkcolor: black], [@lightcolor: white], [@threshold: 43%]);

Sound good?

atkaye avatar Dec 21 '13 18:12 atkaye

Sorry I meant adding a test to here: https://github.com/leafo/lessphp/blob/master/tests/inputs/colors.less

Edit: updated with correct file

leafo avatar Dec 21 '13 18:12 leafo

Got ya... added tests as above

atkaye avatar Dec 21 '13 18:12 atkaye

Nudge :smile:

atkaye avatar Dec 26 '13 18:12 atkaye

This looks really useful... @leafo please can you merge?

jonmilsom avatar Jan 16 '14 11:01 jonmilsom

added in https://github.com/MarcusSchwarz/lesserphp/releases/tag/v0.5.1

glensc avatar Aug 17 '17 20:08 glensc

It seems the tests are not passing correctly:

Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
   color3: #ffffff;
-  color4: #000000;
-  color5: #000000;
+  color4: #ffffff;
+  color5: #ffffff;
 }

I've confirmed with less.js that the way the test was written, has the correct 'Expected' value. But the currently produced 'Actual' isn't as it should be.

Krinkle avatar Oct 16 '18 04:10 Krinkle

I've published a rebased version to a pull-523 branch.

Krinkle avatar Oct 16 '18 04:10 Krinkle