sass README

The project's README from github.com/sass/sass. As one markdown file: README.md.

Sass

@SassCSS on Twitter    stackoverflow    Gitter

Sass makes CSS fun again. Sass is an extension of CSS, adding nested rules, variables, mixins, selector inheritance, and more. It's translated to well-formatted, standard CSS using the command line tool or a plugin for your build system.

$font-stack: Helvetica, sans-serif;
$primary-color: #333;

body {
  font: 100% $font-stack;
  color: $primary-color;
}

@mixin border-radius($radius) {
  -webkit-border-radius: $radius;
     -moz-border-radius: $radius;
      -ms-border-radius: $radius;
          border-radius: $radius;
}

nav {
  ul {
    margin: 0;
    padding: 0;
    list-style: none;
  }

  li { @include border-radius(10px); }

  a {
    display: block;
    padding: 6px 12px;
    text-decoration: none;
  }
}

Install Sass

You can install Sass on Windows, Mac, or Linux by downloading the package for your operating system from GitHub and adding it to your PATH. That's all—there are no external dependencies and nothing else you need to install.

If you use Node.js, you can also install Sass using npm by running

npm install -g sass

However, please note that this will install the pure JavaScript implementation of Sass, which runs somewhat slower than the other options listed here. But it has the same interface, so it'll be easy to swap in another implementation later if you need a bit more speed!

See the Sass website for more ways to install Sass.

Once you have Sass installed, you can run the sass executable to compile .sass and .scss files to .css files. For example:

sass source/stylesheets/index.scss build/stylesheets/index.css

Learn Sass

Check out the Sass website for a guide on how to learn Sass!

This Repository

This repository isn't an implementation of Sass. Those live in sass/dart-sass and sass/libsass. Instead, it contains:

Note that this doesn't contain a full specification of Sass. Instead, feature specifications are written as needed when a new feature is being designed or when an implementor needs additional clarity about how something is supposed to work. This means many of the specs in spec/ only cover small portions of the features in question.

Versioning Policy

The proposals in this repository are versioned, to make it easy to track changes over time and to refer to older versions. Every version has a Git tag of the form proposal.<name>.draft-<version>. A new version should be created for each batch of changes.

Every version has a major version, and they may have a minor version as well (indicated <major>.<minor>). The minor version should be incremented for changes that don't affect the intended semantics of the proposal; otherwise, the major version should be incremented.

sass (sass/sass)

Searching Database…

15.4K ·GitHub
这是什么?Sass 是一种 CSS 扩展语言,支持嵌套规则、变量、混入(mixin)和选择器继承,最终会编译为标准 CSS。不过,这个仓库本身并不包含该语言的实现,而是存放它的规范和提案。
这是真正的 Sass 编译器吗?不是。这个仓库并不是 Sass 本身的实现,而是包含 spec/、proposal/ 和 accepted/ 三个文件夹,用于记录语言特性的规范以及正在进行中的变更。真正的实现位于 sass/dart-sass 和 sass/libsass 仓库中。
我该如何安装和运行 Sass?下载适用于 Windows、Mac 或 Linux 的安装包并将其添加到 PATH,或者通过 npm 安装纯 JavaScript 版本。安装完成后,运行 sass 可执行文件,即可将 .sass 和 .scss 文件编译为 .css。
我需要先安装 Node.js 或其他东西吗?使用原生安装包不需要。下载对应操作系统的版本并添加到 PATH 即可。只有选择纯 JavaScript 实现时才需要 Node.js/npm,而且它的运行速度会稍慢一些。
spec/ 文件夹是否完整记录了整个 Sass 语言?不是,它本来就是不完整的。规范只会在设计新特性或实现者需要明确说明时才编写,因此许多规范只涵盖相关特性的一小部分。
新的语言特性在实现之前会在哪里提出?它们首先以进行中草稿的形式放在 proposal/ 文件夹中;提案获得批准并开始实现后,会移入 accepted/ 文件夹。
提案版本是如何随时间进行跟踪的?每个版本都会有一个 Git 标签,格式类似 proposal. draft-。涉及语义变更时递增主版本号,非语义变更时递增次版本号。
我应该用 npm install 还是原生下载?原生操作系统安装包(添加到 PATH)运行更快,且无需任何依赖;npm 安装则提供纯 JavaScript 实现,速度较慢,但接口完全相同。
我到哪里才能真正学习 Sass 语法?README 中指向了 Sass 官方网站,那里有完整的学习指南。因为这个仓库只托管规范和提案,不提供教程。
Creator
sass
Size
2.2 MB
Stars
15.4K
Updated
CommitSep 28
Age
16y
Commits · 90 Days