mlut documentation

5 #core-helpers Core helpers

Set of universal helpers for using on any project.

Source: content/main.css, line 1440
Example
Markup: ../examples/core-helpers/btn/btn.html
<a class="btn test-content" href="#">Button</a>
Source: ../src/sass/core/helpers/btn.scss, line 3

5.2 #core-helpers.gs-debug Grid-system debug

Toggle full screen Open in new window Toggle example guides Toggle HTML markup

Helper for debugging layouts that built with grid system. It displays a grid system columns and gutters in the background of the container. The grid system are generated depending on the settings.

There may be minor inaccuracies in the drawing of the grid, because the grid is generated with CSS linear-gradient(). For gutters calculation are used CSS custom properties.

It not included in the default MLUT distributive.

Example

1

2

3

Markup: ../examples/core-helpers/grid-debug/grid-debug.html
<div class="row gs-debug">
	<div class="row__col sm_W1gc W1c_md">
		<div class="test-content">
			<h3>1</h3>
		</div>
	</div>
	<div class="row__col sm_W1gc md_W2gc">
		<div class="test-content">
			<h3>2</h3>
		</div>
	</div>
	<div class="row__col sm_W1gc md_W8gc">
		<div class="test-content">
			<h3>3</h3>
		</div>
	</div>
</div>
Source: ../src/sass/core/helpers/gs-debug.scss, line 3

5.3 #core-helpers.ratio-box Ratio-box

Toggle full screen Open in new window Toggle example guides Toggle HTML markup

Helper for creating containers, with proportional width and height. Implemented using a pseudo-element with a padding-bottom in %.

The default aspect ratio is 16:9.

Examples
Default styling
Some content here

[12:41:28] Starting 'style'... [12:41:29] mlut.min.css 12896 B (gzipped)

Block for creating containers, with proportional width and height. The default aspect ratio is 16: 9

.Pt75p_b
4:3 aspect ratio.
Some content here

[12:41:28] Starting 'style'... [12:41:29] mlut.min.css 12896 B (gzipped)

Block for creating containers, with proportional width and height. The default aspect ratio is 16: 9

.Pt100p_b
1:1 aspect ratio.
Some content here

[12:41:28] Starting 'style'... [12:41:29] mlut.min.css 12896 B (gzipped)

Block for creating containers, with proportional width and height. The default aspect ratio is 16: 9

Markup: ../examples/core-helpers/ratio-block/ratio-block.hbs
<div class="ratio-box {{modifier_class}} test-row md_W25p">
  <div>
		<b>Some content here</b>
		<p>[12:41:28] Starting 'style'... [12:41:29] mlut.min.css 12896 B (gzipped)</p>
		<p>Block for creating containers, with proportional width and height. The default aspect ratio is 16: 9</p>
	</div>
</div>
Source: ../src/sass/core/helpers/ratio-box.scss, line 3

5.4 #core-helpers.row Row

Toggle full screen Open in new window Toggle example guides Toggle HTML markup

Helper for creating layouts. Suitable for columns, cards and horizontal lists. By default, flexbox technology is used for layouts.

Parts of the layout within a row are created using the elements:

Rows can be put into each other an unlimited number of times.

Row contains CSS counter named ml-row-item.

It not included in the default MLUT distributive because partially based on the legacy grid system. It is recommended to use the CSS grid utilities instead.

Example

sm_W2gc md_W3gc

Et molestie ac, massa, eget egestas purus viverra?

sm_W2gc md_W4gc

Et molestie ac, ullamcorper morbi tincidunt ornare massa, eget egestas purus viverra?

sm_W2gc md_W5gc

Et molestie ac, feugiat sed lectus vestibulum mattis ullamcorper velit sed ullamcorper morbi tincidunt ornare massa, eget egestas purus viverra?

Markup: ../examples/core-helpers/row/row.html
<div class="row">
	<div class="row__col sm_W2gc md_W3gc">
		<h3>sm_W2gc md_W3gc</h3>
		<p>Et molestie ac, massa, eget egestas purus viverra?</p>
	</div>
	<div class="row__col sm_W2gc md_W4gc">
		<h3>sm_W2gc md_W4gc</h3>
		<p>Et molestie ac, ullamcorper morbi tincidunt ornare massa, eget egestas purus viverra?</p>
	</div>
	<div class="row__col sm_W2gc md_W5gc">
		<h3>sm_W2gc md_W5gc</h3>
		<p>Et molestie ac, feugiat sed lectus vestibulum mattis ullamcorper velit sed ullamcorper morbi tincidunt ornare massa, eget egestas purus viverra?</p>
	</div>
</div>
Source: ../src/sass/core/helpers/row.scss, line 3

5.4.1 #core-helpers.row.row__col row__col

Toggle full screen Open in new window Toggle example guides Toggle HTML markup

The main element for creating columns in layout. By default, it stretches the entire width of the container. The columns have gutters on the sides and bottom.

The gutters are implemented using the margin and CSS custom properties.

Column width is set using W utility. See example above. The formulas for calculating the width and offset for the column are stored in the custom properties. In --ml-gscf for W and --ml-gsof for Ml utility. These formulas:

--ml-gscf: calc(var(--ml-gsc) / var(--ml-gscc) * 100% - var(--ml-gsfd, var(--ml-gg)) * 2);
--ml-gsof: calc(var(--ml-gso) / var(--ml-gscc) * 100% + var(--ml-gsfd, var(--ml-gg)));

--ml-gsc or --ml-gso is the value of the width or offset in the grid columns. This is a custom property of the utility.
--ml-gscc - the number of columns in the grid system. This is a global custom property that can be changed on any DOM node.
--ml-gsfd - variable is equal to the gutter if the gutter at the columns is created using margin. In row__col is equal 1gg.
Some of these variables can be changed using custom utilities.

You can create nested layouts with a mix of row and row__col on the same DOM node. If you don't need double fields in the nested row, use the mix with the row__item. See example below.

Example

Parent .md_W9gc

this .md_W3gc

Parent .md_W9gc

this .md_W4gc

Parent have double gutter

this .md_W5gc

.md_W3gc

Similar mix with row__item:

Parent .md_W9gc

this .md_W3gc

Parent .md_W9gc

this .md_W4gc

Parent without double gutter

this .md_W5gc

.md_W3gc

Markup: ../examples/core-helpers/row/row__col.html
<div class="row">
	<div class="row__col row test-row sm_W4gc md_W9gc">
		<div class="row__col sm_W2gc md_W3gc">
			<h3>Parent .md_W9gc</h3>
			<p>this .md_W3gc</p>
		</div>
		<div class="row__col sm_W2gc md_W4gc">
			<h3>Parent .md_W9gc</h3>
			<p>this .md_W4gc</p>
		</div>
		<div class="row__col sm_W2gc md_W5gc">
			<h3>Parent have double gutter</h3>
			<p>this .md_W5gc</p>
		</div>
	</div>
	<div class="row__col sm_W2gc md_W3gc">
		<h3>.md_W3gc</h3>
	</div>
</div>
<p><b>Similar mix with row__item:</b></p>
<div class="row -Mx0">
	<div class="row__item row -Mx0 test-row sm_W4gc md_W9gc">
		<div class="row__col sm_W2gc md_W3gc">
			<h3>Parent .md_W9gc</h3>
			<p>this .md_W3gc</p>
		</div>
		<div class="row__col sm_W2gc md_W4gc">
			<h3>Parent .md_W9gc</h3>
			<p>this .md_W4gc</p>
		</div>
		<div class="row__col sm_W2gc md_W5gc">
			<h3>Parent without double gutter</h3>
			<p>this .md_W5gc</p>
		</div>
	</div>
	<div class="row__col sm_W2gc md_W3gc">
		<h3>.md_W3gc</h3>
	</div>
</div>
Source: ../src/sass/core/helpers/row.scss, line 23

5.4.2 #core-helpers.row.row__item row__item

Toggle full screen Open in new window Toggle example guides Toggle HTML markup

Element for creating parts of the layout. By default, it stretches across the width of the content.

The sizes and offsets are set with help of utilities.

Like a row__col, an element contains formulas for calculating width and offset. But --ml-gsfd here is equal 0px.

Example

Элемент 0

элемент без отступов

Элемент 1

с внутренними отступами

Элемент 2

элемент без отступов

Последний элемент

с внешним отступом

Markup: ../examples/core-helpers/row/row__item.html
<div class="row -Mx0">
	<div class="row__item">
		<h3>Элемент 0</h3>
		<p>элемент без отступов</p>
	</div>
	<div class="row__item test-content">
		<h3>Элемент 1</h3>
		<p>с внутренними отступами</p>
	</div>
	<div class="row__item sm_W2gc md_W2gc">
		<h3>Элемент 2</h3>
		<p>элемент без отступов</p>
	</div>
	<div class="row__item Ml1gg">
		<h3>Последний элемент</h3>
		<p>с внешним отступом</p>
	</div>
</div>
Source: ../src/sass/core/helpers/row.scss, line 47

5.5 #core-helpers.wrapper Wrapper

Toggle full screen Open in new window Toggle example guides Toggle HTML markup

The helper-container for the main content of the page. The maximum width is set in the settings. The default is 1200px.

The container has sides padding that equal to gutters so that the content does not stick to sides on small screens. On wide screens the container is centered.

Example

Simple text

Some content

Markup: ../examples/core-helpers/wrapper/wrapper.html
<div class="wrapper">
	<h1>Simple text</h1>
	<p>Some content</p>
</div>
Source: ../src/sass/core/helpers/wrapper.scss, line 3