less - How to get value in percentage (%) or pixel (px) after doing some maths? | Lesscss -


i've little , simple question regarding lesscss. how can calculated value in percentage or pixel in lesscss. like, have : ((1 / 1) * 1) = 1. know answer 1, want "1" in percentage or pixel this: "1%" or "1px".

i need insert or put percentage (%) or pixel (px) sign in calculated value.

i'd appreciate help.

use:

unit(@yourvalue,px) 

or

unit(@yourvalue,~"%") 

read more here

additional note: default first occurring unit in calculation assigned result. example unit((1 / 2 * 3),px); , (1px / 2% * 3rem) both return 1.5px.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -