what is the difference to put the style in static/css or put it on 
views/templates?
*e.g.*
*views/templates/style/loader.html*
<style>
.loader {
border: 3px solid #f3f3f3;
border-radius: 50%;
border-top: 3px solid blue;
border-right: 3px solid green;
border-bottom: 3px solid red;
border-left: 3px solid yellow;
width: 20px;
height: 20px;
-webkit-animation: spin 2s linear infinite;
animation: spin 2s linear infinite;
}
@-webkit-keyframes spin {
0% { -webkit-transform: rotate(0deg); }
100% { -webkit-transform: rotate(360deg); }
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
</style>

*static/css/loader.css*
.loader {
border: 3px solid #f3f3f3;
border-radius: 50%;
border-top: 3px solid blue;
border-right: 3px solid green;
border-bottom: 3px solid red;
border-left: 3px solid yellow;
width: 20px;
height: 20px;
-webkit-animation: spin 2s linear infinite;
animation: spin 2s linear infinite;
}
@-webkit-keyframes spin {
0% { -webkit-transform: rotate(0deg); }
100% { -webkit-transform: rotate(360deg); }
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}

*1st using css*
*views/defaults/index.html*
{{extend 'layout.html'}}
<link rel="stylesheet" href="{{=URL('static','css/loader.css')}}"/>
{{=LOAD('default', 'form.load', ajax = True, target = 'form', 
content = DIV('', _class = 'loader') ) }}

*2nd using templates html*
*views/defaults/index.html*
{{extend 'layout.html'}}
{{include 'templates/style/loader.html'}}
{{=LOAD('default', 'form.load', ajax = True, target = 'form', 
content = DIV('', _class = 'loader') ) }}

i think in views the style can be compiled and cached, but when put in 
static it can be compressed and cached
what is the best practice to put style? is there any performance difference 
when put style on views or static?

thanks and best regards,
stifan

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to