24. TEMPLATE
CONTROLLER
应用 应用 page use
VISUAL 模块 模块 block-base
元素 icon/form/ajax/button
元件 容器 box/mod/...
模块划分
布局 layout
展示模块 Less is more
结构 ms-grid/grid
功能模块
框架 文档 full-screen/fixed-screen
核心 reset/variables/classes
25. 惭辞肠补资源组织 Less is more
usage
module
element
moca container
layout
structure
document
base
Images from:http://preview.zcool.com.cn/png/computer/20071008/png_100RO92007.html
26. 惭辞肠补资源组织 Less is more
usage
module
element
moca container
reset.less
layout
color.less
structure
document classes.less
base variables.less
Images from:http://preview.zcool.com.cn/png/computer/20071008/png_100RO92007.html
27. 惭辞肠补资源组织 Less is more
usage
module
element
moca container
layout
structure
document
base
Images from:http://preview.zcool.com.cn/png/computer/20071008/png_100RO92007.html
28. 惭辞肠补资源组织 Less is more
button-base.less
usage button-small.less
module
... ...
element
form-element.less
moca container
icon-base.less
layout
structure icon-timeline.less
document
base
Images from:http://preview.zcool.com.cn/png/computer/20071008/png_100RO92007.html
29. 惭辞肠补语法定义
/*-- base/variables.less --*/
@version: “?v=0.1.1”;
@imgPath: “/img/”;
/*-- base/color.less --*/
//ColorSystem For ChinaFace
@mLink: “#b40000”;
/*-- base/classes.less --*/
.ClearFix(){
zoom:1;
&:before,&:after{
content: "0020"; display: block; height: 0; overflow: hidden;
}
&:after{
clear: both;
}
}
Less http://
www.lesscss.org
Less is more
30. 依赖与继承
/**
* File: module/register.less
*/
@import "../base/variable";
@import "../element/form-element";
.form-input{
.efInput(220px)
}
/*-- element/form-element --*/
.efInput(@mWidth:218px,@mHeight:auto,@mSize:14px,@mBorderColor:#d4d4d4){
width:@mWidth;
... ...;
background: url(/slideshow/ss-12153414/12153414/&) no-repeat;
&:focus{
border-color: #a1a1a1;
}
}
Less http://
www.lesscss.org
Less is more
32. 惭辞肠补加载流程 Less is more
example.less Browser
Images from:http://preview.zcool.com.cn/png/computer/20071008/png_100RO92007.html
33. 惭辞肠补加载流程 Less is more
example.less a e g Browser
Images from:http://preview.zcool.com.cn/png/computer/20071008/png_100RO92007.html
34. 惭辞肠补加载流程 Less is more
example.less a e g Browser
a.less b c
e.less c g
g.less b c d
Images from:http://preview.zcool.com.cn/png/computer/20071008/png_100RO92007.html
35. 惭辞肠补加载流程 Less is more
example.less a e g Browser
a.less b c
e.less c g
g.less b c d
Images from:http://preview.zcool.com.cn/png/computer/20071008/png_100RO92007.html
36. 惭辞肠补加载流程 Less is more
example.less a e g
Lessphp Browser
a.less b c
e.less c g
g.less b c d
Images from:http://preview.zcool.com.cn/png/computer/20071008/png_100RO92007.html
37. 惭辞肠补加载流程 Less is more
example.less a e g
Lessphp Browser
a.less b —
c
e.less —
c —
g
g.less —
b c d
Images from:http://preview.zcool.com.cn/png/computer/20071008/png_100RO92007.html
38. 惭辞肠补加载流程 Less is more
example.less a e g
Lessphp Browser
a.less b —
c css
e.less —
c —
g
g.less —
b c d
Images from:http://preview.zcool.com.cn/png/computer/20071008/png_100RO92007.html
48. 生成应用模块与片段
/**
* block-base ?le
典型片段
* example:example.js
*/
/*-- how to use eva --*/
Eva.require(‘node’,...,‘msgbox’).ready(function(S){
//todo what you want when requires was loaded
S.Msgbox.con?rm(‘Hello,World!’,{
con?rm: function(O){
S.log(‘点击确认’);
}
});
});
Eva UI Library
49. 调用应用模块或片段
<!-- Page Content -->
</div>
<!-- Eva Seed -->
<script src=/slideshow/ss-12153414/12153414/"http:/r.chinaface.com/js/eva/1.0.4/eva-
min.js?v=0.1.2.7&combine=true&debug=1"></script>
<script>
/*-- webpage use --*/
Eva.usage('common,example,analysis');
</script>
</body>
</html>
YUI3 http://
yuilibrary.com/
Eva UI Library
59. EVA加载流程
Eva.usage(‘a,e,f,g’) browser
异步创建 请求 Minifycombo
compressed
browser
解析 YUI Loader
a
e a
— b
f b
— c d
g —
c
60. EVA加载流程
Eva.usage(‘a,e,f,g’) browser
异步创建 请求 Minifycombo
compressed
browser
解析 YUI Loader
a
e a
— b 编译
f b
— c d YUI Loader
g —
c
61. EVA加载流程
Eva.usage(‘a,e,f,g’) browser
异步创建 请求 Minifycombo
compressed
browser
解析 YUI Loader
a
e a
— b 编译
css js
f b
— c d YUI Loader
g —
c
62. EVA加载流程
Eva.usage(‘a,e,f,g’) browser
异步创建 请求 Minifycombo
compressed
browser
解析 请求 Minify
YUI Loader
combo
compressed
a
e a
— b 编译
css js
f b
— c d YUI Loader
g —
c