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
Снова вернемся к нашему примеру. В нем используется ссылка в качестве элемента блока `nav` — `nav__link`. Но в проекте ссылка вполне может быть и отдельным блоком. | |
Например, в все ссылки изначально должны быть реализованы одинаково. Для этого создается блок `link` и его CSS-правила `.link { color: blue }`. Но может возникнуть необходимость сделать ссылки в навигационном меню шапки немного больше и заметнее. | |
В такой ситуации также удобно воспользоваться миксом — в этот раз смешать на одном DOM-узле блок и элемент другого блока. В нашем случае это будет блок `link` и элемент `nav__link`. | |
Нет смысла создавать еще один блок, можно просто добавить специфические правила для ссылки, актуальные только навигационному меню, расположенному в шапке: | |
``` | |
.nav__link |
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
({ | |
block : 'page', | |
title : 'hello', | |
head : [ | |
{ elem : 'css', url : 'hello.min.css' } | |
], | |
scripts : [{ elem : 'js', url : 'hello.min.js' }], | |
mods : { theme : 'islands' }, | |
content : [ | |
{ |
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
({ | |
block : 'page', | |
title : 'hello', | |
head : [ | |
{ elem : 'css', url : 'hello.min.css' } | |
], | |
scripts : [{ elem : 'js', url : 'hello.min.js' }], | |
mods : { theme : 'islands' }, | |
content : [ | |
{ |
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
({ | |
block : 'page', | |
title : 'hello', | |
head : [ | |
{ elem : 'css', url : 'hello.min.css' } | |
], | |
scripts : [{ elem : 'js', url : 'hello.min.js' }], | |
mods : { theme : 'islands' }, | |
content : [ | |
{ |
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
({ | |
block : 'page', | |
title : 'hello', | |
head : [ | |
{ elem : 'css', url : 'hello.min.css' } | |
], | |
scripts : [{ elem : 'js', url : 'hello.min.js' }], | |
mods : { theme : 'islands' }, | |
content : [ | |
{ |
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
{ | |
"name": "bem-project-stub", | |
"version": "1.0.0", | |
"description": "BEM project stub", | |
"bugs": "https://github.com/bem/project-stub/issues", | |
"ignore": [ | |
".bem/cache", | |
"node_modules", | |
"libs" | |
], |
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
({ | |
block: 'page', | |
title: 'Title of the page', | |
favicon: '/favicon.ico', | |
head: [ | |
{ elem: 'meta', attrs: { name: 'description', content: '' }}, | |
{ elem: 'css', url: '_index.css' }, | |
{ elem: 'css', url: '_index.ie.css', ie: 'IE' } | |
], | |
scripts: [{ elem: 'js', url: '_index.js' }], |
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
/* global MAKE:false */ | |
// process.env.YENV = 'production'; | |
var PATH = require('path'); | |
require('bem-tools-autoprefixer').extendMake(MAKE); | |
MAKE.decl('Arch', { |
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
modules.define('box', ['i-bem__dom'], function(provide, BEMDOM) { | |
provide(BEMDOM.decl('box', { | |
onSetMod : { | |
'closed': { | |
'yes': function() { | |
this.domElem.animate({ | |
'margin-left' : '54em' | |
}, 1000); |
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
module.exports = { | |
block: 'page', | |
title: 'Title of the page', | |
favicon: '/favicon.ico', | |
head: [ | |
{ elem: 'meta', attrs: { name: 'description', content: '' }}, | |
{ elem: 'css', url: 'index.min.css' } | |
], | |
scripts: [{ elem: 'js', url: 'index.min.js' }], | |
content: [ |