skariel / webalchemy

Modern web development with Python
MIT License
346 stars 21 forks source link

Add stylesheet support for main.html #129

Closed joaoventura closed 10 years ago

joaoventura commented 10 years ago

This allows to add stylesheets the same way as including javascript source files:

Ex:

class HellowWorldApp:

    stylesheets = ['http://code.jquery.com/mobile/1.4.0/jquery.mobile-1.4.0.min.css']

    include = ['http://code.jquery.com/jquery-1.10.2.min.js',
               'http://code.jquery.com/mobile/1.4.0/jquery.mobile-1.4.0.min.js']

It is working as expected, as can be seen in the browser:

<!DOCTYPE html>
<html class="ui-mobile">
   <head>
       <base href="http://127.0.0.1:8080/"></base>
       <link href="http://code.jquery.com/mobile/1.4.0/jquery.mobile-1.4.0.min.css" rel="stylesheet"></link>
       <script src="http://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script>
       <script src="http://code.jquery.com/mobile/1.4.0/jquery.mobile-1.4.0.min.js" type="text/javascript"></script>
skariel commented 10 years ago

Its a good addition, thanks!

joaoventura commented 10 years ago

No problem, I guess I'm going to stay with webalchemy for my project, just need to make jquery mobile work..