5
I’m doing some research to implement a feature to make life easier when it comes to programming.
It is possible to do this?
We are using VS2013 with Razor.
I have the following class Less:
.minColuna(@a) {
-webkit-min-width: @a;
-moz-min-width: @a;
-ms-min-width: @a;
-o-min-width: @a;
min-width: @a;
}
And I can’t call the method that:
Razor makes sure he can’t identify @a as a variable and because of that, Ben. I already tried doing this by JS putting the class on the table but gave the same problem... And I’ve tried using it:
class="minColuna(@Html.Raw("@a"): 300px)"
But he doesn’t get the style :/
It is possible to circumvent this bug?
Or even there is something inside Jquery / JS / LESS / HTML that can do something like this for me?
If you’re going to parameterize tag by tag, why don’t you use
style
?<th style="min-width:300px;"
– KaduAmaral
because I’m not going to do this, I’ve simplified as much as possible for example. I’m going to use this in a datatable on JS
– Andrey Hartung
But is that really possible? To the best of my knowledge Less has to be compiled for css to work, even using
less.js
it will work with linked files or tagsstyle
included in html withtype="text\less"
, but I’ve never heard that I could use direct in an attributeclass
, mainly because what you are trying to use is not even aclass
, he is a parameterized mixin– Leandro Godoy Rosa
I don’t know if it’s possible to do, so I came to ask here
– Andrey Hartung