Skip to content

Instantly share code, notes, and snippets.

@nicothin
Created March 10, 2018 09:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nicothin/f739ffe0401cee3c3a390740e64c9f58 to your computer and use it in GitHub Desktop.
Save nicothin/f739ffe0401cee3c3a390740e64c9f58 to your computer and use it in GitHub Desktop.
//- Все примеси в этом файле должны начинаться c имени блока (TEMP-00)
mixin my-new-block(text, mods)
//- Принимает:
//- text {string} - текст
//- mods {string} - список модификаторов
//- Вызов:
+my-new-block('Текст', 'some-mod')
-
// список модификаторов
var allMods = '';
if(typeof(mods) !== 'undefined' && mods) {
var modsList = mods.split(',');
for (var i = 0; i < modsList.length; i++) {
allMods = allMods + ' my-new-block--' + modsList[i].trim();
}
}
.my-new-block(class=allMods)&attributes(attributes)
.my-new-block__inner!= text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment