├── .gitignore
├── .travis.yml
├── LICENSE
├── README.md
├── build
└── sass-concat.js
├── dist
└── cell.scss
├── docs
└── sass
│ ├── assets
│ ├── css
│ │ └── main.css
│ ├── images
│ │ ├── favicon.png
│ │ ├── logo_full_compact.svg
│ │ ├── logo_full_inline.svg
│ │ ├── logo_light_compact.svg
│ │ └── logo_light_inline.svg
│ └── js
│ │ ├── main.js
│ │ ├── main.min.js
│ │ ├── search.js
│ │ ├── sidebar.js
│ │ └── vendor
│ │ ├── fuse.min.js
│ │ ├── jquery.min.js
│ │ └── prism.min.js
│ └── index.html
├── package-lock.json
├── package.json
├── src
├── _cell.scss
├── _config.scss
├── atoms
│ ├── _display.scss
│ ├── _position.scss
│ └── _visibility.scss
├── mixins
│ ├── _component.scss
│ ├── _context.scss
│ ├── _extend.scss
│ ├── _modifier.scss
│ ├── _module.scss
│ ├── _option.scss
│ ├── _pseudo-state.scss
│ ├── _value.scss
│ └── _wrapper.scss
└── utilities
│ ├── _create-config.scss
│ ├── _create-selector-from-context.scss
│ ├── _css-properties.scss
│ ├── _enabled.scss
│ ├── _get-module-name.scss
│ ├── _get-param.scss
│ ├── _merge-css-maps.scss
│ ├── _module-tree.scss
│ ├── _option.scss
│ ├── _parse-cq.scss
│ ├── _remove-junk.scss
│ ├── _remove-modifiers.scss
│ ├── _selector-to-map.scss
│ ├── _setting.scss
│ ├── _strip-glue.scss
│ ├── _theme.scss
│ ├── _this.scss
│ └── _value-enabled.scss
├── stylelint.config.js
└── test
├── mixins
└── _module.scss
├── tests.js
├── tests.scss
└── utilities
├── _config.scss
├── _option.scss
├── _setting.scss
└── _this.scss
/.gitignore:
--------------------------------------------------------------------------------
1 | .idea
2 | .vscode
3 | .settings
4 | .sass-cache
5 | .DS_Store
6 | debug.log
7 | node_modules
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 | node_js:
3 | - 10
4 | install:
5 | - npm install
6 | before_script:
7 | - npm run build
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | [](https://github.com/One-Nexus/Cell/blob/master/LICENSE)
2 | [](https://travis-ci.com/One-Nexus/Cell)
3 | []((https://www.npmjs.com/package/@onenexus/cell))
4 | [](https://www.npmjs.com/package/@onenexus/cell)
5 |
6 | > Style BEM DOM elements using Sass [[View SassDocs](https://one-nexus.github.io/Cell/sass/)]
7 |
8 |
9 |
10 | * [Overview](#overview)
11 | * [Installation & Setup](#installation--setup)
12 | * [Creating a Module](https://github.com/One-Nexus/Cell/wiki/Creating-a-Module)
13 | * [Mixins](#mixins)
14 | * [Utility Functions](#utilities)
15 |
16 |
31 |
32 | ## Overview
33 |
34 | Cell is used for styling DOM elements that follow the [Cell naming convention](https://github.com/One-Nexus/Cell/wiki/Cell-Naming-Convention) (which is almost identical to [BEM](http://getbem.com/)).
35 |
36 | > [Learn how to integrate with React components](#using-with-react)
37 |
38 | * Cell is used for creating modular, configurable and scalable Sass components
39 | * Works with any Sass implementation (Ruby, Dart, Node...)
40 | * Requires Sass 3.4+ (4.9+ if using Node-Sass)
41 | * [Import themes/configuration into your Sass/Cell components as JavaScript/JSON](https://github.com/One-Nexus/Cell/wiki/JavaScript-Configuration#usage)
42 | * Built for the [Synergy framework](https://github.com/One-Nexus/Synergy)
43 | * [Compatible with Cell Query](https://github.com/One-Nexus/Synergy-Front-End-Guides/wiki/Cell-Query)
44 |
45 | ### Example
46 |
47 | Given the following markup for an accordion with an active panel component:
48 |
49 | > [View CodeSandbox Demo](https://codesandbox.io/s/cell-demo--basic-p55bc)
50 |
51 | > Unlike traditional BEM, you do not need separate classes for modifiers
52 |
53 | ```html
54 |
64 | ```
65 |
66 | This can be styled with Cell like so:
67 |
68 | ```scss
69 | @include module('accordion') {
70 | @include component('panel') {
71 | ...
72 |
73 | @include is('active') {
74 | @include component('content') {
75 | display: block;
76 | }
77 | }
78 | }
79 |
80 | @include component('title') {
81 | ...
82 | }
83 |
84 | @include component('content') {
85 | ...
86 | display: none;
87 | }
88 | }
89 | ```
90 |
91 | ### Using `context()`
92 |
93 | The above examples use the traditional _cascading_ paradigm to apply styles under certain conditions. You can see that to _show_ the `content` component above, the `display` property is applied in a cascading fashion _inside_ the `panel` component.
94 |
95 | Cell allows you to go about this in a dfferent way, allowing you to keep all styles pertaining to a single component in one place, thanks to the [`context()`](https://github.com/One-Nexus/Cell/wiki/Context()) mixin, as seen in this example (this will produce identical CSS to the previous example):
96 |
97 | ```scss
98 | @include module('accordion') {
99 | @include component('panel') {
100 | ...
101 | }
102 |
103 | @include component('title') {
104 | ...
105 | }
106 |
107 | @include component('content') {
108 | ...
109 | display: none;
110 |
111 | @include context(($this, 'panel'), 'active') {
112 | display: block;
113 | }
114 | }
115 | }
116 | ```
117 |
118 | ### Using [Cell Atoms](https://github.com/One-Nexus/Cell/wiki/Atoms)
119 |
120 | > [Learn more about Cell Atoms](https://github.com/One-Nexus/Cell/wiki/Atoms)
121 |
122 | Continuing from the previous example, the `display` Atom can instead be used to handle the `display` property:
123 |
124 | ```scss
125 | @include module('accordion') {
126 | @include component('panel') {
127 | ...
128 | }
129 |
130 | @include component('title') {
131 | ...
132 | }
133 |
134 | @include component('content') {
135 | ...
136 | @include display((($this, 'panel'), 'active'), block, none);
137 | }
138 | }
139 | ```
140 |
141 | ### Using [Cell Query (CQ)](https://github.com/One-Nexus/Synergy-Front-End-Guides/wiki/Cell-Query)
142 |
143 | Cell can interpret and parse CQ by passing a CQ compatible Sass map as the second parameter to the `module()` mixin, allowing the `accordion` example to be re-written as:
144 |
145 | ```scss
146 | @include module('accordion', (
147 | 'panel': (
148 | ...
149 | ),
150 |
151 | 'title': (
152 | ...
153 | ),
154 |
155 | 'content': (
156 | ...
157 | 'display': none,
158 |
159 | 'panel-is-active': (
160 | 'display': block
161 | )
162 | )
163 | ));
164 | ```
165 |
166 | > [Learn more about Cell and Cell Query (CQ)](https://github.com/One-Nexus/Cell/wiki/Cell-Query)
167 |
168 | ## Installation & Setup
169 |
170 | ```
171 | npm install --save @onenexus/cell
172 | ```
173 |
174 | ```scss
175 | // this path will vary depending on where the library is being imported
176 | @import '../../node_modules/@onenexus/cell/dist/cell';
177 | ```
178 |
179 | If you are using Node Sass, you can import the library anywhere using:
180 |
181 | ```scss
182 | @import '~@onenexus/cell/dist/cell';
183 | ```
184 |
185 | > See the [JavaScript Configuration](https://github.com/One-Nexus/Cell/wiki/JavaScript-Configuration) page for instructions on how to use JavaScript/JSON configuration
186 |
187 | ## Using with JavaScript
188 |
189 | Cell can be used with JavaScript for things like [theming](https://github.com/One-Nexus/Cell/wiki/Theming) and [module configuration](https://github.com/One-Nexus/Cell/wiki/Module-Configuration).
190 |
191 | > [View CodeSandbox Demo](https://codesandbox.io/s/cell-demo--js-iklx3)
192 |
193 | > [Using React?](#using-with-react)
194 |
195 | ### Example
196 |
197 | ```
198 | modules/
199 | |--myModule/
200 | | |--config.js
201 | | |--styles.scss
202 | themes/
203 | |--myTheme.js
204 | app.scss
205 | ```
206 |
207 | ###### themes/myTheme.js
208 |
209 | ```js
210 | export default {
211 | colors: {
212 | primary: '#00d4ff',
213 | secondary: '#58ed02'
214 | },
215 | breakpoints: {
216 | small: '720px',
217 | large: '1400px'
218 | }
219 | }
220 | ```
221 |
222 | ###### modules/myModule/config.js
223 |
224 | ```js
225 | export default (theme) => ({
226 | name: 'myModule',
227 | background: theme.colors.primary,
228 | gutter: '1em'
229 | });
230 | ```
231 |
232 | ###### modules/myModule/styles.scss
233 |
234 | ```scss
235 | @import 'config.js';
236 |
237 | @include module {
238 | display: block;
239 | margin-top: this('gutter');
240 |
241 | @media (min-width: theme('breakpoints', 'small')) {
242 | display: inline-block;
243 | }
244 | }
245 | ```
246 |
247 | ###### app.scss
248 |
249 | ```scss
250 | @import '~@onenexus/cell/dist/cell';
251 | @import 'themes/myTheme.js';
252 | @import 'modules/myModule/styles';
253 | ```
254 |
255 | ###### CSS Output
256 |
257 | ```css
258 | .myModule, [class*="myModule--"] {
259 | background: #00d4ff;
260 | display: block;
261 | margin-top: 1em;
262 | }
263 |
264 | @media (min-width: 720px) {
265 | .myModule, [class*="myModule--"] {
266 | display: inline-block;
267 | }
268 | }
269 | ```
270 |
271 | > Note that the `background` property is output to CSS despite not being hard-coded inside `styles.scss` - this is because configuration properties that correspond to CSS properties can be automatically parsed as CSS - read the [Cell Query page](https://github.com/One-Nexus/Cell/wiki/Cell-Query) to learn more
272 |
273 | > Read the [JavaScript Configuration page](https://github.com/One-Nexus/Cell/wiki/JavaScript-Configuration) for setup instructions and more information
274 |
275 | ## Using with React
276 |
277 | Using Cell with React can be as simple as configuring your Webpack to use [Sass-Loader](https://github.com/webpack-contrib/sass-loader). See how the below React accordion component can be styled by importing its corresponding Cell module (`styles.scss`):
278 |
279 | > [View CodeSandbox Demo](https://codesandbox.io/s/cell-demo--react-hygf9)
280 |
281 | ###### modules/Accordion/index.js
282 |
283 | ```jsx
284 | import React, { useState } from 'react';
285 | import './styles.scss';
286 |
287 | const Accordion = ({ panels, ...props }) => {
288 | const [activeIndex, toggle] = useState(0);
289 |
290 | return (
291 |
292 | {panels.map(({ heading, content }, index) => (
293 |
294 |
toggle(index)}>
295 | {title}
296 |
297 |
298 |
299 | {content}
300 |
301 |
302 | ))}
303 |
304 | );
305 | }
306 |
307 | export default Accordion;
308 | ```
309 |
310 | ### Using with Lucid (React Library)
311 |
312 | [Lucid](https://github.com/One-Nexus/Lucid) is a React library for working with the Cell/BEM naming convention. If using Lucid, the above React component could be rewritten as:
313 |
314 | ```jsx
315 | import React, { useState } from 'react';
316 | import { Module, Component } from '@onenexus/lucid';
317 | import './styles';
318 |
319 | const Accordion = ({ panels, ...props }) => {
320 | const [activeIndex, toggle] = useState(0);
321 |
322 | return (
323 |
324 | {panels.map(({ heading, content }, index) => (
325 |
326 | toggle(index)}>
327 | {heading}
328 |
329 |
330 |
331 | {content}
332 |
333 |
334 | ))}
335 |
336 | );
337 | }
338 |
339 | export default Accordion;
340 | ```
341 |
342 | This solution offers all the practical benefits of scoped styling (thanks to the underlying Cell/BEM naming convention) without any of the uglyness that BEM usually brings, and without any of the overhead that CSS-in-JS techniques (and actual *scoping*) bring, keeping everything clean and tidy.
343 |
344 | ## Useful Wiki Pages
345 |
346 | * [Creating a Cell Module](https://github.com/One-Nexus/Cell/wiki/Creating-a-Module)
347 | * [Module Configuration](https://github.com/One-Nexus/Cell/wiki/Module-Configuration)
348 | * [Theming](https://github.com/One-Nexus/Cell/wiki/Theming)
349 | * [Cell Query (CQ)](https://github.com/One-Nexus/Cell/wiki/Cell-Query)
350 | * [Using with JavaScript](https://github.com/One-Nexus/Cell/wiki/JavaScript-Configuration)
351 | * [Atoms](https://github.com/One-Nexus/Cell/wiki/Atoms)
352 |
353 | ## Mixins
354 |
355 | Cell comes with the following mixins to help create and structure your modules in the most efficient way possible:
356 |
357 | * [Module](https://github.com/One-Nexus/Cell/wiki/Module())
358 | * [Component](https://github.com/One-Nexus/Cell/wiki/Component())
359 | * [Modifier](https://github.com/One-Nexus/Cell/wiki/Modifier())
360 | * [Option](https://github.com/One-Nexus/Cell/wiki/Option())
361 | * [Value](https://github.com/One-Nexus/Cell/wiki/Value())
362 | * [Extend](https://github.com/One-Nexus/Cell/wiki/Extend())
363 | * [Context](https://github.com/One-Nexus/Cell/wiki/Context())
364 | * [Pseudo-State](https://github.com/One-Nexus/Cell/wiki/Pseudo-State())
365 | * [Wrapper](https://github.com/One-Nexus/Cell/wiki/Wrapper())
366 |
367 | ## Utility Functions
368 |
369 | * [Create Config](https://github.com/One-Nexus/Cell/wiki/utilities#create-config)
370 | * [Enabled](https://github.com/One-Nexus/Cell/wiki/utilities#enabled)
371 | * [Value Enabled](https://github.com/One-Nexus/Cell/wiki/utilities#value-enabled)
372 | * [Option](https://github.com/One-Nexus/Cell/wiki/utilities#option)
373 | * [Setting](https://github.com/One-Nexus/Cell/wiki/utilities#setting)
374 | * [This](https://github.com/One-Nexus/Cell/wiki/utilities#this)
375 | * [Theme](https://github.com/One-Nexus/Cell/wiki/utilities#theme)
376 |
377 | ## BEM Inspired Motivation
378 |
379 | The initial motiviation behind creating Cell is twofold:
380 |
381 | * Address the uglyness of BEM
382 | * Address the practical implementation of BEM using Sass
383 |
384 | BEM solves very real problems like no other solution due to [its inherent nature](https://itnext.io/thinking-of-bem-as-a-ui-philosophy-instead-of-a-css-naming-convention-9727e2cf9328), however it is [often considered quite ugly](https://hackernoon.com/bem-should-not-exist-6414005765d6); the `__` and `--` thrown into your HTML along with [repeated keywords when using modifiers](https://stackoverflow.com/questions/32052836/sass-bem-avoid-modifier-duplication-when-element-is-inside-a-modifier) (`block__component block__component--modifier-1 block__component--modifier-2`) make the HTML extremely jarring to look at. Cell solves these issues by abstracting the logic into mixins and making use of CSS's [wildcard attribute selector](https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors).
385 |
386 | Since the initial conception, Cell has evolved to become a fully-fledged framework for writing scalable and maintainable CSS.
387 |
388 | ---
389 |
390 |
391 |
392 |
393 |
394 |
395 |
396 |
397 |
398 |
--------------------------------------------------------------------------------
/build/sass-concat.js:
--------------------------------------------------------------------------------
1 | const concat = require('concat');
2 | const path = require('path');
3 | const fs = require('fs');
4 |
5 | const files = [
6 | // vendor
7 | './node_modules/Sass-Boost/dist/_sass-boost.scss',
8 | // config
9 | './src/_config.scss',
10 | // atoms
11 | './src/atoms/_display.scss',
12 | './src/atoms/_position.scss',
13 | './src/atoms/_visibility.scss',
14 | // utilities
15 | './src/utilities/_create-config.scss',
16 | './src/utilities/_create-selector-from-context.scss',
17 | './src/utilities/_css-properties.scss',
18 | './src/utilities/_enabled.scss',
19 | './src/utilities/_get-module-name.scss',
20 | './src/utilities/_get-param.scss',
21 | './src/utilities/_merge-css-maps.scss',
22 | './src/utilities/_module-tree.scss',
23 | './src/utilities/_option.scss',
24 | './src/utilities/_remove-junk.scss',
25 | './src/utilities/_remove-modifiers.scss',
26 | './src/utilities/_parse-cq.scss',
27 | './src/utilities/_selector-to-map.scss',
28 | './src/utilities/_setting.scss',
29 | './src/utilities/_strip-glue.scss',
30 | './src/utilities/_theme.scss',
31 | './src/utilities/_this.scss',
32 | './src/utilities/_value-enabled.scss',
33 | // mixins
34 | './src/mixins/_module.scss',
35 | './src/mixins/_component.scss',
36 | './src/mixins/_modifier.scss',
37 | './src/mixins/_extend.scss',
38 | './src/mixins/_context.scss',
39 | './src/mixins/_option.scss',
40 | './src/mixins/_pseudo-state.scss',
41 | './src/mixins/_value.scss',
42 | './src/mixins/_wrapper.scss'
43 | ];
44 |
45 | concat(files).then(result => {
46 | fs.writeFile(path.join(__dirname, '../dist/cell.scss'), result, error => {
47 | if (error) {
48 | return console.warn(error);
49 | }
50 | });
51 | });
--------------------------------------------------------------------------------
/docs/sass/assets/css/main.css:
--------------------------------------------------------------------------------
1 | @import url(https://fonts.googleapis.com/css?family=Roboto:400,100,300,500,700);
2 |
3 | .container:after,
4 | .header:after,
5 | .searchbar:after {
6 | content: "";
7 | display: table;
8 | clear: both
9 | }
10 | .visually-hidden {
11 | width: 1px;
12 | height: 1px;
13 | position: absolute;
14 | padding: 0;
15 | margin: -1px;
16 | overflow: hidden;
17 | clip: rect(0 0 0 0);
18 | border: 0;
19 | }
20 | .sidebar__title {
21 | text-overflow: ellipsis;
22 | overflow: hidden;
23 | white-space: nowrap;
24 | }
25 | code[class*='language-'],
26 | pre[class*='language-'] {
27 | color: black;
28 | text-shadow: 0 1px white;
29 | font-family: Consolas, Monaco, 'Andale Mono', monospace;
30 | direction: ltr;
31 | text-align: left;
32 | white-space: pre;
33 | word-spacing: normal;
34 | word-break: normal;
35 | -moz-tab-size: 4;
36 | -o-tab-size: 4;
37 | tab-size: 4;
38 | -webkit-hyphens: none;
39 | -moz-hyphens: none;
40 | -ms-hyphens: none;
41 | hyphens: none
42 | }
43 | pre[class*='language-']::-moz-selection,
44 | pre[class*='language-']::-moz-selection,
45 | code[class*='language-']::-moz-selection,
46 | code[class*='language-']::-moz-selection {
47 | text-shadow: none;
48 | background: #b3d4fc
49 | }
50 | pre[class*='language-']::selection,
51 | pre[class*='language-']::selection,
52 | code[class*='language-']::selection,
53 | code[class*='language-']::selection {
54 | text-shadow: none;
55 | background: #b3d4fc
56 | }
57 | @media print {
58 | code[class*='language-'],
59 | pre[class*='language-'] {
60 | text-shadow: none
61 | }
62 | }
63 | pre[class*='language-'] {
64 | padding: 1em;
65 | margin: .5em 0;
66 | overflow: auto
67 | }
68 | :not(pre)>code[class*='language-'],
69 | pre[class*='language-'] {
70 | background: white
71 | }
72 | :not(pre)>code[class*='language-'] {
73 | padding: .1em;
74 | border-radius: .3em
75 | }
76 | .token.comment,
77 | .token.prolog,
78 | .token.doctype,
79 | .token.cdata {
80 | color: slategray
81 | }
82 | .token.punctuation {
83 | color: #999
84 | }
85 | .namespace {
86 | opacity: .7
87 | }
88 | .token.property,
89 | .token.tag,
90 | .token.boolean,
91 | .token.number,
92 | .token.constant,
93 | .token.symbol {
94 | color: #905
95 | }
96 | .token.selector,
97 | .token.attr-name,
98 | .token.string,
99 | .token.builtin {
100 | color: #690
101 | }
102 | .token.operator,
103 | .token.entity,
104 | .token.url,
105 | .language-css .token.string,
106 | .style .token.string,
107 | .token.variable {
108 | color: #a67f59;
109 | background: rgba(255, 255, 255, 0.5)
110 | }
111 | .token.atrule,
112 | .token.attr-value,
113 | .token.keyword {
114 | color: #07a
115 | }
116 | .token.regex,
117 | .token.important {
118 | color: #e90
119 | }
120 | .token.important {
121 | font-weight: bold
122 | }
123 | .token.entity {
124 | cursor: help
125 | }
126 | html {
127 | -webkit-box-sizing: border-box;
128 | -moz-box-sizing: border-box;
129 | box-sizing: border-box
130 | }
131 | *,
132 | *::after,
133 | *::before {
134 | -webkit-box-sizing: inherit;
135 | -moz-box-sizing: inherit;
136 | box-sizing: inherit
137 | }
138 | body {
139 | font: 1em/1.35 "Roboto", "Helvetica Neue Light", "Helvetica Neue", "Helvetica", "Arial", sans-serif;
140 | overflow: auto;
141 | margin: 0
142 | }
143 | a {
144 | transition: 0.15s;
145 | text-decoration: none;
146 | color: #333;
147 | }
148 | a:hover,
149 | a:hover code {
150 | color: #2196F3;
151 | }
152 | table p {
153 | margin: 0 0 0.5rem
154 | }
155 | :not(pre)>code {
156 | color: tomato;
157 | white-space: nowrap;
158 | font-weight: normal
159 | }
160 | :not(pre)>code:hover {
161 | color: black !important;
162 | }
163 | @media (max-width: 800px) {
164 | table,
165 | tbody,
166 | tr,
167 | td,
168 | th {
169 | display: block
170 | }
171 | thead {
172 | width: 1px;
173 | height: 1px;
174 | position: absolute;
175 | padding: 0;
176 | margin: -1px;
177 | overflow: hidden;
178 | clip: rect(0 0 0 0);
179 | border: 0
180 | }
181 | tr {
182 | padding-bottom: 1em;
183 | margin-bottom: 1em;
184 | border-bottom: 2px solid #ddd
185 | }
186 | td::before,
187 | th::before {
188 | content: attr(data-label)": ";
189 | text-transform: capitalize;
190 | font-weight: bold
191 | }
192 | td p,
193 | th p {
194 | display: inline
195 | }
196 | }
197 | .layout-toggle {
198 | display: none
199 | }
200 | @media (min-width: 801px) {
201 | .layout-toggle {
202 | position: absolute;
203 | top: 8px;
204 | left: 20px;
205 | font-size: 2em;
206 | cursor: pointer;
207 | color: #1565C0;
208 | display: block
209 | }
210 | .layout-toggle:hover {
211 | color: #0D47A1;
212 | }
213 | }
214 | @media (min-width: 801px) {
215 | .sidebar-closed .sidebar {
216 | -webkit-transform: translateX(-280px);
217 | -ms-transform: translateX(-280px);
218 | transform: translateX(-280px)
219 | }
220 | .sidebar-closed .main {
221 | padding-left: 0
222 | }
223 | .sidebar-closed .header {
224 | left: 0
225 | }
226 | }
227 | .list-unstyled {
228 | padding-left: 0;
229 | list-style: none;
230 | line-height: 1.5;
231 | margin-top: 0;
232 | margin-bottom: 1.5rem
233 | }
234 | .list-inline li {
235 | display: inline-block
236 | }
237 | .container {
238 | max-width: 100%;
239 | width: 1170px;
240 | margin: 0 auto;
241 | padding: 0 2rem
242 | }
243 | .relative {
244 | position: relative
245 | }
246 | .clear {
247 | clear: both
248 | }
249 | .header {
250 | position: fixed;
251 | top: 0;
252 | right: 0;
253 | left: 280px;
254 | padding: 1em 0;
255 | background: #2196F3;
256 | color: #e0e0e0;
257 | z-index: 4000
258 | }
259 | @media (max-width: 800px) {
260 | .header {
261 | left: 0
262 | }
263 | }
264 | @media (min-width: 801px) {
265 | .header {
266 | transition: 0.2s cubic-bezier(0.215, 0.61, 0.355, 1)
267 | }
268 | }
269 | .header__title {
270 | font-weight: 500;
271 | text-align: center;
272 | margin: 0 0 0.5em 0
273 | }
274 | .header__title a {
275 | color: #e0e0e0
276 | }
277 | @media (min-width: 801px) {
278 | .header__title {
279 | float: left;
280 | font-size: 1em;
281 | margin-top: .25em;
282 | margin-bottom: 0
283 | }
284 | }
285 | .searchbar {
286 | display: inline-block;
287 | float: right
288 | }
289 | @media (max-width: 800px) {
290 | .searchbar {
291 | display: block;
292 | float: none
293 | }
294 | }
295 | .searchbar__form {
296 | float: right;
297 | position: relative
298 | }
299 | @media (max-width: 800px) {
300 | .searchbar__form {
301 | float: none
302 | }
303 | }
304 | @media (min-width: 801px) {
305 | .searchbar__form {
306 | min-width: 15em
307 | }
308 | }
309 | .searchbar__field {
310 | border: none;
311 | padding: 0.5em 0;
312 | font-size: 1em;
313 | margin: 0;
314 | width: 100%;
315 | color: #FFF;
316 | outline: none;
317 | background-color: transparent;
318 | border-bottom: 1px solid rgba(255,255,255,.7);
319 | }
320 | .searchbar__field::-webkit-input-placeholder
321 | {
322 | color: rgba(255,255,255,.7);
323 | }
324 | .searchbar__suggestions {
325 | position: absolute;
326 | top: 100%;
327 | right: 0;
328 | left: 0;
329 | box-shadow: 0 1.5px 4px rgba(0, 0, 0, 0.24), 0 1.5px 6px rgba(0, 0, 0, 0.12);
330 | border: 1px solid #e0e0e0;
331 | background: white;
332 | padding: 0;
333 | margin: 0;
334 | list-style: none;
335 | z-index: 2
336 | }
337 | .searchbar__suggestions:empty {
338 | display: none
339 | }
340 | .searchbar__suggestions .selected {
341 | background: #ddd
342 | }
343 | .searchbar__suggestions li {
344 | border-bottom: 1px solid #e0e0e0
345 | }
346 | .searchbar__suggestions li:last-of-type {
347 | border: none
348 | }
349 | .searchbar__suggestions a {
350 | display: block;
351 | padding: 0.5em;
352 | font-size: 0.9em
353 | }
354 | .searchbar__suggestions a:hover,
355 | .searchbar__suggestions a:active,
356 | .searchbar__suggestions a:focus {
357 | background: #e0e0e0
358 | }
359 | .searchbar__suggestions code {
360 | margin-right: .5em
361 | }
362 | @media (min-width: 801px) {
363 | .sidebar {
364 | position: fixed;
365 | top: 0;
366 | bottom: 0;
367 | left: 0;
368 | overflow: auto;
369 | width: 280px;
370 | z-index: 2;
371 | border-right: 1px solid #e0e0e0;
372 | transition: 0.2s cubic-bezier(0.215, 0.61, 0.355, 1)
373 | }
374 | }
375 | @media (max-width: 800px) {
376 | .sidebar {
377 | margin-top: 4em
378 | }
379 | }
380 | .sidebar__annotation {
381 | color: #5c4863
382 | }
383 | .sidebar__item {
384 | font-size: 0.9em
385 | }
386 | .sidebar__item a {
387 | padding: 0.5em 4.5em;
388 | display: block;
389 | text-decoration: none;
390 | color: #555
391 | }
392 | .sidebar__item:hover,
393 | .sidebar__item:active,
394 | .sidebar__item:focus {
395 | background: #EEE;
396 | color: #333;
397 | }
398 | .sidebar__item.is-collapsed+* {
399 | display: none
400 | }
401 | .sidebar__item--heading {
402 | padding: 1em 1.5em
403 | }
404 | .sidebar__item--heading a {
405 | font-weight: bold
406 | }
407 | .sidebar__item--sub-heading {
408 | padding: 0.5em 2.5em
409 | }
410 | .sidebar__item--sub-heading a {
411 | color: #888
412 | }
413 | .sidebar__item--heading,
414 | .sidebar__item--sub-heading {
415 | position: relative
416 | }
417 | .sidebar__item--heading:after,
418 | .sidebar__item--sub-heading:after {
419 | position: absolute;
420 | top: 50%;
421 | right: 2em;
422 | content: '\25BC';
423 | margin-top: -0.5em;
424 | color: #ddd;
425 | font-size: 0.7em
426 | }
427 | .sidebar__item--heading.is-collapsed:after,
428 | .sidebar__item--sub-heading.is-collapsed:after {
429 | content: '\25B6'
430 | }
431 |
432 | .sidebar__item--heading a,
433 | .sidebar__item--sub-heading a {
434 | padding: 0;
435 | display: inline
436 | }
437 | .sidebar__description {
438 | color: #e0e0e0;
439 | padding-right: 2em
440 | }
441 | .sidebar__header {
442 | border-bottom: 1px solid #e0e0e0
443 | }
444 | .sidebar__title {
445 | font-size: 1em;
446 | margin: 0;
447 | padding: 1.45em
448 | }
449 | .btn-toggle {
450 | background: #EFEFEF;
451 | border: none;
452 | border-bottom: 1px solid #e0e0e0;
453 | display: block;
454 | padding: 1em;
455 | width: 100%;
456 | cursor: pointer;
457 | color: #999;
458 | font-weight: bold;
459 | margin: 0;
460 | transition: 0.15s ease-out;
461 | outline: none;
462 | }
463 | .btn-toggle:hover,
464 | .btn-toggle:active,
465 | .btn-toggle:focus {
466 | background: #EEE;
467 | color: #333;
468 | }
469 | .main {
470 | background: #f9f9f9;
471 | position: relative
472 | }
473 | @media (min-width: 801px) {
474 | .main {
475 | transition: 0.2s cubic-bezier(0.215, 0.61, 0.355, 1);
476 | padding-left: 280px;
477 | padding-top: 4em;
478 | min-height: 45em
479 | }
480 | }
481 | .main__section {
482 | margin-top: 5em;
483 | }
484 | .header+.main__section {
485 | margin-top: 0;
486 | border-top: none
487 | }
488 | .main__heading,
489 | .main__heading--secondary {
490 | padding: 1em 0;
491 | margin-top: 0
492 | }
493 | @media (min-width: 801px) {
494 | .main__heading,
495 | .main__heading--secondary {
496 | padding: 2em 0 0
497 | }
498 | }
499 | .main__heading {
500 | color: #fff;
501 | font-size: 3.5em;
502 | text-align: center;
503 | padding-bottom: .5em;
504 | margin-bottom: 1em;
505 | background: #2196F3;
506 | text-align: left;
507 | font-weight: 100;
508 | }
509 | .main__heading--secondary {
510 | font-size: 2.75em;
511 | color: #2196F3;
512 | font-weight: 100;
513 | padding-top: 0;
514 | padding-bottom: .5em;
515 | margin-bottom: -2rem;
516 | position: relative;
517 | border-bottom: 1px solid #ddd;
518 | }
519 | .main__heading--secondary .container {
520 | overflow: hidden;
521 | white-space: nowrap;
522 | text-overflow: ellipsis
523 | }
524 | .main__heading--secondary::before {
525 | /*content: '';
526 | position: absolute;
527 | left: 0;
528 | right: 0;
529 | bottom: 0.15em;
530 | height: 0.2em;
531 | background-color: #dd5a6f*/
532 | }
533 | .footer {
534 | background: #e0e0e0;
535 | padding: 1em 0
536 | }
537 | .footer .container {
538 | position: relative
539 | }
540 | .footer__project-info {
541 | float: left
542 | }
543 | .footer__watermark {
544 | position: absolute;
545 | right: 0;
546 | top: -0.7em
547 | }
548 | .footer__watermark img {
549 | display: block;
550 | max-width: 7em
551 | }
552 | .project-info__name,
553 | .project-info__version,
554 | .project-info__license {
555 | display: inline-block
556 | }
557 | .project-info__version,
558 | .project-info__license {
559 | color: #555
560 | }
561 | .project-info__license {
562 | text-indent: -0.25em
563 | }
564 | .main__section {
565 | margin-bottom: 4.5rem
566 | }
567 | .main__sub-section:after {
568 | border-bottom: 1px solid #EEE;
569 | content: '';
570 | display: block;
571 | padding-top: 10%;
572 | margin-bottom: 10%;
573 | width: 100%;
574 | }
575 | .item__heading {
576 | color: #333;
577 | margin: 4.5rem 0 1.5rem 0;
578 | position: relative;
579 | font-size: 2em;
580 | font-weight: 300;
581 | float: left
582 | }
583 | .item__name {
584 | color: #333;
585 | }
586 | .item__example {
587 | margin-bottom: 1.5rem
588 | }
589 | .item__example,
590 | .item__code {
591 | border: 1px solid #e0e0e0;
592 | word-wrap: break-word;
593 | line-height: 1.42
594 | }
595 | .item__code {
596 | padding-right: 7em;
597 | clear: both;
598 | cursor: pointer;
599 | transition: box-shadow .2s ease;
600 | }
601 | .item__code:hover {
602 | box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
603 | border: 1px solid #BCBCBC;
604 |
605 | }
606 | .item__code--togglable::after {
607 | position: absolute;
608 | right: 0;
609 | bottom: -2.5em;
610 | -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
611 | opacity: 0;
612 | color: #c4c4c4;
613 | font-size: 0.8em;
614 | transition: 0.2s ease-out
615 | }
616 | .item__code--togglable:hover::after,
617 | .item__code--togglable:active::after,
618 | .item__code--togglable:focus::after {
619 | -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
620 | opacity: 1
621 | }
622 | .item__code--togglable[data-current-state='expanded']::after {
623 | content: 'Click to collapse.'
624 | }
625 | .item__code--togglable[data-current-state='collapsed']::after {
626 | content: 'Click to expand.'
627 | }
628 | .example__description {
629 | padding: 1em;
630 | background: #EFEFEF
631 | }
632 | .example__description p {
633 | margin: 0
634 | }
635 | .example__code[class*='language-'] {
636 | margin: 0
637 | }
638 | .item__anchor {
639 | font-size: 0.6em;
640 | color: #eeafb9
641 | }
642 | @media (min-width: 801px) {
643 | .item__anchor {
644 | position: absolute;
645 | right: 101%;
646 | bottom: 0.25em;
647 | -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
648 | opacity: 0
649 | }
650 | .item:hover .item__anchor {
651 | -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
652 | opacity: 1
653 | }
654 | }
655 | .item__deprecated {
656 | display: inline-block;
657 | overflow: hidden;
658 | margin-top: 5.5em;
659 | margin-left: 1em
660 | }
661 | .item__deprecated strong {
662 | float: left;
663 | color: #c00;
664 | text-transform: uppercase
665 | }
666 | .item__deprecated p {
667 | float: left;
668 | margin: 0;
669 | padding-left: 0.5em
670 | }
671 | .item__type {
672 | color: #ddd;
673 | text-transform: capitalize;
674 | font-size: 0.75em
675 | }
676 | .item__alias,
677 | .item__aliased {
678 | color: #ddd;
679 | font-size: 0.8em
680 | }
681 | .item__sub-heading {
682 | color: #333;
683 | margin-top: 1.5rem;
684 | margin-bottom: 1rem;
685 | font-size: 1em
686 | }
687 | .item__parameters {
688 | width: 100%;
689 | margin-bottom: 1em;
690 | border-collapse: collapse
691 | }
692 | .item__parameters thead th {
693 | vertical-align: bottom;
694 | border-bottom: 2px solid #ddd;
695 | border-top: none;
696 | text-align: left;
697 | color: #707070
698 | }
699 | .item__parameters tbody th {
700 | text-align: left
701 | }
702 | .item__parameters td,
703 | .item__parameters th {
704 | padding: 0.5em 0.5em 0.5em 0;
705 | vertical-align: top
706 | }
707 | @media (min-width: 801px) {
708 | tbody>.item__parameter:first-of-type>td {
709 | border-top: none
710 | }
711 | .item__parameters td,
712 | .item__parameters th {
713 | border-top: 1px solid #ddd
714 | }
715 | }
716 | .item__access {
717 | text-transform: capitalize;
718 | color: #5c4863;
719 | font-size: 0.8em
720 | }
721 | .item__since {
722 | float: right;
723 | padding-top: 0.9em;
724 | color: #c4c4c4;
725 | margin-bottom: 1em
726 | }
727 | .item__source-link {
728 | position: absolute;
729 | top: 1px;
730 | right: 1px;
731 | background: white;
732 | padding: 1em;
733 | z-index: 2;
734 | color: #c4c4c4
735 | }
736 | .item__cross-type {
737 | color: #4d4d4d;
738 | font-family: 'Consolas', 'Monaco', 'Andale Mono', monospace;
739 | font-size: 0.8em
740 | }
741 | .item__description {
742 | margin-bottom: 1.5rem
743 | }
744 | li.item__description {
745 | margin-bottom: 0
746 | }
747 | .item__description--inline>* {
748 | display: inline-block;
749 | margin: 0
750 | }
751 | .item__code-wrapper {
752 | position: relative;
753 | clear: both;
754 | margin-bottom: 1.5rem
755 | }
756 | .color-preview--inline {
757 | padding: 2px 4px;
758 | border: 1px solid rgba(0, 0, 0, 0.1);
759 | border-radius: 3px
760 | }
761 | .color-preview--block {
762 | width: 2em;
763 | height: 2em;
764 | position: absolute;
765 | top: 140%;
766 | right: 0;
767 | top: calc(100% + 20px);
768 | border: 1px solid rgba(0, 0, 0, 0.1);
769 | border-radius: 3px
770 | }
771 |
--------------------------------------------------------------------------------
/docs/sass/assets/images/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/One-Nexus/Cell/27cb9ae146a0adadfb8685ffdee80971cd0543db/docs/sass/assets/images/favicon.png
--------------------------------------------------------------------------------
/docs/sass/assets/images/logo_full_compact.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/docs/sass/assets/images/logo_full_inline.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/docs/sass/assets/images/logo_light_compact.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/docs/sass/assets/images/logo_light_inline.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/docs/sass/assets/js/main.js:
--------------------------------------------------------------------------------
1 | /* global document */
2 |
3 | (function ($, global) {
4 | 'use strict';
5 |
6 | // Constructor
7 | var App = function (conf) {
8 | this.conf = $.extend({
9 | // Search module
10 | search: new global.Search(),
11 |
12 | // Sidebar module
13 | sidebar: new global.Sidebar(),
14 |
15 | // Initialisation
16 | init: true
17 | }, conf || {});
18 |
19 | // Launch the module
20 | if (this.conf.init !== false) {
21 | this.initialize();
22 | }
23 | };
24 |
25 | // Initialisation method
26 | App.prototype.initialize = function () {
27 | this.codePreview();
28 | };
29 |
30 | // Toggle code preview collapsed/expanded modes
31 | App.prototype.codePreview = function () {
32 | var $item;
33 | var $code;
34 | var switchTo;
35 |
36 | $('.item__code--togglable').on('click', function () {
37 | $item = $(this);
38 | $code = $item.find('code');
39 | switchTo = $item.attr('data-current-state') === 'expanded' ? 'collapsed' : 'expanded';
40 |
41 | $item.attr('data-current-state', switchTo);
42 | $code.html($item.attr('data-' + switchTo));
43 | Prism.highlightElement($code[0]);
44 | });
45 | };
46 |
47 | global.App = App;
48 | }(window.jQuery, window));
49 |
50 | (function ($, global) {
51 |
52 | $(document).ready(function () {
53 | var app = new global.App();
54 | });
55 |
56 | }(window.jQuery, window));
--------------------------------------------------------------------------------
/docs/sass/assets/js/main.min.js:
--------------------------------------------------------------------------------
1 | !function(t){function e(t,n){this.list=t,this.options=n=n||{};var i,o,s;for(i=0,keys=["sort","includeScore","shouldSort"],o=keys.length;o>i;i++)s=keys[i],this.options[s]=s in n?n[s]:e.defaultOptions[s];for(i=0,keys=["searchFn","sortFn","keys","getFn"],o=keys.length;o>i;i++)s=keys[i],this.options[s]=n[s]||e.defaultOptions[s]}var n=function(t,e){if(e=e||{},this.options=e,this.options.location=e.location||n.defaultOptions.location,this.options.distance="distance"in e?e.distance:n.defaultOptions.distance,this.options.threshold="threshold"in e?e.threshold:n.defaultOptions.threshold,this.options.maxPatternLength=e.maxPatternLength||n.defaultOptions.maxPatternLength,this.pattern=e.caseSensitive?t:t.toLowerCase(),this.patternLen=t.length,this.patternLen>this.options.maxPatternLength)throw new Error("Pattern length is too long");this.matchmask=1<i;)this._bitapScore(e,l+o)<=u?i=o:d=o,o=Math.floor((d-i)/2+i);for(d=o,s=Math.max(1,l-o+1),r=Math.min(l+o,c)+this.patternLen,a=Array(r+2),a[r+1]=(1<=s;n--)if(p=this.patternAlphabet[t.charAt(n-1)],a[n]=0===e?(a[n+1]<<1|1)&p:(a[n+1]<<1|1)&p|((h[n+1]|h[n])<<1|1)|h[n+1],a[n]&this.matchmask&&(g=this._bitapScore(e,n-1),u>=g)){if(u=g,f=n-1,m.push(f),!(f>l))break;s=Math.max(1,2*l-f)}if(this._bitapScore(e+1,l)>u)break;h=a}return{isMatch:f>=0,score:g}};var i={deepValue:function(t,e){for(var n=0,e=e.split("."),i=e.length;i>n;n++){if(!t)return null;t=t[e[n]]}return t}};e.defaultOptions={id:null,caseSensitive:!1,includeScore:!1,shouldSort:!0,searchFn:n,sortFn:function(t,e){return t.score-e.score},getFn:i.deepValue,keys:[]},e.prototype.search=function(t){var e,n,o,s,r,a=new this.options.searchFn(t,this.options),h=this.list,p=h.length,c=this.options,l=this.options.keys,u=l.length,f=[],d={},g=[],m=function(t,e,n){void 0!==t&&null!==t&&"string"==typeof t&&(s=a.search(t),s.isMatch&&(r=d[n],r?r.score=Math.min(r.score,s.score):(d[n]={item:e,score:s.score},f.push(d[n]))))};if("string"==typeof h[0])for(var e=0;p>e;e++)m(h[e],e,e);else for(var e=0;p>e;e++)for(o=h[e],n=0;u>n;n++)m(this.options.getFn(o,l[n]),o,e);c.shouldSort&&f.sort(c.sortFn);for(var y=c.includeScore?function(t){return f[t]}:function(t){return f[t].item},L=c.id?function(t){return i.deepValue(y(t),c.id)}:function(t){return y(t)},e=0,v=f.length;v>e;e++)g.push(L(e));return g},"object"==typeof exports?module.exports=e:"function"==typeof define&&define.amd?define(function(){return e}):t.Fuse=e}(this);(function($,global){var Sidebar=function(conf){this.conf=$.extend({collapsedClass:"is-collapsed",storageKey:"_sassdoc_sidebar_index",indexAttribute:"data-slug",toggleBtn:".js-btn-toggle",init:true},conf||{});if(this.conf.init===true){this.initialize()}};Sidebar.prototype.initialize=function(){this.conf.nodes=$("["+this.conf.indexAttribute+"]");this.load();this.updateDOM();this.bind();this.loadToggle()};Sidebar.prototype.loadToggle=function(){$(" ",{"class":"layout-toggle",html:"×","data-alt":"☰"}).appendTo($(".header"));$(".layout-toggle").on("click",function(){var $this=$(this);var alt;$("body").toggleClass("sidebar-closed");alt=$this.html();$this.html($this.data("alt"));$this.data("alt",alt)})};Sidebar.prototype.load=function(){var index="localStorage"in global?global.localStorage.getItem(this.conf.storageKey):null;this.index=index?JSON.parse(index):this.buildIndex()};Sidebar.prototype.buildIndex=function(){var index={};var $item;this.conf.nodes.each($.proxy(function(index,item){$item=$(item);index[$item.attr(this.conf.indexAttribute)]=!$item.hasClass(this.conf.collapsedClass)},this));return index};Sidebar.prototype.updateDOM=function(){var item;for(item in this.index){if(this.index[item]===false){$("["+this.conf.indexAttribute+'="'+item+'"]').addClass(this.conf.collapsedClass)}}};Sidebar.prototype.save=function(){if(!("localStorage"in global)){return}global.localStorage.setItem(this.conf.storageKey,JSON.stringify(this.index))};Sidebar.prototype.bind=function(){var $item,slug,fn,text;var collapsed=false;global.onbeforeunload=$.proxy(function(){this.save()},this);$(this.conf.toggleBtn).on("click",$.proxy(function(event){$node=$(event.target);text=$node.attr("data-alt");$node.attr("data-alt",$node.text());$node.text(text);fn=collapsed===true?"removeClass":"addClass";this.conf.nodes.each($.proxy(function(index,item){$item=$(item);slug=$item.attr(this.conf.indexAttribute);this.index[slug]=collapsed;$("["+this.conf.indexAttribute+'="'+slug+'"]')[fn](this.conf.collapsedClass)},this));collapsed=!collapsed;this.save()},this));this.conf.nodes.on("click",$.proxy(function(event){$item=$(event.target);slug=$item.attr(this.conf.indexAttribute);this.index[slug]=!this.index[slug];$item.toggleClass(this.conf.collapsedClass)},this))};global.Sidebar=Sidebar})(window.jQuery,window);(function($,global){var Search=function(conf){this.conf=$.extend({search:{items:".sassdoc__item",input:"#js-search-input",form:"#js-search",suggestionsWrapper:"#js-search-suggestions"},fuse:{keys:["name"],threshold:.3},init:true},conf||{});if(this.conf.init===true){this.initialize()}};Search.prototype.initialize=function(){this.index=new Fuse($.map($(this.conf.search.items),function(item){var $item=$(item);return{name:$item.data("name"),type:$item.data("type"),node:$item}}),this.conf.fuse);this.initializeSearch()};Search.prototype.fillSuggestions=function(items){var searchSuggestions=$(this.conf.search.suggestionsWrapper);searchSuggestions.html("");var suggestions=$.map(items.slice(0,10),function(item){var $li=$(" ",{"data-type":item.type,"data-name":item.name,html:''+item.type.slice(0,3)+"
"+item.name+" "});searchSuggestions.append($li);return $li});return suggestions};Search.prototype.search=function(term){return this.fillSuggestions(this.index.search(term))};Search.prototype.initializeSearch=function(){var searchForm=$(this.conf.search.form);var searchInput=$(this.conf.search.input);var searchSuggestions=$(this.conf.search.suggestionsWrapper);var currentSelection=-1;var suggestions=[];var selected;var self=this;searchSuggestions.on("click",function(e){var target=$(event.target);if(target.nodeName==="A"){searchInput.val(target.parent().data("name"));suggestions=self.fillSuggestions([])}});searchForm.on("keyup",function(e){e.preventDefault();if(e.keyCode===13){if(selected){suggestions=self.fillSuggestions([]);searchInput.val(selected.data("name"));window.location=selected.children().first().attr("href")}e.stopPropagation()}if(e.keyCode===40){currentSelection=(currentSelection+1)%suggestions.length}if(e.keyCode===38){currentSelection=currentSelection-1;if(currentSelection<0){currentSelection=suggestions.length-1}}if(suggestions[currentSelection]){if(selected){selected.removeClass("selected")}selected=suggestions[currentSelection];selected.addClass("selected")}});searchInput.on("keyup",function(e){if(e.keyCode!==40&&e.keyCode!==38){currentSelection=-1;suggestions=self.search($(this).val())}else{e.preventDefault()}}).on("search",function(){suggestions=self.search($(this).val())})};global.Search=Search})(window.jQuery,window);(function($,global){"use strict";var App=function(conf){this.conf=$.extend({search:new global.Search,sidebar:new global.Sidebar,init:true},conf||{});if(this.conf.init!==false){this.initialize()}};App.prototype.initialize=function(){this.codePreview()};App.prototype.codePreview=function(){var $item;var $code;var switchTo;$(".item__code--togglable").on("click",function(){$item=$(this);$code=$item.find("code");switchTo=$item.attr("data-current-state")==="expanded"?"collapsed":"expanded";$item.attr("data-current-state",switchTo);$code.html($item.attr("data-"+switchTo));Prism.highlightElement($code[0])})};global.App=App})(window.jQuery,window);(function($,global){$(document).ready(function(){var app=new global.App})})(window.jQuery,window);var self=typeof window!="undefined"?window:{},Prism=function(){var e=/\blang(?:uage)?-(?!\*)(\w+)\b/i,t=self.Prism={util:{encode:function(e){return e instanceof n?new n(e.type,t.util.encode(e.content)):t.util.type(e)==="Array"?e.map(t.util.encode):e.replace(/&/g,"&").replace(/e.length)break e;if(p instanceof i)continue;a.lastIndex=0;var d=a.exec(p);if(d){l&&(c=d[1].length);var v=d.index-1+c,d=d[0].slice(c),m=d.length,g=v+m,y=p.slice(0,v+1),b=p.slice(g+1),w=[h,1];y&&w.push(y);var E=new i(u,f?t.tokenize(d,f):d);w.push(E);b&&w.push(b);Array.prototype.splice.apply(s,w)}}}return s},hooks:{all:{},add:function(e,n){var r=t.hooks.all;r[e]=r[e]||[];r[e].push(n)},run:function(e,n){var r=t.hooks.all[e];if(!r||!r.length)return;for(var i=0,s;s=r[i++];)s(n)}}},n=t.Token=function(e,t){this.type=e;this.content=t};n.stringify=function(e,r,i){if(typeof e=="string")return e;if(Object.prototype.toString.call(e)=="[object Array]")return e.map(function(t){return n.stringify(t,r,e)}).join("");var s={type:e.type,content:n.stringify(e.content,r,i),tag:"span",classes:["token",e.type],attributes:{},language:r,parent:i};s.type=="comment"&&(s.attributes.spellcheck="true");t.hooks.run("wrap",s);var o="";for(var u in s.attributes)o+=u+'="'+(s.attributes[u]||"")+'"';return"<"+s.tag+' class="'+s.classes.join(" ")+'" '+o+">"+s.content+""+s.tag+">"};if(!self.document){if(!self.addEventListener)return self.Prism;self.addEventListener("message",function(e){var n=JSON.parse(e.data),r=n.language,i=n.code;self.postMessage(JSON.stringify(t.tokenize(i,t.languages[r])));self.close()},!1);return self.Prism}var r=document.getElementsByTagName("script");r=r[r.length-1];if(r){t.filename=r.src;document.addEventListener&&!r.hasAttribute("data-manual")&&document.addEventListener("DOMContentLoaded",t.highlightAll)}return self.Prism}();typeof module!="undefined"&&module.exports&&(module.exports=Prism);Prism.languages.markup={comment://g,prolog:/<\?.+?\?>/,doctype://,cdata://i,tag:{pattern:/<\/?[\w:-]+\s*(?:\s+[\w:-]+(?:=(?:("|')(\\?[\w\W])*?\1|[^\s'">=]+))?\s*)*\/?>/gi,inside:{tag:{pattern:/^<\/?[\w:-]+/i,inside:{punctuation:/^<\/?/,namespace:/^[\w-]+?:/}},"attr-value":{pattern:/=(?:('|")[\w\W]*?(\1)|[^\s>]+)/gi,inside:{punctuation:/=|>|"/g}},punctuation:/\/?>/g,"attr-name":{pattern:/[\w:-]+/g,inside:{namespace:/^[\w-]+?:/}}}},entity:/\?[\da-z]{1,8};/gi};Prism.hooks.add("wrap",function(e){e.type==="entity"&&(e.attributes.title=e.content.replace(/&/,"&"))});Prism.languages.css={comment:/\/\*[\w\W]*?\*\//g,atrule:{pattern:/@[\w-]+?.*?(;|(?=\s*{))/gi,inside:{punctuation:/[;:]/g}},url:/url\((["']?).*?\1\)/gi,selector:/[^\{\}\s][^\{\};]*(?=\s*\{)/g,property:/(\b|\B)[\w-]+(?=\s*:)/gi,string:/("|')(\\?.)*?\1/g,important:/\B!important\b/gi,punctuation:/[\{\};:]/g,"function":/[-a-z0-9]+(?=\()/gi};Prism.languages.markup&&Prism.languages.insertBefore("markup","tag",{style:{pattern:/