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?
'grid-gap' has been deprecated in favor of 'gap'. In a similar vein 'grid-row-gap' and 'grid-column-gap' have been deprecated in favor of 'row-gap' and 'column-gap'. Unfortunately, the new features aren't recognized by Visual Studio yet either. As far as May 2020, 'grid-gap' is shown as "Obsolete" in VSC.
The problem is that you are applying the grid-template-columns property to grid items. This is a grid container property. It will be ignored on grid items (unless they are also grid containers). Instead use the grid-column and grid-row properties, which apply to grid items.
To avoid the minimum width/height calculation size, you should therefore set the minimum width or heigth to another value than auto . And as you can see: the first column does not overflow anymore. the two columns share 50% of the space as specified in the fraction.
The vertical gaps are caused by the images not filling the vertical space in the grid items. The problem is made worse with align-items: center on the container, which removes the align-items: stretch default. Essentially, there are no gaps between grid items.
Property Values: The grid-column-start and grid-column-end, property can be described in three ways: auto: The element will be placed in the default flow. It is default value. span n: It specifies the number of columns item will span in grid-column-start and grid-column-end both cases.
Definition and Usage. The grid-column property specifies a grid item's size and location in a grid layout, and is a shorthand property for the following properties: grid-column-start. grid-column-end.
However, once you’ve already got your download, it can be a real pain to tweak the way the grid works. Because LESS allows you to insert variables into your CSS, we can use it to build a framework that is easily customizable during the development stage. The goal will be to create something that allows custom grid widths with very little effort.
The grid_1 class width is simply set to the columnWidth variable. The grid_2 class is twice as wide and now contains extra gutter space for the new column. These amounts simply increase as you go farther: the column width multiplier increases by one each time and the gutter width multiplier increases by two each time.
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"
try this
.someClass { grid-column: ~"1/4"; }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With