umberto 1.14.0 → 1.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/README.md +6 -0
  2. package/package.json +4 -3
  3. package/scripts/helper/normalize-badges.js +26 -0
  4. package/scripts/helper/u-toc.js +10 -1
  5. package/scripts/utils/normalizebadges.js +50 -0
  6. package/scripts/utils/parselinks.js +81 -33
  7. package/src/tasks/compile-sass.js +35 -4
  8. package/themes/umberto/layout/_mixin/nav-tree-item.pug +5 -1
  9. package/themes/umberto/layout/_mixin/nav-tree-level.pug +4 -0
  10. package/themes/umberto/layout/_partial/head.pug +2 -0
  11. package/themes/umberto/layout/index.pug +1 -1
  12. package/themes/umberto/layout/page.pug +1 -1
  13. package/themes/umberto/layout/sdk.pug +1 -1
  14. package/themes/umberto/source/assets/_img/star-in-circle.svg +1 -0
  15. package/themes/umberto/src/css/_api-props-filter.scss +1 -1
  16. package/themes/umberto/src/css/_badge.scss +1 -1
  17. package/themes/umberto/src/css/_collapsinglist.scss +2 -2
  18. package/themes/umberto/src/css/_content.scss +2 -2
  19. package/themes/umberto/src/css/_footer.scss +1 -1
  20. package/themes/umberto/src/css/_formatted.scss +5 -5
  21. package/themes/umberto/src/css/_guide-content.scss +1 -1
  22. package/themes/umberto/src/css/_notice.scss +4 -4
  23. package/themes/umberto/src/css/_secondary-navigation.scss +1 -1
  24. package/themes/umberto/src/css/_toggler.scss +2 -2
  25. package/themes/umberto/src/css/_top.scss +5 -5
  26. package/themes/umberto/src/css/_tree.scss +21 -3
  27. package/themes/umberto/src/css/helpers/_color.scss +3 -3
  28. package/themes/umberto/src/css/helpers/_font.scss +1 -1
  29. package/themes/umberto/src/css/helpers/_globals.scss +2 -2
  30. package/themes/umberto/src/css/styles.scss +9 -1
  31. package/themes/umberto/src/js/_tooltips.js +39 -0
  32. package/themes/umberto/src/js/app.js +4 -1
  33. package/CHANGELOG.md +0 -1322
package/README.md CHANGED
@@ -258,6 +258,8 @@ title: Overview [optional]
258
258
  slug: overview [optional]
259
259
  order: 10 [optional]
260
260
  toc: false [optional]
261
+ toc-limit: 5 [optional]
262
+ badges: [ premium, ... ] [optional]
261
263
  sitenav: false [optional]
262
264
  feedback-widget: false [optional]
263
265
  menu-title: Overview whatever [optional]
@@ -306,6 +308,10 @@ Can be set to sort the guides within the same category. If skipped, guides are s
306
308
 
307
309
  If defined and set to `false`, table of contents will not be rendered.
308
310
 
311
+ #### toc-limit [optional]
312
+
313
+ If defined and set to `0` or greater integer, the table of contents will be limited to the defined depth (e.g. for value `2`, only `<h2>` and `<h3>` headings will be shown in the table of contents). Value `0` is an equivalent of using `toc: false`.
314
+
309
315
  #### sitenav [optional]
310
316
 
311
317
  If defined and set to `false`, there will be no left-side navigation and main content will be centered.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "umberto",
3
- "version": "1.14.0",
3
+ "version": "1.18.0",
4
4
  "description": "CKSource Documentation builder",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -42,14 +42,15 @@
42
42
  "medium-zoom": "^1.0.5",
43
43
  "mkdirp": "^1.0.4",
44
44
  "moment": "^2.27.0",
45
- "node-sass": "^4.14.1",
46
45
  "nyc": "15.1.0",
47
46
  "pug": "^3.0.0",
47
+ "sass": "^1.43.4",
48
48
  "sitemap": "^6.1.6",
49
+ "tippy.js": "^6.3.2",
49
50
  "tree-model": "^1.0.7",
50
51
  "upath": "^2.0.0",
51
52
  "vnu-jar": "^20.5.29",
52
- "webpack": "^4.43.0"
53
+ "webpack": "^5.58.1"
53
54
  },
54
55
  "devDependencies": {
55
56
  "@ckeditor/ckeditor5-dev-env": "^21.0.0",
@@ -0,0 +1,26 @@
1
+ /**
2
+ * @license Copyright (c) 2017-2021, CKSource - Frederico Knabben. All rights reserved.
3
+ * For licensing, see LICENSE.md.
4
+ */
5
+
6
+ 'use strict';
7
+
8
+ const normalizeBadges = require( '../utils/normalizebadges' );
9
+
10
+ /**
11
+ * Normalizes badged in page configuration
12
+ *
13
+ * badges: [ premium, badgeFoo, unknownBadge ]
14
+ *
15
+ * to Pug-friendly format with unknown badges filtered out:
16
+ *
17
+ * [
18
+ * { name: 'premium', label: 'Premium feature' },
19
+ * { name: 'foo', label: 'A foo page label' }
20
+ * ]
21
+ *
22
+ * @protected
23
+ * @param {Object} data
24
+ * @return {Array.<Object>}
25
+ */
26
+ hexo.extend.helper.register( 'normalizeBadges', normalizeBadges );
@@ -9,7 +9,16 @@ const cheerio = require( 'cheerio' );
9
9
 
10
10
  hexo.extend.helper.register( 'uToc', ( data, options = {} ) => {
11
11
  const $ = cheerio.load( data );
12
- const headings = $( 'h2,h3,h4,h5,h6' )
12
+
13
+ let usedHeadings = [ 'h2', 'h3', 'h4', 'h5', 'h6' ];
14
+
15
+ if ( options.tocLimit >= 0 ) {
16
+ usedHeadings = usedHeadings.slice( 0, options.tocLimit );
17
+ }
18
+
19
+ usedHeadings = usedHeadings.join( ',' );
20
+
21
+ const headings = $( usedHeadings )
13
22
  .filter( function() {
14
23
  return !$( this ).parents( '.live-snippet, .collapsing-list__item' ).length;
15
24
  } );
@@ -0,0 +1,50 @@
1
+ /**
2
+ * @license Copyright (c) 2017-2021, CKSource - Frederico Knabben. All rights reserved.
3
+ * For licensing, see LICENSE.md.
4
+ */
5
+
6
+ 'use strict';
7
+
8
+ const KNOWN_BADGES = {
9
+ premium: {
10
+ name: 'premium',
11
+ label: 'Premium feature'
12
+ }
13
+ };
14
+
15
+ /**
16
+ * Normalizes badged in page configuration
17
+ *
18
+ * badges: [ premium, badgeFoo, unknownBadge ]
19
+ *
20
+ * to Pug-friendly format with unknown badges filtered out:
21
+ *
22
+ * [
23
+ * { name: 'premium', label: 'Premium feature' },
24
+ * { name: 'foo', label: 'A foo page label' }
25
+ * ]
26
+ *
27
+ * @protected
28
+ * @param {Object} data
29
+ * @return {Array.<Object>}
30
+ */
31
+ module.exports = function normalizeBadges( data ) {
32
+ if ( !data.badges ) {
33
+ return;
34
+ }
35
+
36
+ return data.badges
37
+ .filter( badgeName => {
38
+ if ( !KNOWN_BADGES[ badgeName ] ) {
39
+ console.warn(
40
+ `Warning: Unknown badge "${ badgeName }" set for the page "${ data.title }". ` +
41
+ `Known badges are: ${ Object.keys( KNOWN_BADGES ).map( badgeName => `"${ badgeName }"` ).join( ', ' ) }`
42
+ );
43
+
44
+ return false;
45
+ }
46
+
47
+ return true;
48
+ } )
49
+ .map( badgeName => KNOWN_BADGES[ badgeName ] );
50
+ };
@@ -19,10 +19,7 @@ const LINK_REGEXP = /\\?{(?:@linkapi|@link|@linksdk|@linkexample)\s+[^{]+?({[^}]
19
19
  * @return {Boolean}
20
20
  */
21
21
  module.exports = function parseLinks( page, hexo ) {
22
- if ( hexo.projectGlobals.common._disabledFilters.has( parseLinks.name ) ) {
23
- return;
24
- }
25
-
22
+ const isSilentError = hexo.projectGlobals.common._disabledFilters.has( parseLinks.name );
26
23
  const relativeUrlHelper = hexo.extend.helper.store.relative_url;
27
24
 
28
25
  page.content = page.content.replace( LINK_REGEXP, match => {
@@ -30,11 +27,11 @@ module.exports = function parseLinks( page, hexo ) {
30
27
  return match.replace( /^\\{/, '{' ).replace( /\\}$/, '}' );
31
28
  }
32
29
  if ( match.includes( 'module:' ) || match.includes( '@linkapi' ) ) {
33
- return linkToApi( match, page, hexo, { relativeUrlHelper } );
30
+ return linkToApi( match, page, hexo, { relativeUrlHelper, isSilentError } );
34
31
  } else if ( match.includes( '@linksdk' ) || match.includes( '@linkexample' ) ) {
35
- return linkToSdk( match, page, hexo, { relativeUrlHelper } );
32
+ return linkToSdk( match, page, hexo, { relativeUrlHelper, isSilentError } );
36
33
  } else {
37
- return linkToGuide( match, page, hexo, { relativeUrlHelper } );
34
+ return linkToGuide( match, page, hexo, { relativeUrlHelper, isSilentError } );
38
35
  }
39
36
  } );
40
37
 
@@ -47,18 +44,27 @@ module.exports = function parseLinks( page, hexo ) {
47
44
  * @param {Object} hexo
48
45
  * @param {Object} options
49
46
  * @param {Function} options.relativeUrlHelper
47
+ * @param {Boolean} options.isSilentError
50
48
  */
51
- function linkToApi( str, data, hexo, { relativeUrlHelper } ) {
49
+ function linkToApi( str, data, hexo, { relativeUrlHelper, isSilentError } ) {
52
50
  const linkMatchResult = str.match( /^{((?:@linkapi|@link)[\s\S]+)}$/ );
53
51
 
54
52
  if ( !linkMatchResult ) {
55
- return onError( str, data.source );
53
+ return onError( {
54
+ value: str,
55
+ source: data.source,
56
+ isSilent: isSilentError
57
+ } );
56
58
  }
57
59
 
58
60
  const linkContentMatchResult = linkMatchResult[ 1 ].match( /^(?:@linkapi|@link)\s*(?:@(\w+))*\s*(\S+)\s*([\s\S]*)$/ );
59
61
 
60
62
  if ( !linkContentMatchResult ) {
61
- return onError( str, data.source );
63
+ return onError( {
64
+ value: str,
65
+ source: data.source,
66
+ isSilent: isSilentError
67
+ } );
62
68
  }
63
69
 
64
70
  const projectName = linkContentMatchResult[ 1 ] || data.projectName;
@@ -72,14 +78,16 @@ function linkToApi( str, data, hexo, { relativeUrlHelper } ) {
72
78
  }
73
79
 
74
80
  if ( !itemName ) {
75
- return onError( str, data.source );
81
+ return onError( {
82
+ value: str,
83
+ source: data.source,
84
+ isSilent: isSilentError
85
+ } );
76
86
  }
77
87
 
78
88
  const baseItemName = getBaseItemName( itemName );
79
-
80
89
  const hashWithoutPrefix = itemName.replace( baseItemName, '' ).slice( 1 );
81
90
  const hash = hashWithoutPrefix ? `#${ hashWithoutPrefix }` : '';
82
-
83
91
  const project = hexo.projectGlobals[ projectName ];
84
92
 
85
93
  let apiSlug;
@@ -89,7 +97,12 @@ function linkToApi( str, data, hexo, { relativeUrlHelper } ) {
89
97
  } else if ( isIgnoredProject( projectName, hexo ) || hexo.projectGlobals.common.isSingleProject ) {
90
98
  return str;
91
99
  } else {
92
- return onError( str, data.source, `Project ${ chalk.redBright( projectName ) } is not defined.` );
100
+ return onError( {
101
+ value: str,
102
+ source: data.source,
103
+ isSilent: isSilentError,
104
+ description: `Project ${ chalk.redBright( projectName ) } is not defined.`
105
+ } );
93
106
  }
94
107
 
95
108
  const basePath = projectName === data.projectName ?
@@ -125,9 +138,12 @@ function linkToApi( str, data, hexo, { relativeUrlHelper } ) {
125
138
  // When link tag follows notation: ...SomeClass#methodName, then must use 'extraId' as the hash.
126
139
  href = relativeUrlHelper( data.path, upath.join( basePath, apiSlug, fileName + `#${ docletByBaseAndHash.extraId }` ) );
127
140
  } else {
128
- onError( str, data.source, 'No doclet found. Link remain not transformed.' );
129
-
130
- return str;
141
+ return onError( {
142
+ value: str,
143
+ source: data.source,
144
+ isSilent: isSilentError,
145
+ description: 'No doclet found. Link remain not transformed.'
146
+ } );
131
147
  }
132
148
  }
133
149
 
@@ -170,13 +186,18 @@ function getFileName( itemName ) {
170
186
  * @param {Object} hexo
171
187
  * @param {Object} options
172
188
  * @param {Function} options.relativeUrlHelper
189
+ * @param {Boolean} options.isSilentError
173
190
  */
174
- function linkToSdk( str, data, hexo, { relativeUrlHelper } ) {
191
+ function linkToSdk( str, data, hexo, { relativeUrlHelper, isSilentError } ) {
175
192
  const regExp = /(?:@linksdk|@linkexample) (?:@(\w+) )?(\w+)(?:\.html)?(#\S+)? ([^}]+)/;
176
193
  const match = regExp.exec( str );
177
194
 
178
195
  if ( !match ) {
179
- return onError( str, data.source );
196
+ return onError( {
197
+ value: str,
198
+ source: data.source,
199
+ isSilent: isSilentError
200
+ } );
180
201
  }
181
202
 
182
203
  const projectName = match[ 1 ] ? match[ 1 ] : data.projectName;
@@ -196,13 +217,18 @@ function linkToSdk( str, data, hexo, { relativeUrlHelper } ) {
196
217
  * @param {Object} hexo
197
218
  * @param {Object} options
198
219
  * @param {Function} options.relativeUrlHelper
220
+ * @param {Boolean} options.isSilentError
199
221
  */
200
- function linkToGuide( str, data, hexo, { relativeUrlHelper } ) {
222
+ function linkToGuide( str, data, hexo, { relativeUrlHelper, isSilentError } ) {
201
223
  const rgxp = /@link(?:\s+@(\w+))?\s+([^}\s]+)\s*([^}]*)}/;
202
224
  const match = rgxp.exec( str );
203
225
 
204
226
  if ( !match ) {
205
- return onError( str, data.source );
227
+ return onError( {
228
+ value: str,
229
+ source: data.source,
230
+ isSilent: isSilentError
231
+ } );
206
232
  }
207
233
 
208
234
  const pathToGuideSplit = match[ 2 ].split( '#' );
@@ -215,9 +241,14 @@ function linkToGuide( str, data, hexo, { relativeUrlHelper } ) {
215
241
  if ( shouldIgnoreGuideLink( match, data, projectName, hexo ) ) {
216
242
  if ( isIgnoredProject( projectName, hexo ) || hexo.projectGlobals.common.isSingleProject ) {
217
243
  return str;
218
- } else {
219
- return onError( str, data.source, `Project ${ chalk.redBright( projectName ) } is not defined.` );
220
244
  }
245
+
246
+ return onError( {
247
+ value: str,
248
+ source: data.source,
249
+ isSilent: isSilentError,
250
+ description: `Project ${ chalk.redBright( projectName ) } is not defined.`
251
+ } );
221
252
  }
222
253
 
223
254
  const projectBasePath = match[ 1 ] ? hexo.projectGlobals[ projectName ].BASE_PATH : data.BASE_PATH;
@@ -228,7 +259,11 @@ function linkToGuide( str, data, hexo, { relativeUrlHelper } ) {
228
259
  targetPath = upath.join( projectBasePath, 'index.html' );
229
260
  } else {
230
261
  if ( !pagePaths ) {
231
- return onError( str, data.source );
262
+ return onError( {
263
+ value: str,
264
+ source: data.source,
265
+ isSilent: isSilentError
266
+ } );
232
267
  }
233
268
 
234
269
  // pathToGuide is guide's physical path in project directory before being processed by hexo.
@@ -241,7 +276,11 @@ function linkToGuide( str, data, hexo, { relativeUrlHelper } ) {
241
276
  } );
242
277
 
243
278
  if ( !pagePathData && pathToGuide !== 'index' ) {
244
- return onError( str, data.source );
279
+ return onError( {
280
+ value: str,
281
+ source: data.source,
282
+ isSilent: isSilentError
283
+ } );
245
284
  }
246
285
 
247
286
  targetPath = pagePathData.newDataPath;
@@ -252,15 +291,24 @@ function linkToGuide( str, data, hexo, { relativeUrlHelper } ) {
252
291
  return `<a href=${ href }${ hash }>${ linkText }</a>`;
253
292
  }
254
293
 
255
- function onError( tag, source, extraComment ) {
256
- process.exitCode = 1;
257
-
258
- console.log(
259
- `${ chalk.red( 'Error: ' ) }Failed while convert ${ chalk.cyanBright( tag ) } tag in ` +
260
- `${ chalk.magentaBright( source ) }.${ extraComment ? chalk.italic( ' ' + extraComment ) : '' }`
261
- );
294
+ /**
295
+ * @param {String} value An expression that could not be transformed into a link.
296
+ * @param {String} source A path to the file where the link was found.
297
+ * @param {Boolean} [isSilent] Whether to report an error when conversion into the link failed.
298
+ * @param {String} [description] Optional message describing the error.
299
+ * @return {String}
300
+ */
301
+ function onError( { value, source, isSilent, description } ) {
302
+ if ( !isSilent ) {
303
+ process.exitCode = 1;
304
+
305
+ console.log(
306
+ `${ chalk.red( 'Error: ' ) }Failed while convert ${ chalk.cyanBright( value ) } tag in ` +
307
+ `${ chalk.magentaBright( source ) }.${ description ? chalk.italic( ' ' + description ) : '' }`
308
+ );
309
+ }
262
310
 
263
- return tag;
311
+ return value;
264
312
  }
265
313
 
266
314
  function isIgnoredProject( projectName, hexo ) {
@@ -5,16 +5,47 @@
5
5
 
6
6
  'use strict';
7
7
 
8
- const sass = require( 'node-sass' );
8
+ const sass = require( 'sass' );
9
9
  const fs = require( 'fs-extra' );
10
10
  const upath = require( 'upath' );
11
11
 
12
12
  module.exports = ( src, dst ) => {
13
13
  return new Promise( ( resolve, reject ) => {
14
- sass.render( {
14
+ const options = {
15
15
  file: src,
16
- outputStyle: 'compressed'
17
- }, ( err, result ) => {
16
+ outputStyle: 'compressed',
17
+ importer( url, file, done ) {
18
+ // In case of an import from the `node_modules` directory.
19
+ if ( url.startsWith( '~' ) ) {
20
+ // Resolve the path regarding the current working directory.
21
+ const absolutePath = require.resolve( url.substr( 1 ) );
22
+
23
+ return fs.readFile( absolutePath, 'utf-8', ( err, data ) => {
24
+ if ( err ) {
25
+ return done( err );
26
+ }
27
+
28
+ return done( {
29
+ contents: data
30
+ } );
31
+ } );
32
+ }
33
+
34
+ // Import a local file (a relative path).
35
+ const directory = upath.dirname( file );
36
+
37
+ // Replace "directory/filename" with "directory/_filename.scss".
38
+ const fileName = url.replace( /(.+)(?:\/(.+))$/, ( match, dirName, fileName ) => {
39
+ return dirName + '/_' + fileName + '.scss';
40
+ } );
41
+
42
+ return done( {
43
+ file: upath.join( directory, fileName )
44
+ } );
45
+ }
46
+ };
47
+
48
+ sass.render( options, ( err, result ) => {
18
49
  if ( err ) {
19
50
  return reject( err );
20
51
  }
@@ -6,4 +6,8 @@ mixin navTreeItem( data )
6
6
  div( class=_class )
7
7
  span( class="tree__item--guide tree__item__text" ) #{ menuTitle }
8
8
  - if( data.shouldDisplayNewIndicator )
9
- span( class="tree__item__badge tree__item__badge_new" ) New
9
+ span( class="tree__item__badge tree__item__badge_new" data-badge-tooltip="New or updated content" ) New
10
+ - if( data.badges )
11
+ each badge in normalizeBadges( data )
12
+ span( class="tree__item__badge tree__item__badge_" + badge.name data-badge-tooltip=badge.label )
13
+ span( class="tree__item__badge__text" ) #{ badge.label }
@@ -21,6 +21,10 @@ mixin navTreeLevel( data, isRoot )
21
21
  li
22
22
  div.tree__item__wrapper
23
23
  span( class="tree__item--folder tree__item__text" ) #{ data.name }
24
+ - if( data.badges )
25
+ each badge in normalizeBadges( data )
26
+ span( class="tree__item__badge tree__item__badge_" + badge.name data-badge-tooltip=badge.label )
27
+ span( class="tree__item__badge__text" ) #{ badge.label }
24
28
  ul.tree__item-nested-list
25
29
  each item in dataArr
26
30
  //- Categories have a property 'name', guides don't have property 'name'.
@@ -15,6 +15,8 @@ if ( page[ 'twitter-card' ] || ogConfig.description )
15
15
  meta( name='twitter:card' content= page[ 'twitter-card' ] || ogConfig.description )
16
16
  meta( name='twitter:site' content= '@ckeditor' )
17
17
 
18
+ meta( name= 'x-generated-at' content= Date() )
19
+
18
20
  if ( mainOg || ( projectLocals && projectLocals.og ) || page[ 'og-description' ] )
19
21
  meta( property='og:title' content= page[ 'og-title' ] || title )
20
22
  if ( ogConfig.description || page[ 'og-description' ] )
@@ -7,7 +7,7 @@ block content
7
7
  != split.title || page.title
8
8
 
9
9
  if page.toc !== false
10
- != uToc( page.content )
10
+ != uToc( page.content, { tocLimit: page[ 'toc-limit' ] } )
11
11
 
12
12
  != split.content
13
13
 
@@ -8,7 +8,7 @@ block content
8
8
  != split.title || page.title
9
9
 
10
10
  if page.toc !== false
11
- != uToc( page.content, { groupId: page.groupId } )
11
+ != uToc( page.content, { groupId: page.groupId, tocLimit: page[ 'toc-limit' ] } )
12
12
 
13
13
  != split.content
14
14
 
@@ -8,7 +8,7 @@ block content
8
8
  != split.title || page.title
9
9
 
10
10
  if page.toc !== false
11
- != uToc( page.content, { groupId: page.groupId } )
11
+ != uToc( page.content, { groupId: page.groupId, tocLimit: page[ 'toc-limit' ] } )
12
12
 
13
13
  != split.content
14
14
 
@@ -0,0 +1 @@
1
+ <svg width="16" height="16" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><filter x="-11.8%" y="-7.1%" width="123.7%" height="119%" filterUnits="objectBoundingBox" id="c"><feOffset dy="1" in="SourceAlpha" result="shadowOffsetOuter1"/><feGaussianBlur stdDeviation=".5" in="shadowOffsetOuter1" result="shadowBlurOuter1"/><feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0784203589 0" in="shadowBlurOuter1"/></filter><rect id="a" x="0" y="0" width="16" height="16" rx="8"/><path id="d" d="m8 11.12-4.114 2.543 1.147-4.699-3.69-3.127 4.823-.361L8 1l1.834 4.476 4.823.361-3.69 3.127 1.147 4.699z"/></defs><g fill="none" fill-rule="evenodd"><mask id="b" fill="#fff"><use xlink:href="#a"/></mask><use fill="#EAA930" xlink:href="#a"/><path fill-opacity=".243" fill="#FFF400" mask="url(#b)" d="M-4-3H8v21H-4z"/><g mask="url(#b)"><use fill="#000" filter="url(#c)" xlink:href="#d"/><use fill="#FFF" xlink:href="#d"/></g></g></svg>
@@ -21,7 +21,7 @@ div.api-props-filter {
21
21
  border-color: u-color( 'selected' );
22
22
 
23
23
  &:hover {
24
- background: u-color( 'selected', 5 );
24
+ background: u-color( 'selected', 5% );
25
25
  }
26
26
  }
27
27
 
@@ -16,7 +16,7 @@
16
16
  text-decoration: none;
17
17
 
18
18
  &:hover {
19
- color: u-color('badge-#{ $color }', -50 );
19
+ color: u-color('badge-#{ $color }', -50% );
20
20
  text-decoration: none;
21
21
  }
22
22
  }
@@ -185,7 +185,7 @@ ul.collapsing-list {
185
185
  overflow: hidden;
186
186
  height: $u-line-height-base + em;
187
187
  white-space: nowrap;
188
- margin-bottom: u-spacing( 0 )/2;
188
+ margin-bottom: math.div( u-spacing( 0 ), 2 );
189
189
  }
190
190
  }
191
191
 
@@ -233,7 +233,7 @@ ul.collapsing-list {
233
233
  &__dev-names {
234
234
  code#{&}--active {
235
235
  display: block;
236
- color: u-color( 'text', 40 );
236
+ color: u-color( 'text', 40% );
237
237
  font-size: u-font-size( -1 );
238
238
  cursor: default;
239
239
  }
@@ -80,7 +80,7 @@
80
80
 
81
81
  h1 {
82
82
  &:first-of-type {
83
- margin-bottom: u-spacing( 0 ) / 2;
83
+ margin-bottom: math.div( u-spacing( 0 ), 2 );
84
84
  }
85
85
  }
86
86
 
@@ -124,7 +124,7 @@
124
124
  font-size: 0.9em;
125
125
  padding: 0;
126
126
  margin: -0.4em 0 0 0;
127
- color: u-color( 'text', 50 );
127
+ color: u-color( 'text', 50% );
128
128
 
129
129
  &--hidden {
130
130
  display: none;
@@ -27,7 +27,7 @@
27
27
  }
28
28
 
29
29
  p {
30
- color: u-color( 'text', 20 );
30
+ color: u-color( 'text', 20% );
31
31
  position: absolute;
32
32
  bottom: u-spacing( 2 );
33
33
  right: u-spacing( 3 );
@@ -146,9 +146,9 @@
146
146
  kbd {
147
147
  display: inline-block;
148
148
  background: u-color( 'background-dark' );
149
- border: solid 1px u-border-color( 'background-hue', 5 );
150
- border-bottom-color: u-border-color( 'background-hue', -5 );
151
- box-shadow: inset 0 -1px 0 u-border-color( 'background-hue', -5 );
149
+ border: solid 1px u-border-color( 'background-hue', 5% );
150
+ border-bottom-color: u-border-color( 'background-hue', -5% );
151
+ box-shadow: inset 0 -1px 0 u-border-color( 'background-hue', -5% );
152
152
  font-family: $u-font-face-mono;
153
153
  font-size: .8em; // 12px;
154
154
  padding: u-spacing( -3 ) u-spacing( -2 );
@@ -173,7 +173,7 @@
173
173
  margin-bottom: 0;
174
174
 
175
175
  &:last-of-type {
176
- margin-bottom: u-spacing( 0 )/3;
176
+ margin-bottom: math.div( u-spacing( 0 ), 3 );
177
177
  }
178
178
  }
179
179
 
@@ -211,7 +211,7 @@
211
211
  }
212
212
 
213
213
  td, th {
214
- border: 1px solid u-border-color( 'background-dark', 20 );
214
+ border: 1px solid u-border-color( 'background-dark', 20% );
215
215
  padding: 6px 12px;
216
216
  }
217
217
 
@@ -14,7 +14,7 @@
14
14
  position: absolute;
15
15
  padding: 0 1em;
16
16
  left: -2em;
17
- color: u-color( 'link', 20 );
17
+ color: u-color( 'link', 20% );
18
18
  }
19
19
 
20
20
  &:hover {
@@ -28,8 +28,8 @@ p.tip {
28
28
  width: $u-top-icon-width;
29
29
  height: $u-top-icon-width;
30
30
  position: absolute;
31
- left: ($u-top-icon-width*2 - $u-top-icon-width/2 ) * -1;
32
- top: $u-top-icon-width/2;
31
+ left: ( $u-top-icon-width * 2 - math.div( $u-top-icon-width, 2 ) ) * -1;
32
+ top: math.div( $u-top-icon-width, 2 );
33
33
  }
34
34
 
35
35
  @include u-responsive-narrow {
@@ -41,8 +41,8 @@ p.tip {
41
41
  width: $u-top-icon-width;
42
42
  height: $u-top-icon-width;
43
43
  position: absolute;
44
- left: $u-top-icon-width - $u-top-icon-width/2;
45
- top: $u-top-icon-width/2;
44
+ left: $u-top-icon-width - math.div( $u-top-icon-width, 2 );
45
+ top: math.div( $u-top-icon-width, 2 );
46
46
  }
47
47
  }
48
48
 
@@ -140,7 +140,7 @@ nav.api-secondary-navigation {
140
140
  }
141
141
 
142
142
  h3 {
143
- margin-bottom: u-spacing( 0 ) / 3;
143
+ margin-bottom: math.div( u-spacing( 0 ), 3 );
144
144
  padding-top: 0;
145
145
  }
146
146
  }
@@ -23,7 +23,7 @@
23
23
 
24
24
  &:hover {
25
25
  &::before {
26
- border-color: transparent transparent transparent u-color( 'toggler', -8 );
26
+ border-color: transparent transparent transparent u-color( 'toggler', -8% );
27
27
  }
28
28
  }
29
29
  }
@@ -37,7 +37,7 @@
37
37
 
38
38
  &:hover {
39
39
  &::before {
40
- border-color: u-color( 'toggler', -8 ) transparent transparent transparent;
40
+ border-color: u-color( 'toggler', -8% ) transparent transparent transparent;
41
41
  }
42
42
  }
43
43
  }