在python中使用scss进行web开发的工具包
scss_tools的Python项目详细描述
SCSS工具
scss工具是一个工具包,用于使使用python中的scss进行web开发更加容易。它监视scss文件目录中的文件更改,并自动为您重新编译。它还内置了compass和blueprint css框架,要使用scss工具,您需要编写一个yaml配置文件。下面是配置文件的示例
示例/scss.yaml:
--- monitor: # path to Scss directory for monitoring scss_dir: scss compiler: # verbosity of message output verbosity: 2 # compress compress: True # debug info debug_info: False # root of static files static_root: static # directory to output sprite images asset_root: static/asset # paths to import load_paths: [ static/scss ] # path of input files and path of file to output scss_files: [ [scss/style.scss, static/style.css], [scss/style2.scss, static/style2.css], ] ...
要开始监视和编译scss,只需键入:
scss_monitor -c scss.yaml
配置路径是scss.yaml,因此您也可以键入:
scss_monitor
它有内置的compass/blueprint scss框架,因此,您可以利用 他们直接
示例/scss/style.scss:
@import "compass/reset"; @include blueprint-global-reset;
您将得到
示例/static/style.css:
a, abbr, acronym, address, applet, article, aside, audio, b, big, blockquote, body, canvas, caption, center, cite, code, dd, del, details, dfn, div, dl, dt, em, embed, fieldset, figcaption, figure, footer, form, h1, h2, h3, h4, h5, h6, header, hgroup, html, i, iframe, img, ins, kbd, label, legend, li, mark, menu, nav, object, ol, output, p, pre, q, ruby, s, samp, section, small, span, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, time, tr, tt, u, ul, var, video { margin: 0; padding: 0; border: 0; font-size: 100%; font: inherit; vertical-align: baseline; } body { line-height: 1; } ol, ul { list-style: none; } table { border-collapse: collapse; border-spacing: 0; } caption, td, th { text-align: left; font-weight: normal; vertical-align: middle; } blockquote, q { quotes: none; } blockquote:after, blockquote:before, q:after, q:before { content: ""; content: none; } a img { border: none; } article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section, summary { display: block; }
安装
要安装SCSS工具,您可以键入:
pip install scss_tools
如果您更易于安装,请键入:
easy_install scss_tools