跳转到主要内容

用于Python的出色SASS和SCSS编译

项目描述

sasstastic

CI Coverage pypi versions license

用于Python的出色SASS和SCSS编译

安装

pip install sasstastic

运行

sasstastic --help

检查sasstastic是否已安装并获取帮助信息。

用法

定义配置文件 sasstastic.yml

download:
  # downloaded files will be saved in this directory
  dir: styles/.libs
  sources:
    # download a font css file from google fonts and save it to goog-fonts.css
    - url: >
       https://fonts.googleapis.com/css?
       family=Merriweather:400,400i,700,700i|Titillium+Web|Ubuntu+Mono&display=swap
      to: google-fonts.css

    # download a style sheet from select2, this will be saved to "select2.css" as
    # the name can be inferred from the url
    - url: 'https://raw.githubusercontent.com/select2/select2/4.0.13/dist/css/select2.css'

    # download the full bootstrap 4 bundle and extract the scss files to the bootstrap/ directory
    - url: https://github.com/twbs/bootstrap/archive/v4.4.1.zip
      extract:
        'bootstrap-4.4.1/scss/(.+)$': bootstrap/


# SCSS and SASS files will be build from this directory
build_dir: styles/
# and saved to this directory
output_dir: css/
# the output directory "css/" will be deleted before all builds
wipe_output_dir: true

然后运行 sasstastic 来构建您的sass文件。

注意

  • 如果 sasstastic.yml 文件不在当前工作目录中,您可以将其路径作为参数传递给sasstastic,例如 sasstastic path/to/sasstastic.yml 或只是 sasstastic path/to/
  • 默认情况下,在 sasstastic.yml 中定义的路径: download.dirbuild_diroutput_dir 是相对于 sasstastic.yml 文件的**相对路径**
  • 您可以使用CLI的 -o 参数覆盖输出目录 ouput_dir,有关更多信息,请参阅 sasstastic --help
  • sasstastic可以在“开发”或“生产”模式下构建
    • 开发 模式下,CSS不会压缩,会创建一个映射文件,并将 build_dirdownload.dir 中的所有文件复制到 output_dir 中,以便映射文件可以正确工作
    • 生产 模式下,CSS会压缩,不会将其他文件添加到 output_dir

项目详情


下载文件

下载适合您平台的文件。如果您不确定要选择哪个,请了解更多关于 安装包 的信息。

源分布

sasstastic-0.0.2.tar.gz (12.0 kB 查看哈希值)

上传时间 源代码

构建版本

sasstastic-0.0.2-py3-none-any.whl (13.3 kB 查看哈希值)

上传时间 Python 3

由以下支持