Package: scss
Python-scssWarning:Im not support python-scss anymore. Usepyscssby Kronus.Python-scss isSCSScompiler for python. Documentation available atpypiorgithub.
This is part ofzeta-library.ContentsPython-scssFeaturesRequirementsInstallationUsageChangesExamplesOptionsBug trackerContributingLicenseCopyrightNoteFeaturesPython-scss has most of the funcitonality in SassSCSS3.2 and more. It supports:Nested rulesKeyword argumentsMixins:@mixin,@includeFunctions:@function,@returnInheritance:@extendConditions:@if,@else,@if elseLoops:@forVariables:$,@variables,@varsImages:image-url,image-width,image-height, ..Embedded inline images:inline-imageColors handling:adjust-color(),scale-color(),opacify()/transparentize(),lighten()/darken(),mix(), …Math functions:sin(),cos(),tan(),round(),ceil(),floor(),pi(), …Options:@option compress:true, sort:false;,@option comments:false;Compass_ helpers:enumerate,type-of, …Sorting declarations: inZen sorting orderNoteFor@importsupport you can usezeta-library, python compass alternative.Zeta-library supported@import url(path or http), but all static files css, scss.Also zeta support js importrequire('../jquery.js');. Zeta allow you control all your static files.Requirementspython >= 2.5pyparsing >= 1.5.5Installationpython-scssshould be installed using pip or setuptools:pip install scss

easy_install scssUsageFrom python source code:from scss import parser

file_path = path_to_file
src = open( file_path ).read()

# from file
print parser.load( 'file_path' )

# from string
print parser.parse( 'src' )

# Create parser object
p = parser.Stylesheet( options=dict( compress=True ) )
print p.loads( src )
p.load( file_path )
print pFrom command line:$ scss --help
Usage: scss [OPTION]... [INFILE] [OUTFILE]

Compile INFILE or standard input, to OUTFILE or standard output.

Options:
--version             show program's version number and exit
-h, --help            show this help message and exit
-c, --cache           Create and use cache file. Only for files.
-i, --interactive     Run in interactive shell mode.
-m, --compress        Compress css output.
-w WATCH, --watch=WATCH
                        Watch files or directories for changes. The location
                        of the generated CSS can be set using a colon:
                        scss -w input.scss:output.css
-S, --no-sorted       Do not sort declaration.
-C, --no-comments     Clear css comments.
-W, --no-warnings     Disable warnings.In interactive mode:scss -i

>>> 25px + 1.5emChangesMake sure you`ve read the following document if you are upgrading from previous versions of scss:http://packages.python.org/scss/changes.htmlExamplesNested RulesExample:.selector {
    a {
        display: block;
    }
    strong {
        color: blue;
    }
}…produces:.selector a {
    display: block}

.selector strong {
    color: blue}VariablesExample:$main-color: #ce4dd6;
$style: solid;
$side: bottom;
#navbar {
    border-#{$side}: {
    color: $main-color;
    style: $style;
    }
}…produces:#navbar {
    border-bottom-color: #ce4dd6;
    border-bottom-style: solid}MixinsExample:@mixin rounded($side, $radius: 10px) {
    border-#{$side}-radius: $radius;
    -moz-border-radius-#{$side}: $radius;
    -webkit-border-#{$side}-radius: $radius;
}
#navbar li { @include rounded(top); }
#footer { @include rounded(top, 5px); }
#sidebar { @include rounded(left, 8px); }…produces:#navbar li {
        -moz-border-radius-top: 10px;
        -webkit-border-top-radius: 10px;
        border-top-radius: 10px}

#footer {
        -moz-border-radius-top: 5px;
        -webkit-border-top-radius: 5px;
        border-top-radius: 5px}

#sidebar {
        -moz-border-radius-left: 8px;
        -webkit-border-left-radius: 8px;
        border-left-radius: 8px}Extend(using@extend)Example:.error {
    border: 1px #f00;
    background-color: #fdd;
}
.error.intrusion {
    background-image: url("/image/hacked.png");
}
.seriousError {
    @extend .error;
    border-width: 3px;
}…produces:.error, .seriousError {
    background-color: #fdd;
    border: 1px #f00}

.error .intrusion, .seriousError .intrusion {
    background-image: url('/image/hacked.png')}

.seriousError {
    border-width: 3px}Interactive modeExample:$ python scss.py --interactive
>>> 25px + 1.5em
44.5px
>>> lighten(rgba(130,130,130,.4),10%)
rgba(155,155,155,0.40)
>>> .rule { test: red; }
.rule {
    test: red }
>>> _OptionsPython-scss has the following options:compress: Compress output css, default is Falsecache: Precache compile result, default is Falsecomments: Leave css comments, default is Truesort: Sort declaration, default is True
Declaration sorted inZen sorting orderwarn: Enable or disable warnings: unknown mixin, declaration name, extend ruleset, default is TrueOption can be defined…from command line:scss -m -S file.scssfrom python:parser = Stylesheet( options=dict( compress=True ) )from scss source:@option compress: true, sort: false;Notepython-scss is still at early stages of developmentBug trackerIf you have any suggestions, bug reports or
annoyances please report them to the issue tracker
athttps://github.com/klen/python-scss/issuesContributingDevelopment of python-scss happens at github:https://github.com/klen/python-scssklen(Kirill Klenov)LicenseLicensed under aGNU lesser general public license.CopyrightCopyright (c) 2011 Kirill Klenov (horneds@gmail.com)Compass:(c) 2009 Christopher M. Eppsteinhttp://compass-style.org/SCSS:(c) 2006-2009 Hampton Catlin and Nathan Weizenbaumhttp://sass-lang.com/NoteYour feedback are welcome!