基于libsass从sass编译css的Lektor插件

lektor-scss的Python项目详细描述


lektor的SCSS编译器

PyPI versionDownloadsUpload Python PackageLinting Python package

用于Lektor的SCSS编译器,从sass编译css。在

它实际上是如何工作的?在

  • 它使用libsass
  • 它查找.scss.sass文件(忽略以下划线开头的部件文件,例如'_测试文件.scss)并将其作为生成过程的一部分进行编译。
  • 它只在需要时重建css(文件更改、导入的文件更改或配置更改)。在
  • 启动开发服务器时,它会在后台监视文件的更改,并在需要时重新生成它们。在

安装

您可以使用Lektor的安装程序安装插件:

lektor plugins add lektor-scss

或者手动将插件添加到lektorproject文件的packages部分:

^{pr2}$

使用

要启用插件,请在启动开发时传递scss标志 服务器或运行生成时:

# build and compile css from scss
lektor build -f scss

# edit site with new generated css
lektor server -f scss

Python3

强烈建议将此插件与python3版本的lektor一起使用。在

由于lektor可以用作python模块,因此可以使用以下命令强制执行(在安装lektor之后,例如使用pip3 install --user --upgrade lektor

# run a python3 lektor server with new generated css
python3 -m lektor server -f scss

配置

该插件具有以下设置,您可以根据需要进行调整:

parameterdefault valuedescription
source_dirassets/scss/the directory in which the plugin searchs for sass files (subdirectories are included)
output_dirassets/css/the directory the compiled css files get place at
output_stylecompressedcoding style of the compiled result. choose one of: 'nested', 'expanded', 'compact', 'compressed'
source_commentsFalsewhether to add comments about source lines
precision5precision for numbers

可以在configs/scss.ini找到一个具有默认配置的示例文件。对于配置文件中未指定的每个参数,插件都使用默认值。在

发展

要在正在运行的lektor安装中测试和/或开发此插件,只需将其放在packages/文件夹中,然后查看Lektor Doku

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
带有外部属性文件的java prunsrv服务   java NoClassDefFoundError:org/hibernate/annotations/common/reflection/MetadataProvider   使用Android Studio进行java单元测试云数据存储   java如何使用Junit在SeleniumWebDriver中生成测试用例报告   java根据用户输入显示多个动画形状(JavaFX)   java枚举文件和Jar资源的统一机制   使用Spring OXM的java多封送器/解封器   java无法解析:com。谷歌。安卓exoplayer:exoplayer smoothstreaming:2.9.1   java如何创建迷你对话框(带图片)   java在eclipse中单击自定义菜单项时显示一个对话框   java使用Hibernate在插入前检查重复值   Jsoup只过滤掉从html到文本的一些标记   域在字符串Java Mail中包含非法字符   自定义Jackson反序列化程序中的java委托   java Graphql联合在扩展关系上返回null   java如果我有entitymanager,如何获取会话对象?