GithubHelp home page GithubHelp logo

cobaltchang / django_kss Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dorm7/django_kss

0.0 2.0 0.0 368 KB

A KSS Style Guide Enhanced APP.

Makefile 0.10% Python 66.28% JavaScript 8.63% HTML 13.12% CSS 11.87%

django_kss's Introduction

introduction

Help you launch your style guide site with django in KSS syntax. you can integrate the style giude in your site easily. I use it every day. feel free to give me any suggestion.

I now change the name to django-kss-styleguide https://pypi.python.org/pypi/django-kss-styleguide/

pictures/screenshot.png

start

pip install django-kss-styleguide

Settings

in yout settings.py

Add the app,

INSTALLED_APPS += (
            "compressor",
    "django_kss",
)

Related Settings

in settings.py

because scss is very common, we support it via djagno compressor Add setting about django compressor.

COMPRESS_PRECOMPILERS = (
        ('text/x-scss', 'django_libsass.SassCompiler'),
)
STATICFILES_FINDERS = (
        'django.contrib.staticfiles.finders.FileSystemFinder',
        'django.contrib.staticfiles.finders.AppDirectoriesFinder',
        'compressor.finders.CompressorFinder',
)
#  Django Compressor for development. so it can put image to correct place
COMPRESS_ENABLED = True
COMPRESS_REBUILD_TIMEOUT = 0

STATIC_ROOT = '/tmp/root'

in your app.

add filename called styleguide.py in your app.

styleguide = {
        'source_dir': 'static/css',
        'verbose_name': 'Sample APP2',   #Optional
        'target_files': 'static/css/form.scss'  # optional
}

source_dir: Where you write you kss comment and css files

verbose_name: Your app name

target_files: If you use scss, put the scss file you want to compile

urls.py settings

Routing, add the following two lines in your project's urls.py

import:

import django_kss.urls

add the url patterns:

url(r'^$', include(django_kss.urls)),

html

for F2E or designer

put your complete html in templates/prototype/

you can view it automatically in the site

Writing The KSS in your scss/less/css file

/*
Buttons

Styleguide 1
*/


/*
Your standard form button.

.btn-danger   -  danger
.btn-warning  -  warning
.btn-info     -  info


Example:
        <button class="liftedBtn $modifier_class" >按鈕</button>

Styleguide 1.1
*/

.liftedBtn{
        @extend .btn;
        position: relative;
        border-width: 0;
        letter-spacing: 1px;
        border-bottom-color: rgba(30,30,30,0.3);
        border-bottom-width: 0;
        transition: all 0.2s;
        bottom: 0;
        &:hover{
                bottom: $strong-border-width;
                border-bottom-width: $strong-border-width;
        }
}

One More Things

the base template is already integrate livereload.

to utilize livereload,

sudo pip install livereload

and type 'livereload .' in you repository root.

you can see all the braowser will reflect your change

django_kss's People

Contributors

timtan avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.