BEM and asp.net mvc -


can faced integration of asp.net mvc , bem (http://bem.info/)? can introduce examples or links tutorials?

i cannot provide code examples, since not use asp.net. in case theoretical answer can help, here is:

first of all, can use css & file system parts of bem. mean can separate css code block components , store them in individual files.

blocks/     button.css     footer.css     header.css     login.css 

then, can gather files css files pages @import. flatten files, use borschik (https://github.com/bem/borschik). btw, might interested in released borschik sever https://github.com/bem/borschik-server , dev tool.

then, if ready go further, can provide javascript files individual components , store such files css files of components.

blocks/     button/         button.css         button.js     footer/         footer.css     header/         header.css     login/         login.css         login.js 

similar css, can use these pieces of javascript per-page javascript bundles. of course, there no keyword in javascript similar @import. here again borschik can help. if have page.js file content following:

borschik:include:blocks/login/login.js borschik:include:blocks/button/button.js 

run borschik on file , _page.js file content inlined. further information recommend article borschik on bem.info http://bem.info/articles/borschik/

if bored linking every block css file of page , again js file of page, there way unify that. can use bem tools https://github.com/bem/bem-tools. them possible create call page declaration in json. then, according declaration bem tools bundle both css , javascript files pages. , other techs, if need them. comment gets quite long. so, won't describe using bem tools here. if documentation not enough, please ask.

the last point templating system. guess asp net has one, doesn't it? if razor, must similar tt2 (perl). met such projects , can describe did.

they use 2 'layers' of templating. first 1 native embedded templating system. output not html usual bemjson page description. when, due having node.js bindings, possible run server-side javascript on json. in server-side javascript use bemhtml templates. can taste of 'quick start` article http://bem.info/articles/start-with-project-stub/ or tutorial http://bem.info/articles/bemhtml-intro/


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -