Merge branch 'wip.reference' into impl-status

This commit is contained in:
Natalie Weizenbaum 2019-03-10 23:22:02 -07:00 committed by GitHub
commit d0c1079b78
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 44 additions and 24 deletions

View File

@ -1,9 +1,13 @@
language: ruby
rvm:
- 2.5.3
script: bundle exec rake test
branches:
only:
- master
- wip.reference
# Feature branches beginning with "feature."
- "/^feature\\..*/"

View File

@ -12,12 +12,12 @@ task :test_without_rebuild do
url_ignore: [
"https://www.drupal.org/dcoc", # This doesn't allow automated requests.
"http://sass.logdown.com/posts/7081811", # This times out occasionally.
# These fail on Travis only.
"https://dnomak.com/flexiblegs/",
"https://incident57.com/codekit/",
"https://daringfireball.net/projects/markdown/",
"#",
],
assume_extension: true,
# Lots of external URLs fail flakily on Travis, so we just don't check them
# there.
disable_external: ENV["TRAVIS"] == "true"
).run
end

View File

@ -270,7 +270,7 @@ module SassHelpers
#
# The contents should be supplied as a block.
def heads_up
concat(content_tag :aside, [
_concat(content_tag :aside, [
content_tag(:h3, '⚠️ Heads up!'),
_render_markdown(_capture {yield})
], class: 'sl-c-callout sl-c-callout--warning')
@ -281,7 +281,7 @@ module SassHelpers
#
# The contents should be supplied as a block.
def fun_fact
concat(content_tag :aside, [
_concat(content_tag :aside, [
content_tag(:h3, '💡 Fun fact:'),
_render_markdown(_capture {yield})
], class: 'sl-c-callout sl-c-callout--fun-fact')
@ -330,15 +330,11 @@ module SassHelpers
contents << content_tag(:div, content_tag(:a, '▶'))
end
contents = content_tag(:dl, contents, class: 'impl-status sl-c-description-list sl-c-description-list--horizontal')
# Remove newlines because otherwise Markdown can try to inject <p> tags that
# we don't want.
concat(contents.gsub("\n", ""))
_concat(content_tag(:dl, contents, class: 'impl-status sl-c-description-list sl-c-description-list--horizontal'))
if block_given?
# Get rid of extra whitespace to avoid more bogus <p> tags.
concat(content_tag :div, _render_markdown(_capture {yield}).strip, class: 'sl-c-callout sl-c-callout--impl-status')
_concat(content_tag :div, _render_markdown(_capture {yield}).strip, class: 'sl-c-callout sl-c-callout--impl-status')
end
end
@ -396,13 +392,13 @@ MARKDOWN
html = content_tag :div, [
content_tag(:pre, [
content_tag(:code, highlighted_signatures.join("\n"))
content_tag(:code, highlighted_signatures.join("&#x0000A"))
], class: 'signature highlight scss'),
returns ? content_tag(:h3, return_type_link(returns), class: 'return-type') : '',
_render_markdown(_capture {yield})
], class: 'sl-c-callout sl-c-callout--function', id: names.first
concat(names.uniq[1..-1].inject(html) {|h, n| content_tag(:div, h, id: n)})
_concat(names.uniq[1..-1].inject(html) {|h, n| content_tag(:div, h, id: n)})
end
def return_type_link(return_type)
@ -445,6 +441,15 @@ MARKDOWN
# Strips all leading indentation from the block.
def _capture(&block)
remove_leading_indentation(
block_is_haml?(block) ? capture_haml(&block) : capture(&block))
(block_is_haml?(block) ? capture_haml(&block) : capture(&block)) || "")
end
# Concatenates `text` to the document.
#
# Converts all newlines to spaces in order to avoid weirdness when rendered
# HTML is nested within Markdown. Adds newlines before and after the content
# to ensure that it doesn't cause adjacent markdown not to be parsed.
def _concat(text)
concat("\n\n" + text.gsub("\n", " ") + "\n\n")
end
end

View File

@ -2,10 +2,17 @@
margin: 1.5rem 0;
padding: 1.5rem 1rem;
background: lighten($sl-color--pale-sky, 50%);
border-radius: 2px;
&--warning { background: lighten($sl-color--hopbush, 36%); }
&--warning {
background: lighten($sl-color--hopbush, 36%);
border: 1px solid lighten($sl-color--hopbush, 27%);
}
&--fun-fact { background: lighten($sl-color--patina, 43%); }
&--fun-fact {
background: lighten($sl-color--patina, 43%);
border: 1px solid lighten($sl-color--patina, 32%);
}
&--function {
padding: {
@ -13,8 +20,6 @@
bottom: .25rem;
};
.code-example { margin-top: -3rem; }
.signature {
margin: {
right: -1rem;

View File

@ -8,8 +8,7 @@
.ui-tabs-panel { padding: 0; }
.ui-tabs-nav {
position: relative;
top: 1.35rem;
margin-top: -1rem;
margin-left: -1em;
a { border: 0; background: none; }
@ -78,10 +77,12 @@
.ui-tabs-anchor { padding: .75rem 1rem; }
}
pre { margin-top: 0; }
// Carefully calibrated so that the distance between two code blocks in the
// syntax switcher is exactly equal to two lines, so there's no visual jitter
// when switching between syntaxes.
pre { margin-top: 22px; }
pre + pre { margin-top: 22px; }
}
.ui-widget.ui-widget-content,

View File

@ -78,6 +78,10 @@ included at the exact point where the `@import` was written. What's more, any
mixins, functions, or variables that were defined before the `@import`
(including from other `@import`s) are available in the imported stylesheet.
[mixins]: mixin
[functions]: function
[variables]: ../variables
<% heads_up do %>
If the same stylesheet is imported more than once, it will be evaluated again
each time. If it just defines functions and mixins, this usually isn't a big

View File

@ -179,6 +179,7 @@ A string representation of the error. In [Node Sass][], this is more detailed
than [`error.toString()`][] or [`error.message`][]. In [Dart Sass][], it
provides the same information.
[Dart Sass]: /dart-sass
[`error.toString()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/toString
[`error.message`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/message

View File

@ -4,8 +4,8 @@ introduction: >
Booleans are the logical values `true` and `false`. In addition their literal
forms, booleans are returned by [equality](../operators/equality) and
[relational](../operators/relational) operators, as well as many built-in
functions like [`comparable()`](../functions/map#comparable) and
[`map-has-key()`](../functions/math#map-has-key).
functions like [`comparable()`](../functions/math#comparable) and
[`map-has-key()`](../functions/map#map-has-key).
---
<% example(autogen_css: false) do %>