Document the JavaScript API

This commit is contained in:
Natalie Weizenbaum 2018-10-31 16:02:04 -07:00
parent 2b8bf01b7a
commit 997c3a7ecd
6 changed files with 1242 additions and 19 deletions

View File

@ -301,16 +301,12 @@ module SassHelpers
#
# This takes a Markdown block that should provide more information about the
# implementation differences or the old behavior.
def impl_status(dart: nil, libsass: nil, ruby: nil)
raise ArgumentError.new("Missing argument dart.") if dart.nil?
raise ArgumentError.new("Missing argument libsass.") if libsass.nil?
raise ArgumentError.new("Missing argument ruby.") if ruby.nil?
contents = [
_impl_status_row('Dart Sass', dart),
_impl_status_row('LibSass', libsass),
_impl_status_row('Ruby Sass', ruby),
]
def impl_status(dart: nil, libsass: nil, ruby: nil, node: nil)
contents = []
contents << _impl_status_row('Dart Sass', dart) if dart
contents << _impl_status_row('LibSass', libsass) if libsass
contents << _impl_status_row('Node Sass', node) if node
contents << _impl_status_row('Ruby Sass', ruby) if ruby
if block_given?
contents.unshift(content_tag(:caption, [

View File

@ -148,13 +148,7 @@ Compiled themes/light.scss to public/css/light.css.
### Source Maps
Source maps are files that tell browsers or other tools that consume CSS how
that CSS corresponds to the Sass files from which it was generated. They make it
possible to see and even edit your Sass files in browsers. See instructions for
using source maps in [Chrome][] and [Firefox][].
[Chrome]: https://developers.google.com/web/tools/chrome-devtools/javascript/source-maps
[Firefox]: https://developer.mozilla.org/en-US/docs/Tools/Style_Editor#Source_map_support
<%= partial 'documentation/snippets/source-maps' %>
Dart Sass generates source maps by default for every CSS file it emits.

View File

@ -369,7 +369,7 @@ h1 {
This flag (also available as `--line-numbers`, abbreviated as `-l`) causes Sass
to emit comments for every style rule that indicate where each style rule was
defined in the source stylehseet.
defined in the source stylesheet.
```shellsession
$ sass --line-numbers style.scss

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
Source maps are files that tell browsers or other tools that consume CSS how
that CSS corresponds to the Sass files from which it was generated. They make it
possible to see and even edit your Sass files in browsers. See instructions for
using source maps in [Chrome][] and [Firefox][].
[Chrome]: https://developers.google.com/web/tools/chrome-devtools/javascript/source-maps
[Firefox]: https://developer.mozilla.org/en-US/docs/Tools/Style_Editor#Source_map_support

View File

@ -54,4 +54,4 @@
* [Command-Line Interface](/documentation/cli)
* [Dart Sass](/documentation/cli/dart-sass)
* [Ruby Sass](/documentation/cli/ruby-sass)
* [JavaScript API](/documentation/js-api) (?)
* [JavaScript API](/documentation/js-api)