Answers for "pass param from html to less"

CSS
1

pass param from html to less

// less 
Requires Less v3.9.0
each(range(5), {
	.mb-@{value} {
		margin-bottom: @value * 1px;
	}
});

// css
.mb-1 {
  margin-bottom: 1px;
}
.mb-2 {
  margin-bottom: 2px;
}
.mb-3 {
  margin-bottom: 3px;
}
.mb-4 {
  margin-bottom: 4px;
}
.mb-5 {
  margin-bottom: 5px;
}
Posted by: Guest on March-04-2021

Browse Popular Code Answers by Language