File tree 13 files changed +10470
-5985
lines changed
13 files changed +10470
-5985
lines changed Original file line number Diff line number Diff line change 1
1
import Service from '@ember/service' ;
2
2
import algoliasearch from 'algoliasearch' ;
3
3
import config from 'ember-api-docs/config/environment' ;
4
- import { denodeify } from 'rsvp' ;
5
4
6
5
export default class AlgoliaService extends Service {
7
- _search ( query , params , callback ) {
8
- if ( ! callback ) {
9
- callback = params ;
10
- params = undefined ;
11
- }
6
+ async search ( query , params ) {
12
7
if ( query ) {
13
8
if ( Array . isArray ( query ) && ! params ) {
14
9
// if multiple indices
15
- this . _client . search ( query , callback ) ;
10
+ return this . _client . search ( query ) ;
16
11
} else if ( ! params ) {
17
12
// if no params
18
- this . accessIndex ( query . indexName ) . search ( query . query , callback ) ;
13
+ return this . accessIndex ( query . indexName ) . search ( query . query ) ;
19
14
} else {
20
15
// if params and callback
21
- this . accessIndex ( query . indexName ) . search ( query . query , params , callback ) ;
16
+ return this . accessIndex ( query . indexName ) . search ( query . query , params ) ;
22
17
}
23
- } else {
24
- callback ( new Error ( `Could not search algolia for query "${ query } "` ) ) ;
25
18
}
26
19
}
27
20
@@ -39,6 +32,5 @@ export default class AlgoliaService extends Service {
39
32
config . algolia . algoliaKey
40
33
) ;
41
34
this . _indices = { } ;
42
- this . search = denodeify ( this . _search . bind ( this ) ) ;
43
35
}
44
36
}
Original file line number Diff line number Diff line change 1
- @use " sass:math" ;
2
-
3
1
fieldset {
4
2
background-color : lighten ($base-border-color , 10% );
5
3
border : $base-border ;
6
- margin : 0 0 $ small-spacing ;
4
+ margin : 0 0 var ( -- small-spacing) ;
7
5
padding : $base-spacing ;
8
6
}
9
7
@@ -30,7 +28,7 @@ select {
30
28
31
29
label {
32
30
font-weight : 600 ;
33
- margin-bottom : math . div ( $ small-spacing, 2 );
31
+ margin-bottom : calc ( --sass- small-spacing / 2 );
34
32
35
33
& .required ::after {
36
34
content : " *" ;
@@ -50,8 +48,8 @@ textarea {
50
48
box-sizing : border-box ;
51
49
font-family : $base-font-family ;
52
50
font-size : $base-font-size ;
53
- margin-bottom : math . div ($base-spacing , 2 );
54
- padding : math . div ($base-spacing , 3 );
51
+ margin-bottom : calc ($base-spacing / 2 );
52
+ padding : calc ($base-spacing / 3 );
55
53
transition : border-color ;
56
54
width : 100% ;
57
55
@@ -74,10 +72,10 @@ textarea {
74
72
input [type = " checkbox" ],
75
73
input [type = " radio" ] {
76
74
display : inline ;
77
- margin-right : math . div ( $ small-spacing, 2 );
75
+ margin-right : calc ( -- small-spacing / 2 );
78
76
}
79
77
80
78
input [type = " file" ] {
81
- padding-bottom : $ small-spacing ;
79
+ padding-bottom : var ( -- small-spacing) ;
82
80
width : 100% ;
83
81
}
Original file line number Diff line number Diff line change 6
6
7
7
& %default-ul {
8
8
list-style-type : disc ;
9
- margin-bottom : $ small-spacing ;
9
+ margin-bottom : var ( -- small-spacing) ;
10
10
padding-left : $base-spacing ;
11
11
12
12
@media (max-width : $mobile-portrait-screen ){
21
21
> li {
22
22
counter-increment : customlistcounter;
23
23
clear : both ;
24
- padding : $ small-spacing 0 $ small-spacing 2em ;
24
+ padding : var ( -- small-spacing) 0 var ( -- small-spacing) 2em ;
25
25
position : relative ;
26
26
z-index : 1 ;
27
27
28
28
& ::before {
29
- @include position (absolute , ($ small-spacing + 0.5em ) null null 0 );
29
+ @include position (absolute , (var ( -- small-spacing) + 0.5em ) null null 0 );
30
30
@include size (2em );
31
31
content : counter (customlistcounter ) " " ;
32
32
border : 2px solid $base-border-color ;
47
47
}
48
48
49
49
dl {
50
- margin-bottom : $ small-spacing ;
50
+ margin-bottom : var ( -- small-spacing) ;
51
51
52
52
dt {
53
53
font-weight : bold ;
54
- margin-top : $ small-spacing ;
54
+ margin-top : var ( -- small-spacing) ;
55
55
}
56
56
57
57
dd {
Original file line number Diff line number Diff line change 1
1
table {
2
2
font-feature-settings : " kern" , " liga" , " tnum" ;
3
3
border-collapse : collapse ;
4
- margin : $ small-spacing 0 ;
4
+ margin : var ( -- small-spacing) 0 ;
5
5
table-layout : fixed ;
6
6
width : 100% ;
7
7
position : relative ;
23
23
}
24
24
25
25
th , td {
26
- padding : $ small-spacing ;
26
+ padding : var ( -- small-spacing) ;
27
27
}
28
28
29
29
tr ,
Original file line number Diff line number Diff line change 20
20
font-family : $heading-font-family ;
21
21
font-size : $base-font-size ;
22
22
line-height : $heading-line-height ;
23
- margin : 0 0 $ small-spacing ;
23
+ margin : 0 0 var ( -- small-spacing) ;
24
24
font-weight : bold ;
25
25
26
26
code {
43
43
}
44
44
45
45
p {
46
- margin : 1.5em 0 $ small-spacing ;
46
+ margin : 1.5em 0 var ( -- small-spacing) ;
47
47
line-height : 1.5em ;
48
48
}
49
49
Original file line number Diff line number Diff line change 1
- @use " sass:math" ;
2
-
3
1
// Typography
4
2
$base-font-family : ' Source Sans Pro' , sans-serif ;
5
3
$heading-font-family : $base-font-family ;
@@ -15,9 +13,14 @@ $large-font-size: 1.5rem;
15
13
$base-line-height : 1.5 ;
16
14
$heading-line-height : 1.2 ;
17
15
16
+ :root {
17
+ --base-line-height : 1.5 ;
18
+ --base-spacing : calc (var (--base-line-height ) * 1em );
19
+ --small-spacing : calc (var (--base-spacing ) / 2 );
20
+ }
21
+
18
22
// Spacing
19
23
$base-spacing : $base-line-height * 1em ;
20
- $small-spacing : math .div ($base-spacing , 2 );
21
24
$large-spacing : $base-spacing * 2 ;
22
25
$top-spacing : $base-spacing * 3.333 ; // 80px
23
26
Original file line number Diff line number Diff line change 1
1
article {
2
- padding : $large-spacing $ small-spacing ;
2
+ padding : $large-spacing var ( -- small-spacing) ;
3
3
4
4
@media (min-width : $medium-screen ){
5
- padding : $ small-spacing ;
5
+ padding : var ( -- small-spacing) ;
6
6
}
7
7
8
8
.edit-page {
Original file line number Diff line number Diff line change 1
1
.chapter li {
2
- margin : $ small-spacing 0 ;
2
+ margin : var ( -- small-spacing) 0 ;
3
3
4
4
@media (max-width : $mobile-portrait-screen ) {
5
5
margin : 0 ;
Original file line number Diff line number Diff line change 5
5
font-family : $monospace-font-family ;
6
6
font-size : 0.8em ;
7
7
line-height : 1.5em ;
8
- margin : $ small-spacing 0 $large-spacing ;
8
+ margin : var ( -- small-spacing) 0 $large-spacing ;
9
9
overflow : hidden ;
10
10
position : relative ;
11
11
font-variant-ligatures : none ;
28
28
}
29
29
}
30
30
}
31
-
31
+
32
32
.scroller {
33
33
overflow : auto ;
34
34
}
Original file line number Diff line number Diff line change 3
3
border-bottom : $base-border ;
4
4
position : relative ;
5
5
z-index : 1 ;
6
- padding : $ small-spacing 0 ;
6
+ padding : var ( -- small-spacing) 0 ;
7
7
8
8
@include media ($large-screen-up ) {
9
9
// fixed sidebar, full height
12
12
width : 19em ;
13
13
border-bottom : 0 ;
14
14
border-right : $base-border ;
15
- padding : $ small-spacing $base-spacing $base-spacing * 1.5 ;
15
+ padding : var ( -- small-spacing) $base-spacing $base-spacing * 1.5 ;
16
16
17
17
& ::before {
18
18
@include position (absolute , 0 0 0 -100vw );
@@ -123,14 +123,14 @@ ol.toc-level-1 {
123
123
font-size : $base-font-size * 0.9 ;
124
124
transition : max-height 0.5s ease ;
125
125
126
- & .selected {
126
+ & .selected {
127
127
max-height : 3000px ;
128
128
}
129
129
130
130
& :not (.selected ) {
131
131
overflow : hidden ;
132
132
max-height : 0 ;
133
- }
133
+ }
134
134
135
135
li {
136
136
border-left : 3px solid transparent ;
@@ -148,6 +148,6 @@ ol.toc-level-1 {
148
148
}
149
149
150
150
a {
151
- padding-left : $ small-spacing ;
151
+ padding-left : var ( -- small-spacing) ;
152
152
}
153
153
}
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ const Funnel = require('broccoli-funnel');
5
5
const mergeTrees = require ( 'broccoli-merge-trees' ) ;
6
6
const envIsProduction = process . env . EMBER_ENV === 'production' ;
7
7
const premberUrls = require ( './prember-urls' ) ;
8
+ const nodeSass = require ( 'node-sass' ) ;
8
9
9
10
module . exports = function ( defaults ) {
10
11
let app = new EmberApp ( defaults , {
@@ -25,20 +26,14 @@ module.exports = function (defaults) {
25
26
generateAssetMap : true ,
26
27
} ,
27
28
sassOptions : {
29
+ implementation : nodeSass ,
28
30
sourceMapEmbed : ! envIsProduction ,
29
31
includePaths : [
30
32
'app/styles' ,
31
33
'node_modules/bourbon-neat/app/assets/stylesheets' ,
32
34
'node_modules/normalize.css' ,
33
35
] ,
34
36
} ,
35
- autoImport : {
36
- webpack : {
37
- node : {
38
- process : 'mock' ,
39
- } ,
40
- } ,
41
- } ,
42
37
autoprefixer : {
43
38
enabled : true ,
44
39
cascade : true ,
You can’t perform that action at this time.
0 commit comments