diff options
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/djangoproject/djangoproject/__init__.py | 0 | ||||
| -rw-r--r-- | examples/djangoproject/djangoproject/settings.py | 25 | ||||
| -rw-r--r-- | examples/djangoproject/djangoproject/static/css/buttons.css | 50 | ||||
| -rw-r--r-- | examples/djangoproject/djangoproject/static/css/layout.css | 143 | ||||
| -rw-r--r-- | examples/djangoproject/djangoproject/templates/base.html | 23 | ||||
| -rw-r--r-- | examples/djangoproject/djangoproject/templates/index.html | 8 | ||||
| -rw-r--r-- | examples/djangoproject/djangoproject/templates/styleguide.html | 19 | ||||
| -rw-r--r-- | examples/djangoproject/djangoproject/urls.py | 10 | ||||
| -rw-r--r-- | examples/djangoproject/djangoproject/wsgi.py | 5 | ||||
| -rw-r--r-- | examples/djangoproject/manage.py | 10 | ||||
| -rw-r--r-- | examples/djangoproject/requirements.txt | 2 | 
11 files changed, 295 insertions, 0 deletions
| diff --git a/examples/djangoproject/djangoproject/__init__.py b/examples/djangoproject/djangoproject/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/examples/djangoproject/djangoproject/__init__.py diff --git a/examples/djangoproject/djangoproject/settings.py b/examples/djangoproject/djangoproject/settings.py new file mode 100644 index 0000000..39b1c62 --- /dev/null +++ b/examples/djangoproject/djangoproject/settings.py @@ -0,0 +1,25 @@ +import os + +PROJECT_ROOT = os.path.dirname(__file__) + +DEBUG = True +SECRET_KEY = 'G0GS4C7QLq3FhdDYrNtDuEBoLuXzDqaS' +ROOT_URLCONF = 'djangoproject.urls' + +TEMPLATE_DIRS = [os.path.join(PROJECT_ROOT, 'templates')] + +STATIC_URL = '/static/' +STATIC_ROOT = os.path.join(PROJECT_ROOT, 'public') + +STATICFILES_DIRS = [os.path.join(PROJECT_ROOT, 'static')] +STATICFILES_FINDERS = [ +    'django.contrib.staticfiles.finders.FileSystemFinder', +    'django.contrib.staticfiles.finders.AppDirectoriesFinder', +] + +PYKSS_DIRS = [os.path.join(PROJECT_ROOT, 'static', 'css')] + +INSTALLED_APPS = [ +    'django.contrib.staticfiles', +    'pykss.contrib.django', +] diff --git a/examples/djangoproject/djangoproject/static/css/buttons.css b/examples/djangoproject/djangoproject/static/css/buttons.css new file mode 100644 index 0000000..edcb4b3 --- /dev/null +++ b/examples/djangoproject/djangoproject/static/css/buttons.css @@ -0,0 +1,50 @@ +/* +Your standard form button. + +:hover    - Highlights when hovering. +:disabled - Dims the button when disabled. +.primary  - Indicates button is the primary action. +.smaller  - A smaller button + +Styleguide 1.1 +*/ +button { +  padding: 5px 15px; +  line-height: normal; +  font-family: "Helvetica Neue", Helvetica; +  font-size: 12px; +  font-weight: bold; +  color: #666; +  text-shadow: 0 1px rgba(255, 255, 255, 0.9); +  border-radius: 3px; +  border: 1px solid #ddd; +  border-bottom-color: #bbb; +  background: #f5f5f5; +  filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='$start', endColorstr='$end'); +  background: -webkit-gradient(linear, left top, left bottom, from(#f5f5f5), to(#e5e5e5)); +  background: -moz-linear-gradient(top, #f5f5f5, #e5e5e5); +  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15); +  cursor: pointer; } +  button.primary, button.primary:hover { +    color: #fff; +    text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.4); +    border-color: #74bb5a; +    border-bottom-color: #509338; +    background: #8add6d; +    filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='$start', endColorstr='$end'); +    background: -webkit-gradient(linear, left top, left bottom, from(#8add6d), to(#60b044)); +    background: -moz-linear-gradient(top, #8add6d, #60b044); +    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2); } +  button.smaller { +    font-size: 11px; +    padding: 4px 7px; } +  button:hover { +    color: #337797; +    background: #f0f7fa; +    filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='$start', endColorstr='$end'); +    background: -webkit-gradient(linear, left top, left bottom, from(#f0f7fa), to(#d8eaf2)); +    background: -moz-linear-gradient(top, #f0f7fa, #d8eaf2); +    border-color: #cbe3ee; +    border-bottom-color: #97c7dd; } +  button:disabled { +    opacity: 0.5; } diff --git a/examples/djangoproject/djangoproject/static/css/layout.css b/examples/djangoproject/djangoproject/static/css/layout.css new file mode 100644 index 0000000..871d414 --- /dev/null +++ b/examples/djangoproject/djangoproject/static/css/layout.css @@ -0,0 +1,143 @@ +/*---------------------------------------------------------------------------- +  @group Global Reset +----------------------------------------------------------------------------*/ +* { +  padding:0; +  margin:0; +} +h1, h2, h3, h4, h5, h6, p, pre, blockquote, label, ul, ol, dl, fieldset, address { margin:1em 0; } +li, dd { margin-left:5%; } +fieldset { padding: .5em; } +select option{ padding:0 5px; } + +.access{ display:none; } /* For accessibility related elements */ +.clear{ clear:both; height:0px; font-size:0px; line-height:0px; overflow:hidden; } +a{ outline:none; } +a img{ border:none; } + +.clearfix:after { +    content: "."; +    display: block; +    height: 0; +    clear: both; +    visibility: hidden; +} +* html .clearfix {height: 1%;} +.clearfix {display:inline-block;} +.clearfix {display: block;} + +/* @end */ + +body{ +  font-family:Helvetica, Arial, sans-serif; +  font-size:14px; +} + +header{ +  padding:10px; + +  font-size:16px; +  color:#666; + +  background:#f1f1f1; +  border-bottom:1px solid #ddd; +} + +#wrapper{ +  width:600px; +  padding-left:200px; +} + +nav[role=main]{ +  float:left; +  margin-left:-200px; +  width:160px; +} +nav ul{ +  margin-left:10px; +} +nav li{ +  list-style-type:none; +  margin:10px 0; +} +nav li a{ +  text-decoration:none; +  color:#666; +} + +/*---------------------------------------------------------------------------- +  @group Styleguide Styles +----------------------------------------------------------------------------*/ + +h1.styleguide { +  margin: 0 0 -5px 0; +  font-size: 24px; +  color: #000; } + +.styleguide-example { +  margin: 15px 0; +  background: rgba(255, 255, 255, 0.5); +  border: 1px solid #ddd; +  box-shadow: 0 0 5px rgba(0, 0, 0, 0.1); } +  .styleguide-example > h3 { +    margin: 0; +    padding: 5px; +    color: #fff; +    font-size: 12px; +    text-transform: uppercase; +    background: #333; +    border-top: 1px solid #000; } +    .styleguide-example > h3 em { +      float: right; +      text-transform: none; +      font-style: normal; +      font-weight: normal; +      color: #999; } +  .styleguide-example .styleguide-description { +    padding: 10px 5px; +    background: #f1f1f1; +    border-bottom: 1px solid #ddd; } +    .styleguide-example .styleguide-description p:first-child { +      margin-top: 0; } +    .styleguide-example .styleguide-description p:last-child { +      margin-bottom: 0; } +  .styleguide-example .styleguide-element { +    position: relative; +    padding: 20px; } +  .styleguide-example .styleguide-element + .styleguide-element { +    margin-top: -5px; +    padding-top: 15px; +    border-top: 1px solid #eee; } +  .styleguide-example .styleguide-element .styleguide-modifier-name { +    display: block; +    position: absolute; +    top: 0; +    right: 0; +    padding: 5px 8px; +    font-size: 11px; +    color: #999; +    background: #f9f9f9; +    border: 1px solid #eee; +    border-top: none; } +  .styleguide-example .styleguide-html { +    padding: 5px 10px; +    background: #edf6f8; +    border-top: 1px solid #dde7ea; +    overflow: auto; } +    .styleguide-example .styleguide-html .highlight { +      background: none; } +  .styleguide-example ul.styleguide-modifiers { +    margin: 0 0 0 10px; } +    .styleguide-example ul.styleguide-modifiers li { +      list-style-type: none; +      margin-left: 0; } +    .styleguide-example ul.styleguide-modifiers li strong { +      font-family: Monaco, monospace; +      font-size: 12px; +      font-weight: normal; +      color: #222; } +  .styleguide-example > .styleguide-code { +    font-family: Monaco, monospace; +  } + +/* @end */ diff --git a/examples/djangoproject/djangoproject/templates/base.html b/examples/djangoproject/djangoproject/templates/base.html new file mode 100644 index 0000000..f52ed82 --- /dev/null +++ b/examples/djangoproject/djangoproject/templates/base.html @@ -0,0 +1,23 @@ +<!DOCTYPE html> +{% load static %} +<html> +    <head> +        <meta http-equiv="content-type" content="text/html;charset=UTF-8" /> +        <title>Styleguide Example</title> +        <link rel="stylesheet" href="{% static "css/layout.css" %}" type="text/css" /> +        <link rel="stylesheet" href="{% static "css/buttons.css" %}" type="text/css" /> +    </head> +    <body> +        <header>Styleguide Example</header> +        <div id="wrapper"> +            <nav role="main"> +                <ul> +                    <li><a href="{% url "index" %}">Home</a></li> +                    <li><a href="{% url "styleguide" %}">Styleguide</a></li> +                </ul> +            </nav> +            {% block content %}{% endblock %} +        </div> +        <script src="{% static "pykss/js/kss.js" %}"></script> +    </body> +</html> diff --git a/examples/djangoproject/djangoproject/templates/index.html b/examples/djangoproject/djangoproject/templates/index.html new file mode 100644 index 0000000..06660ce --- /dev/null +++ b/examples/djangoproject/djangoproject/templates/index.html @@ -0,0 +1,8 @@ +{% extends "base.html" %} + +{% block content %} +<h1>Welcome</h1> +<p>This is an example site. It doesn't really do anything, but it does have some rad buttons</p> +<p><button>I am a button</button></p> +<p>Check out the <a href="{% url "styleguide" %}">styleguide</a> to see the value here.</p> +{% endblock %} diff --git a/examples/djangoproject/djangoproject/templates/styleguide.html b/examples/djangoproject/djangoproject/templates/styleguide.html new file mode 100644 index 0000000..05d736d --- /dev/null +++ b/examples/djangoproject/djangoproject/templates/styleguide.html @@ -0,0 +1,19 @@ +{% extends "base.html" %} +{% load pykss %} + +{% block content %} +{% styleguideblock styleguide "1.1" %} +    <button class="{{ modifier.class_name }}">Example Button</button> +{% endstyleguideblock %} + +{% verbatim %} +<p>This block above was created with a simple template call:</p> +<pre> +    <code> +{% styleguideblock styleguide "1.1" %} +    <button class="{{ modifier.class_name }}">Example Button</button> +{% endstyleguideblock %} +    </code> +</pre> +{% endverbatim %} +{% endblock %} diff --git a/examples/djangoproject/djangoproject/urls.py b/examples/djangoproject/djangoproject/urls.py new file mode 100644 index 0000000..061ec2c --- /dev/null +++ b/examples/djangoproject/djangoproject/urls.py @@ -0,0 +1,10 @@ +from django.conf.urls import patterns, url +from django.views.generic.base import TemplateView + +from pykss.contrib.django.views import StyleGuideView + + +urlpatterns = patterns('', +    url(r'^$', TemplateView.as_view(template_name='index.html'), name='index'), +    url(r'^styleguide/$', StyleGuideView.as_view(template_name='styleguide.html'), name='styleguide'), +) diff --git a/examples/djangoproject/djangoproject/wsgi.py b/examples/djangoproject/djangoproject/wsgi.py new file mode 100644 index 0000000..d306fe1 --- /dev/null +++ b/examples/djangoproject/djangoproject/wsgi.py @@ -0,0 +1,5 @@ +import os +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'djangoproject.settings') + +from django.core.wsgi import get_wsgi_application +application = get_wsgi_application() diff --git a/examples/djangoproject/manage.py b/examples/djangoproject/manage.py new file mode 100644 index 0000000..6c0acfc --- /dev/null +++ b/examples/djangoproject/manage.py @@ -0,0 +1,10 @@ +#!/usr/bin/env python +import os +import sys + + +if __name__ == '__main__': +    os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'djangoproject.settings') + +    from django.core.management import execute_from_command_line +    execute_from_command_line(sys.argv) diff --git a/examples/djangoproject/requirements.txt b/examples/djangoproject/requirements.txt new file mode 100644 index 0000000..c52f862 --- /dev/null +++ b/examples/djangoproject/requirements.txt @@ -0,0 +1,2 @@ +Django==1.5 +https://github.com/seanbrant/pykss.git | 
