%}
{% include 2017/head.html critical='home' %}
-</head><body>
+</head><body class='UseCompactHeader HighlightPubFirstLine'>
{% include 2017/top-nav.html page=page is_home=true noedit=true noback=true %}
{% include 2017/head.html critical='sheet' %}
{% include 2017/article-schema.html page=page %}
-</head><body>
+</head><body class='UseCompactHeader HighlightPubFirstLine'>
{% include 2017/top-nav.html page=page %}
*/
.h3-section > .body {
- & > pre {
+ & > pre,
+ & > .gatsby-highlight > pre {
margin: 0;
padding: 16px;
}
/* Description paragraphs */
& p {
background: $gray-bg;
- color: $gray-text;
+ color: $base-text;
/* Links */
& a,
// Hide placeholders after carbon has loaded
#carbonads ~ .placeholder {
- display: none;
+ opacity: 0;
+ transition: opacity 250ms linear;
+ pointer-events: none;
}
& > .placeholder {
text-align: left;
}
+ .HighlightPubFirstLine & > div > span:first-line {
+ font-weight: bold;
+ }
+
// Clearfix
& > div > span::after {
content: '';
}
}
+#carbonads {
+ animation: 250ms ease-out pub-text-enter;
+}
+
@keyframes placeholder-swish {
0% {
background-position: ($placeholder-bg-size * -1 / 3) 0%;
background-position: ($placeholder-bg-size * 2 / 3) 0%;
}
}
+
+@keyframes pub-text-enter {
+ 0% {
+ opacity: 0;
+ transform: scale(0.97);
+ }
+
+ 100% {
+ opacity: 1;
+ }
+}
$cB: $base-c;
$cB-3: adjust-color($cB, $lightness: 8%, $hue: -10deg);
- $cM: #aaa; // Mute
+ $cM: #669; // Mute
&.tag,
&.keyword {
color: $cA-3;
}
- &.comment,
&.punctuation,
&.operator {
color: $cM;
}
+
+ &.comment {
+ color: #569;
+ }
}
$base-panel: white;
$base-head: #111;
$base-text: #345;
-$base-mute: #667788; // gray
+$base-mute: #556677; // gray
$base-a: adjust-color(#8370bd, $lightness: -5%); // indigo
$base-b: adjust-color(#2b72a2, $lightness: -5%); // blue
$gray-bg: mix($base-body, $base-panel, 50%);
$gray-text: $base-mute;
-$line-color: rgba($base-mute, 0.1);
+$line-color: rgba($base-mute, 0.18);
$dark-line-color: rgba($base-mute, 0.3);
//
$shadow3:
0 6px 8px rgba($base-mute, 0.03),
- 0 1px 2px rgba($base-mute, 0.30);
+ 0 1px 1px rgba($base-mute, 0.40);
$shadow6:
0 6px 8px rgba($base-mute, 0.03),
- 0 1px 2px rgba($base-mute, 0.30),
+ 0 1px 1px rgba($base-mute, 0.40),
0 8px 12px rgba($base-b3, 0.1);
/*
## Getting started
### Introduction
+{: .-intro}
[Enzyme](http://airbnb.io/enzyme) lets you write unit tests for React components. This guide covers Enzyme 3.x.
### Options
-Print options:
-{: .-setup}
+#### Printing options
```bash
-v, --verbose # same as --print=HhBb --all
---
title: Promises
category: JavaScript
-intro: A quick reference to the [Promise API](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise).
+layout: 2017/sheet
---
## Reference
{:.-three-column}
+### Introduction
+{: .-intro}
+
+intro: A quick reference to the JavaScript [Promise API](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise).
+
+- [Using Promises guide](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises) _(developer.mozilla.org)_
+- [Promise documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) _(developer.mozilla.org)_
+
### Creating promises
```js