The Sass Parser will drop starting whitespace on single line comments so the | char can be used to work around that in the docs.

This commit is contained in:
Chris Eppstein 2010-03-16 18:43:13 -05:00
parent c970ad3269
commit de5ec40a3f
2 changed files with 23 additions and 14 deletions

View File

@ -154,7 +154,7 @@ module Sass
docstring.gsub(/@doc off(.*?)@doc on/m, '')
end
def docstring
([value] + lines).join("\n")
([value] + lines).join("\n").gsub(/(^\| )|(^\|$)/, '')
end
def doc
if value == "@doc off"

View File

@ -1,21 +1,30 @@
// @doc off
// The blueprint IE mixins should be mixed into a stylesheet that gets conditionally included
// into IE like so:
// <!--[if lt IE 8]><link rel="stylesheet" href="ie.css"
// type="text/css" media="screen, projection"><![endif]-->
// @doc on
// Usage examples:
// As a top-level mixin, apply to any page that includes the stylesheet:
// +blueprint-ie
// Scoped by a presentational class:
// body.blueprint
// +blueprint-ie(true)
// Scoped by semantic selectors:
// body#page-1, body#page-2, body.a-special-page-type
// +blueprint-ie(true)
// Deprecated:
// You can pass the body selector as the first argument when used as a top-level mixin
// +blueprint-ie("body#page-1, body#page-2, body.a-special-page-type")
//| Usage Examples
//| --------------
//|
//| As a top-level mixin, apply to any page that includes the stylesheet:
//|
//| +blueprint-ie
//|
//| Scoped by a presentational class:
//|
//| body.blueprint
//| +blueprint-ie(true)
//|
//| Scoped by semantic selectors:
//|
//| body#page-1, body#page-2, body.a-special-page-type
//| +blueprint-ie(true)
//|
//| **Deprecated:** You can pass the body selector as the first argument when used as a top-level mixin
//|
//| +blueprint-ie("body#page-1, body#page-2, body.a-special-page-type")
=blueprint-ie(!body_selector = "body")
@if !body_selector == true
+blueprint-ie-body