Created
December 23, 2015 10:44
-
-
Save theexplay/a48b3443dca73422acc7 to your computer and use it in GitHub Desktop.
grid
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Новая реализация. | |
| * Новая сетка по высоте/ширине элементов. | |
| * | |
| * @param {object} params - включает в себя: шаг {number}, префикс {string}, css свойство {string}, !important {boolean}, debug {boolean} | |
| * @param {number} itr - количество итераций | |
| */ | |
| .grid(@params, @itr) when (@itr > 0) { | |
| @col: @itr; | |
| @step: extract(@params, 1); | |
| @prefix: extract(@params, 2); | |
| @property: extract(@params, 3); | |
| @important: extract(@params, 4); | |
| @debug: extract(@params, 5); | |
| .grid-params__@{prefix} when (@debug) and (@col = 12) { | |
| col: @col; | |
| step: @step; | |
| prefix: @prefix; | |
| property: @property; | |
| important: @important; | |
| debug: @debug; | |
| } | |
| .grid(@params, (@itr - 1)); | |
| .@{prefix}-@{col} when (@important) { | |
| @{property}: @step * @col !important; | |
| } | |
| .@{prefix}-@{col} when (@important = false) { | |
| @{property}: @step * @col; | |
| } | |
| } | |
| //Variables | |
| @par-height: 620px/12, ~'row', ~'height', false, false; | |
| @par-width: 100%/12, ~'col-pr', ~'width', true, false; | |
| @itr: 12; | |
| .grid(@par-height, @itr); | |
| .print-page { | |
| .grid(@par-width, @itr); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment