25

There was a problem with property 'grid-column'


Css:

.someClass {
   grid-column: 1 / 4;
}

Less compile it's in css as:

.someClass {
   grid-column: 0.25;
}

But it's works well:

.someClass {
   grid-column-start: 1;
   grid-column-end: 4;
}

How I can use correctly property grid-column with '/' symbol in Less?

Michael Benjamin
  • 346,931
  • 104
  • 581
  • 701
Valentin
  • 253
  • 3
  • 6

2 Answers2

28

You have to escape to "slash" when using LESS:

.somClass {
    grid-column: 1 e("/") 4;
}

But if you have the ability to bypass the "Slash" by decomposing the css property than do it (I personally find it a better way). You can also use the "~" sign to escape expressions, like ~"1/4"

Marouen Mhiri
  • 1,640
  • 1
  • 14
  • 20
27

try this

.someClass {
  grid-column: ~"1/4";
}
xkeshav
  • 53,360
  • 44
  • 177
  • 245