{"name":"sugarss","version":"0.1.5","description":"Indent-based CSS syntax for PostCSS","keywords":["css","postcss","postcss-syntax","syntax","indent","parser"],"author":{"name":"Andrey Sitnik","email":"andrey@sitnik.ru"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/postcss/sugarss.git"},"dependencies":{"postcss":"^5.1.0"},"devDependencies":{"babel-plugin-precompile-charcodes":"1.0.0","babel-plugin-add-module-exports":"0.2.1","babel-preset-es2015-loose":"7.0.0","eslint-config-postcss":"2.0.2","babel-preset-stage-0":"6.5.0","postcss-parser-tests":"5.0.9","babel-eslint":"6.1.2","babel-core":"6.11.4","babel-cli":"6.11.4","eslint":"3.1.1","ava":"0.15.2"},"scripts":{"prepublish":"npm run build","clean":"rm *.js || echo 'Already cleaned'","build":"npm run clean && babel -s inline -d ./ *.es6","lint":"eslint *.es6 test/*.js","test":"npm run build && ava && npm run lint"},"gitHead":"4dc5c18742af3988a0287009fcd2d5da1ba463d7","bugs":{"url":"https://github.com/postcss/sugarss/issues"},"homepage":"https://github.com/postcss/sugarss#readme","_id":"sugarss@0.1.5","_shasum":"c0c25bc0941678504237e806aecd160a30a94eea","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.3.0","_npmUser":{"name":"ai","email":"andrey@sitnik.ru"},"dist":{"shasum":"c0c25bc0941678504237e806aecd160a30a94eea","tarball":"http://registry-npm.ywwl.com/sugarss/download/sugarss-0.1.5.tgz","integrity":"sha512-AJKFHsICop1t5mpjVbz8Y6lGwNyJUa4kw0lEURsrmZNGc1+OVQAYbRksIVco2CtTL2zdNM07h5oApgKwem1ACQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGiikatOhZOsIGnyB3eGl/Hh27YUIXpK/my+Ii8LSRewAiAxcAtA0Sa2uVEkd0m3ZoUE4wHtFTJ8tPFs2aZEiwZOzg=="}],"size":30408,"noattachment":false,"key":"/sugarss/-/sugarss-0.1.5.tgz"},"maintainers":[{"name":"ai","email":"andrey@sitnik.ru"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/sugarss-0.1.5.tgz_1469278585745_0.10302902827970684"},"directories":{},"readme":"# SugarSS\n\n<img align=\"right\" width=\"120\" height=\"155\"\n     title=\"SugarSS logo by Maria Keller\"\n     src=\"http://postcss.github.io/sugarss/logo.svg\">\n\nIndent-based CSS syntax for [PostCSS].\n\n```sass\na\n  color: blue\n\n.multiline,\n.selector\n  box-shadow: 1px 0 9px rgba(0, 0, 0, .4),\n              1px 0 3px rgba(0, 0, 0, .6)\n\n// Mobile\n@media (max-width: 400px)\n  .body\n    padding: 0 10px\n```\n\nAs any PostCSS custom syntax, SugarSS has source map, [stylelint]\nand [postcss-sorting] support out-of-box.\n\nIt was designed to be used with [PreCSS] and [postcss-nested-props].\nBut you can use it with any PostCSS plugins\nor use it without any PostCSS plugins.\nWith [gulp-sass-to-postcss-mixins] you can use `+mixin` syntax as in Sass.\n\n<a href=\"https://evilmartians.com/?utm_source=sugarss\">\n  <img src=\"https://evilmartians.com/badges/sponsored-by-evil-martians.svg\"\n       alt=\"Sponsored by Evil Martians\" width=\"236\" height=\"54\">\n</a>\n\n[gulp-sass-to-postcss-mixins]:  https://github.com/akella/gulp-sass-to-postcss-mixins\n[postcss-nested-props]:        https://github.com/jedmao/postcss-nested-props\n[postcss-sorting]:             https://github.com/hudochenkov/postcss-sorting\n[stylelint]:                   http://stylelint.io/\n[PostCSS]:                     https://github.com/postcss/postcss\n[PreCSS]:                      https://github.com/jonathantneal/precss\n\n\n## Syntax\n\nSugarSS MIME-type is `text/x-sugarss` with `.sss` file extension.\n\n\n### Indent\n\nWe recommend 2 spaces indent. However, SugarSS autodetects indent\nand can be used with tabs or spaces.\n\nBut it is prohibited to mix spaces and tabs in SugarSS sources.\n\n\n### Multiline\n\nSugarSS was designed to have intuitively multiline selectors and declaration\nvalues.\n\nThere are 3 rules for any types of nodes:\n\n```sass\n// 1. New line inside brackets will be ignored\n@supports ( (display: flex) and\n            (display: grid) )\n\n// 2. Comma at the end of the line\n@media (max-width: 400px),\n       (max-height: 800px)\n\n// 3. Backslash before new line\n@media screen and \\\n       (min-width: 600px)\n```\n\nIn a selector you can put a new line anywhere. Just keep same indent\nfor every line of selector:\n\n```sass\n.parent >\n.child\n  color: black\n```\n\nIn a declaration value you can put a new line anywhere. Just keep a bigger indent\nfor the value:\n\n```sass\n.one\n  background: linear-gradient(rgba(0, 0, 0, 0), black)\n              linear-gradient(red, rgba(255, 0, 0, 0))\n\n.two\n  background:\n    linear-gradient(rgba(0, 0, 0, 0), black)\n    linear-gradient(red, rgba(255, 0, 0, 0))\n```\n\n\n### Comments\n\nSugarSS supports two types of comments:\n\n```sass\n/*\n Multiline comments\n */\n\n// Inline comments\n```\n\nThere is no “silent” comment in SugarSS. Output CSS will contain all comments\nfrom `.sss` source. But you can use [postcss-discard-comments]\nfor Sass’s silent/loud comments behaviour.\n\n[postcss-discard-comments]: https://www.npmjs.com/package/postcss-discard-comments\n\n\n### Rule and Declarations\n\nSugarSS separates selectors and declarations by `:\\s` or `:\\n` token.\n\nSo you must write a space after the property name: `color: black` is good,\n`color:black` is prohibited.\n\n\n### Other\n\nSugarSS is just a syntax, it change the way how you write CSS,\nbut do not add preprocessor features build-in.\n\nHere are PostCSS plugins which could add you preprocessor features:\n\n* **[PreCSS]** adds variables, nested rules, extend rules, property lookup\n  and CSS polyfills.\n* **[postcss-easy-import]** adds `@import` directive support with globbing.\n* **[postcss-mixins]** add `@mixin` support.\n* **[postcss-functions]** allows you to define own CSS functions in JS.\n\n[postcss-easy-import]: https://github.com/TrySound/postcss-easy-import\n[postcss-functions]: https://github.com/andyjansson/postcss-functions\n[postcss-mixins]: https://github.com/postcss/postcss-mixins\n[PreCSS]: https://github.com/jonathantneal/precss\n\n\n## Text Editors\n\n* SublimeText: [Syntax Highlighting for .SSS SugarSS]\n* Atom: [language-postcss], [source-preview-postcss] and [build-sugarss]\n* Vim: [vim-sugarss]\n* VSCode: [vetur], and [postcss-sugarss-language]\n\nWe are working on syntax highlight support in text editors.\n\nRight now, you can set `Sass` or `Stylus` syntax highlight for `.sss` files.\n\n[Syntax Highlighting for .SSS SugarSS]: https://packagecontrol.io/packages/Syntax%20Highlighting%20for%20SSS%20SugarSS\n[source-preview-postcss]:          https://atom.io/packages/source-preview-postcss\n[language-postcss]:                https://atom.io/packages/language-postcss\n[build-sugarss]:                   https://atom.io/packages/build-sugarss\n[vim-sugarss]:                     https://github.com/hhsnopek/vim-sugarss\n\n\n## Usage\n\nSugarSS needs PostCSS compiler. Install [`postcss-loader`] for webpack,\n[`gulp-postcss`] for Gulp, [`postcss-cli`] for npm scripts.\n[Parcel] has build-in support for PostCSS.\n\nThen install SugarSS: `npm install --save-dev postcss sugarss` if you use npm\nand `yarn add --dev postcss sugarss` if you use Yarn.\n\nThen create `.postcssrc` file:\n\n```json\n{\n  \"parser\": \"sugarss\",\n  \"plugins\": {\n    \"precss\": {}\n  }\n}\n```\n\n[`postcss-loader`]: https://github.com/postcss/postcss-loader\n[`gulp-postcss`]: https://github.com/postcss/gulp-postcss\n[`postcss-cli`]: https://github.com/postcss/postcss-cli\n[Parcel]: https://parceljs.org/transforms.html\n\n\n### Imports\n\nIf you doesn’t use Webpack or Parcel, you need some PostCSS plugin\nto process `@import` directives.\n\n[postcss-import] doesn’t support `.sss` file extension, because this plugin\nimplements W3C specification. If you want smarter `@import`, you should\nuse [postcss-easy-import] with the `extensions` option.\n\n```diff js\n{\n  \"parser\": \"sugarss\",\n  \"plugins\": {\n+   \"postcss-easy-import\": {\n+     \"extensions\": [\n+       \".sss\"\n+     ]\n+   },\n    \"precss\": {},\n  }\n}\n```\n\n[postcss-easy-import]: https://github.com/TrySound/postcss-easy-import\n[postcss-import]:      https://github.com/postcss/postcss-import\n\n\n### Mixins\n\nFor mixins support, install [postcss-mixins] and add it to `.postcssrc` file:\n\n```diff js\n{\n  \"parser\": \"sugarss\",\n  \"plugins\": {\n+   \"postcss-mixins\": {\n+     \"mixinsDir\": \"./mixins\"\n+   },\n    \"precss\": {},\n  }\n}\n```\n\nNow you can define your mixins in `mixins/` dir.\nFor example create `mixins/circle.sss` with:\n\n```sss\n@define-mixin circle $size\n  border-radius: 50%\n  width: $size\n  height: $size\n```\n\n\n### Functions\n\nTo define custom functions you need to install [postcss-functions]\nand add it to `.postcssrc` file:\n\n```diff js\n{\n  \"parser\": \"sugarss\",\n  \"plugins\": {\n+   \"postcss-functions\": {\n+     \"glob\": \"./functions\"\n+   },\n    \"precss\": {},\n  }\n}\n```\n\nThen you can define functions in `functions/` dir. For example,\n`functions/foo.js` will define `foo()` function in CSS:\n\n```js\nmodule.exports = function (args) {\n  return 'foo'\n}\n```\n\n\n### SugarSS to SugarSS\n\nSometimes we use PostCSS not to build CSS, but to fix source files.\nFor example, to sort properties by [postcss-sorting].\n\nFor this cases use the `syntax` option, instead of `parser`:\n\n```js\ngulp.task('sort', function () {\n    return gulp.src('src/**/*.sss')\n        .pipe(postcss([sorting], { syntax: sugarss }))\n        .pipe(gulp.dest('src'));\n});\n```\n\n[postcss-sorting]: https://github.com/hudochenkov/postcss-sorting\n\n\n### CSS to SugarSS\n\nYou can even compile existing CSS sources to SugarSS syntax.\nJust use `stringifier` option instead of `parser`:\n\n```js\npostcss().process(css, { stringifier: sugarss }).then(function (result) {\n    result.content // Converted SugarSS content\n});\n```\n\n\n## Thanks\n\nCute project logo was made by [Maria Keller](http://www.mariakellerac.com/).\n","publish_time":1469278587758,"_cnpm_publish_time":1469278587758,"dist-tags":{"latest":"5.0.2"}}