docks_theme_api 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (237) hide show
  1. checksums.yaml +15 -0
  2. data/.babelrc +4 -0
  3. data/.editorconfig +8 -0
  4. data/.eslintrc +115 -0
  5. data/.gitignore +24 -0
  6. data/.rubocop.yml +20 -0
  7. data/.travis.yml +16 -0
  8. data/Gemfile +4 -0
  9. data/README.md +5 -0
  10. data/Rakefile +3 -0
  11. data/assets/images/icons.svg +63 -0
  12. data/assets/scripts/coffeescript/pattern_library_helpers.coffee +8 -0
  13. data/assets/scripts/javascript/pattern_library_helpers.js +11 -0
  14. data/assets/scripts/pattern_library.js +10380 -0
  15. data/assets/scripts/pattern_library_demo.js +0 -0
  16. data/assets/styles/less/pattern-library-helpers.less +103 -0
  17. data/assets/styles/pattern-library-demo.css +1882 -0
  18. data/assets/styles/pattern-library.css +1882 -0
  19. data/assets/styles/sass/pattern-library-helpers.sass +90 -0
  20. data/assets/styles/scss/pattern-library-helpers.scss +99 -0
  21. data/assets/styles/stylus/pattern-library-helpers.styl +90 -0
  22. data/assets/templates/erb/demo.erb +26 -0
  23. data/assets/templates/erb/layouts/demo.erb +17 -0
  24. data/assets/templates/erb/layouts/pattern.erb +76 -0
  25. data/assets/templates/erb/partials/sidebar.erb +124 -0
  26. data/assets/templates/erb/partials/symbols/class.erb +1 -0
  27. data/assets/templates/erb/partials/symbols/demo.erb +40 -0
  28. data/assets/templates/erb/partials/symbols/factory.erb +70 -0
  29. data/assets/templates/erb/partials/symbols/function.erb +103 -0
  30. data/assets/templates/erb/partials/symbols/mixin.erb +62 -0
  31. data/assets/templates/erb/partials/symbols/variable.erb +59 -0
  32. data/assets/templates/erb/pattern.erb +102 -0
  33. data/assets/templates/haml/demo.haml +14 -0
  34. data/assets/templates/haml/layouts/demo.haml +6 -0
  35. data/assets/templates/haml/layouts/pattern.haml +38 -0
  36. data/assets/templates/haml/partials/sidebar.haml +68 -0
  37. data/assets/templates/haml/partials/symbols/class.haml +1 -0
  38. data/assets/templates/haml/partials/symbols/demo.haml +23 -0
  39. data/assets/templates/haml/partials/symbols/factory.haml +38 -0
  40. data/assets/templates/haml/partials/symbols/function.haml +54 -0
  41. data/assets/templates/haml/partials/symbols/mixin.haml +31 -0
  42. data/assets/templates/haml/partials/symbols/variable.haml +22 -0
  43. data/assets/templates/haml/pattern.haml +54 -0
  44. data/assets/templates/slim/demo.slim +24 -0
  45. data/assets/templates/slim/layouts/demo.slim +5 -0
  46. data/assets/templates/slim/layouts/pattern.slim +48 -0
  47. data/assets/templates/slim/partials/sidebar.slim +112 -0
  48. data/assets/templates/slim/partials/symbols/class.slim +1 -0
  49. data/assets/templates/slim/partials/symbols/demo.slim +30 -0
  50. data/assets/templates/slim/partials/symbols/factory.slim +57 -0
  51. data/assets/templates/slim/partials/symbols/function.slim +81 -0
  52. data/assets/templates/slim/partials/symbols/mixin.slim +45 -0
  53. data/assets/templates/slim/partials/symbols/variable.slim +35 -0
  54. data/assets/templates/slim/pattern.slim +63 -0
  55. data/docks_config.rb +32 -0
  56. data/docks_theme_api.gemspec +37 -0
  57. data/gulpfile.js +88 -0
  58. data/karma.conf.js +6 -0
  59. data/lib/docks_theme_api/components/base_component.rb +99 -0
  60. data/lib/docks_theme_api/components/code_block_component.rb +10 -0
  61. data/lib/docks_theme_api/components/popover_component.rb +15 -0
  62. data/lib/docks_theme_api/components/table_component.rb +34 -0
  63. data/lib/docks_theme_api/components/tablist_component.rb +11 -0
  64. data/lib/docks_theme_api/components.rb +21 -0
  65. data/lib/docks_theme_api/helpers/ui_helper.rb +69 -0
  66. data/lib/docks_theme_api/theme.rb +21 -0
  67. data/lib/docks_theme_api.rb +1 -0
  68. data/package.json +60 -0
  69. data/source/behaviors/filterable/filterable.coffee +353 -0
  70. data/source/behaviors/filterable/filterable.js +0 -0
  71. data/source/behaviors/filterable/filterable.scss +34 -0
  72. data/source/behaviors/filterable/package.json +3 -0
  73. data/source/behaviors/index.js +0 -0
  74. data/source/components/avatar/avatar.erb +20 -0
  75. data/source/components/avatar/avatar.js +142 -0
  76. data/source/components/avatar/avatar.scss +200 -0
  77. data/source/components/avatar/avatar_container.erb +13 -0
  78. data/source/components/avatar/package.json +3 -0
  79. data/source/components/avatar/spec/avatar_spec.js +81 -0
  80. data/source/components/badge/badge.scss +158 -0
  81. data/source/components/button/button.scss +213 -0
  82. data/source/components/card/card.scss +32 -0
  83. data/source/components/code_block/code-block.scss +353 -0
  84. data/source/components/code_block/code_block.erb +95 -0
  85. data/source/components/code_block/code_block.js +444 -0
  86. data/source/components/code_block/package.json +3 -0
  87. data/source/components/code_block/spec/code_block_spec.js +10 -0
  88. data/source/components/demo/demo.js +244 -0
  89. data/source/components/demo/demo.scss +90 -0
  90. data/source/components/demo/package.json +3 -0
  91. data/source/components/exploded/exploded.erb +25 -0
  92. data/source/components/exploded/exploded.js +694 -0
  93. data/source/components/exploded/exploded.scss +166 -0
  94. data/source/components/exploded/package.json +3 -0
  95. data/source/components/field/field.js +24 -0
  96. data/source/components/field/field.scss +101 -0
  97. data/source/components/field/package.json +3 -0
  98. data/source/components/header/header.scss +33 -0
  99. data/source/components/iframe/iframe.erb +12 -0
  100. data/source/components/iframe/iframe.js +381 -0
  101. data/source/components/iframe/package.json +3 -0
  102. data/source/components/index.js +37 -0
  103. data/source/components/inline_group/inline-group.scss +14 -0
  104. data/source/components/internal_link/internal_link.js +49 -0
  105. data/source/components/internal_link/package.json +3 -0
  106. data/source/components/list/list.scss +230 -0
  107. data/source/components/modal/modal.coffee +84 -0
  108. data/source/components/modal/modal.erb +19 -0
  109. data/source/components/modal/modal.js +0 -0
  110. data/source/components/modal/modal.scss +57 -0
  111. data/source/components/modal/package.json +3 -0
  112. data/source/components/notice/notice.scss +48 -0
  113. data/source/components/popover/package.json +3 -0
  114. data/source/components/popover/popover.coffee +562 -0
  115. data/source/components/popover/popover.erb +21 -0
  116. data/source/components/popover/popover.js +0 -0
  117. data/source/components/popover/popover.scss +139 -0
  118. data/source/components/range/range.scss +78 -0
  119. data/source/components/resizable/package.json +3 -0
  120. data/source/components/resizable/resizable.erb +30 -0
  121. data/source/components/resizable/resizable.js +250 -0
  122. data/source/components/resizable/resizable.scss +245 -0
  123. data/source/components/resizable/size_buttons.js +249 -0
  124. data/source/components/scroll_container/package.json +3 -0
  125. data/source/components/scroll_container/scroll-container.scss +4 -0
  126. data/source/components/scroll_container/scroll_container.js +24 -0
  127. data/source/components/section/section.scss +99 -0
  128. data/source/components/select/package.json +3 -0
  129. data/source/components/select/select.erb +21 -0
  130. data/source/components/select/select.js +35 -0
  131. data/source/components/select/select.scss +163 -0
  132. data/source/components/table/package.json +3 -0
  133. data/source/components/table/table.erb +16 -0
  134. data/source/components/table/table.js +351 -0
  135. data/source/components/table/table.scss +236 -0
  136. data/source/components/tablist/package.json +3 -0
  137. data/source/components/tablist/tablist.erb +13 -0
  138. data/source/components/tablist/tablist.js +246 -0
  139. data/source/components/tablist/tablist.scss +191 -0
  140. data/source/components/tablist/tablist_panel.erb +14 -0
  141. data/source/components/tablist/tablist_tab.erb +20 -0
  142. data/source/components/toggle/package.json +3 -0
  143. data/source/components/toggle/toggle.erb +11 -0
  144. data/source/components/toggle/toggle.js +211 -0
  145. data/source/components/toggle/toggle_container.erb +30 -0
  146. data/source/components/vertical_spacer/vertical-spacer.scss +3 -0
  147. data/source/components/vertical_stack/vertical-stack.scss +19 -0
  148. data/source/components/xray/package.json +3 -0
  149. data/source/components/xray/xray.erb +50 -0
  150. data/source/components/xray/xray.js +123 -0
  151. data/source/components/xray/xray.scss +79 -0
  152. data/source/foundation/app/app.js +15 -0
  153. data/source/foundation/app/package.json +3 -0
  154. data/source/pattern-library-demo.scss +13 -0
  155. data/source/pattern-library.scss +13 -0
  156. data/source/pattern_library.js +8 -0
  157. data/source/pattern_library_demo.js +8 -0
  158. data/source/structures/index.js +11 -0
  159. data/source/structures/sidebar/package.json +3 -0
  160. data/source/structures/sidebar/sidebar.js +69 -0
  161. data/source/structures/sidebar/sidebar.scss +79 -0
  162. data/source/utilities/builder/builder.js +138 -0
  163. data/source/utilities/builder/package.json +3 -0
  164. data/source/utilities/client/client.js +7 -0
  165. data/source/utilities/client/package.json +3 -0
  166. data/source/utilities/colors/colors.scss +112 -0
  167. data/source/utilities/defaults/defaults.scss +38 -0
  168. data/source/utilities/dom_cache/dom_cache.js +24 -0
  169. data/source/utilities/dom_cache/package.json +3 -0
  170. data/source/utilities/events/events.js +25 -0
  171. data/source/utilities/events/package.json +3 -0
  172. data/source/utilities/font_sizes/font-sizes.scss +85 -0
  173. data/source/utilities/foundation/a11y.scss +10 -0
  174. data/source/utilities/foundation/base.scss +29 -0
  175. data/source/utilities/foundation/icon.scss +114 -0
  176. data/source/utilities/foundation/layout.scss +67 -0
  177. data/source/utilities/foundation/page.scss +39 -0
  178. data/source/utilities/foundation/type.scss +208 -0
  179. data/source/utilities/functions/functions.scss +127 -0
  180. data/source/utilities/keycodes/keycodes.js +23 -0
  181. data/source/utilities/keycodes/package.json +3 -0
  182. data/source/utilities/markup/markup.js +90 -0
  183. data/source/utilities/markup/package.json +3 -0
  184. data/source/utilities/media/media.scss +172 -0
  185. data/source/utilities/mixins/mixins.scss +89 -0
  186. data/source/utilities/naming_convention/naming_convention.js +3 -0
  187. data/source/utilities/naming_convention/package.json +3 -0
  188. data/source/utilities/numbers/numbers.js +14 -0
  189. data/source/utilities/numbers/package.json +3 -0
  190. data/source/utilities/painting/package.json +3 -0
  191. data/source/utilities/painting/painting.js +7 -0
  192. data/source/utilities/pattern/package.json +3 -0
  193. data/source/utilities/pattern/pattern.js +50 -0
  194. data/source/utilities/query_string/package.json +3 -0
  195. data/source/utilities/query_string/query_string.js +24 -0
  196. data/source/utilities/template/package.json +3 -0
  197. data/source/utilities/template/template.js +10 -0
  198. data/source/utilities/text_range/package.json +3 -0
  199. data/source/utilities/text_range/text_range.js +30 -0
  200. data/source/utilities/ui_events/package.json +3 -0
  201. data/source/utilities/ui_events/ui_events.js +85 -0
  202. data/source/utilities/variables/variables.scss +18 -0
  203. data/source/utilities/z_indexes/z-indexes.scss +88 -0
  204. data/source/vendor/array_includes.js +28 -0
  205. data/source/vendor/highlight.js +1142 -0
  206. data/source/vendor/index.js +1 -0
  207. data/source/vendor/matrix.js +399 -0
  208. data/source/vendor/query_string.js +66 -0
  209. data/spec/assets/.eslintrc +9 -0
  210. data/spec/assets/spec_fixture.js +33 -0
  211. data/spec/assets/spec_helper.js +19 -0
  212. data/spec/lib/components/base_component_spec.rb +156 -0
  213. data/spec/lib/components_spec.rb +30 -0
  214. data/spec/lib/helpers/ui_helper_spec.rb +62 -0
  215. data/spec/lib/theme_spec.rb +25 -0
  216. data/spec/spec_helper.rb +15 -0
  217. data/tasks/gulp/.eslintrc +6 -0
  218. data/tasks/gulp/browser_sync.js +8 -0
  219. data/tasks/gulp/code_quality/scripts.js +10 -0
  220. data/tasks/gulp/config/index.js +116 -0
  221. data/tasks/gulp/minify/scripts.js +13 -0
  222. data/tasks/gulp/minify/styles.js +13 -0
  223. data/tasks/gulp/pattern_library/index.js +5 -0
  224. data/tasks/gulp/pattern_library/scripts.js +10 -0
  225. data/tasks/gulp/pattern_library/styles.js +10 -0
  226. data/tasks/gulp/scripts.js +8 -0
  227. data/tasks/gulp/spec/scripts.js +11 -0
  228. data/tasks/gulp/styles.js +17 -0
  229. data/tasks/gulp/utilities/babel/relative_require.js +22 -0
  230. data/tasks/gulp/utilities/babel/spec_helper.js +20 -0
  231. data/tasks/gulp/utilities/browserify_bundler.js +22 -0
  232. data/tasks/gulp/utilities/handle_errors.js +13 -0
  233. data/tasks/gulp/watch.js +9 -0
  234. data/tasks/rake/rspec.rake +7 -0
  235. data/tasks/rake/rubocop.rake +8 -0
  236. data/tasks/rake/templates.rake +50 -0
  237. metadata +470 -0
@@ -0,0 +1,114 @@
1
+ @mixin icon--recolor($color, $variant: base) {
2
+ fill: ui-color($color, $variant);
3
+ stroke: ui-color($color, $variant);
4
+ }
5
+
6
+
7
+ .icon {
8
+ display: inline-block;
9
+ stroke-width: 2;
10
+ }
11
+
12
+ $icon--size-medium: rem(24);
13
+ $icon--size-large: rem(28);
14
+
15
+ .icon--medium {
16
+ height: $icon--size-medium;
17
+ width: $icon--size-medium;
18
+ }
19
+
20
+ .icon--large {
21
+ height: $icon--size-large;
22
+ width: $icon--size-large;
23
+ }
24
+
25
+
26
+ $icon-action--size: 1.65rem;
27
+
28
+ .icon--action {
29
+ height: $icon-action--size;
30
+ width: $icon-action--size;
31
+ }
32
+
33
+ $icon-hamburger--width: 2rem;
34
+ $icon-hamburger--slice-height: 4px;
35
+
36
+ .icon--hamburger {
37
+ height: $icon-action--size;
38
+ width: $icon-hamburger--width;
39
+ position: relative;
40
+ cursor: pointer;
41
+ opacity: 0.6;
42
+ top: 0.2em;
43
+ transition: opacity 0.2s ease;
44
+
45
+ &:hover {
46
+ opacity: 1;
47
+ }
48
+
49
+ &:before,
50
+ &:after {
51
+ content: "";
52
+ display: block;
53
+ position: absolute;
54
+ height: $icon-hamburger--slice-height;
55
+ width: 100%;
56
+ border-radius: ($icon-hamburger--slice-height / 2);
57
+ background: ui-color(gray, darkest);
58
+ }
59
+
60
+ &:before { top: 0; }
61
+ &:after { bottom: 0; }
62
+ }
63
+
64
+ .icon--hamburger__slice {
65
+ height: $icon-hamburger--slice-height;
66
+ width: 100%;
67
+ border-radius: ($icon-hamburger--slice-height / 2);
68
+ background: ui-color(gray, darkest);
69
+ position: absolute;
70
+ top: 50%; left: 0;
71
+ margin-top: (-0.5 * $icon-hamburger--slice-height);
72
+ }
73
+
74
+ .icon--gray-darker {
75
+ @include icon--recolor(gray, darker);
76
+ }
77
+
78
+ .icon--close {
79
+ position: relative;
80
+ opacity: 0.6;
81
+ transition: opacity 0.2s ease;
82
+ cursor: pointer;
83
+
84
+ &:hover {
85
+ opacity: 1;
86
+ }
87
+
88
+ &:before,
89
+ &:after {
90
+ content: "";
91
+ display: block;
92
+ position: absolute;
93
+ height: $icon-hamburger--slice-height;
94
+ width: 140%;
95
+ border-radius: ($icon-hamburger--slice-height / 2);
96
+ background: ui-color(gray, darkest);
97
+ top: 50%;
98
+ left: 50%;
99
+ margin-left: -70%;
100
+ margin-top: ($icon-hamburger--slice-height / -2);
101
+ }
102
+
103
+ &:before { transform: rotate(45deg); }
104
+ &:after { transform: rotate(-45deg); }
105
+ }
106
+
107
+ .icon--disclosure {
108
+ height: half(default(spacing));
109
+ width: half(default(spacing));
110
+ transform: rotate(45deg) translateY(-50%);
111
+ border-right: 2px solid ui-color(gray, darkest);
112
+ border-bottom: 2px solid ui-color(gray, darkest);
113
+ margin-left: quarter(default(spacing));
114
+ }
@@ -0,0 +1,67 @@
1
+ // ___ ___ ___
2
+ // / /\ ___ / /\ /__/\ ___
3
+ // / /::\ /__/| / /::\ \ \:\ / /\
4
+ // ___ ___ / /:/\:\ | |:| / /:/\:\ \ \:\ / /:/
5
+ // /__/\ / /\/ /:/~/::\ | |:|/ /:/ \:\ ___ \ \:\ / /:/
6
+ // \ \:\ / /:/__/:/ /:/\:\__|__|:/__/:/ \__\:\/__/\ \__\:\/ /::\
7
+ // \ \:\ /:/\ \:\/:/__\/__/::::\ \:\ / /:/\ \:\ / /:/__/:/\:\
8
+ // \ \:\/:/ \ \::/ ~\~~\:\ \:\ /:/ \ \:\ /:/\__\/ \:\
9
+ // \ \::/ \ \:\ \ \:\ \:\/:/ \ \:\/:/ \ \:\
10
+ // \__\/ \ \:\ \__\/\ \::/ \ \::/ \__\/
11
+ // \__\/ \__\/ \__\/
12
+
13
+ .grid {
14
+ display: flex;
15
+ }
16
+
17
+ .grid--vertically-centered {
18
+ align-items: center;
19
+ }
20
+
21
+ .grid--align-right {
22
+ justify-content: flex-end;
23
+ }
24
+
25
+ .grid--outside-spacing {
26
+ margin: default(spacing) 0;
27
+ padding: 0 default(spacing);
28
+ }
29
+
30
+ .grid--space-between {
31
+ justify-content: space-between;
32
+
33
+ > .grid__item {
34
+ flex: 0 1 auto;
35
+ }
36
+ }
37
+
38
+ .grid__item {
39
+ padding: 0 (default(spacing) / 2);
40
+ flex: 1 1 0%;
41
+ display: flex;
42
+ align-items: center;
43
+
44
+ &:first-child { padding-left: 0; }
45
+ &:last-child { padding-right: 0; }
46
+ }
47
+
48
+ .grid__item--no-flex {
49
+ flex: 0 0 auto;
50
+ }
51
+
52
+ .grid__item--half {
53
+ flex: 0 0 50%;
54
+ }
55
+
56
+
57
+
58
+
59
+
60
+ .content {
61
+ padding: 0 default(spacing);
62
+ margin: default(spacing) 0;
63
+ }
64
+
65
+ .content--extra-vertical-spacing {
66
+ margin: multiply(default(spacing), 3) 0;
67
+ }
@@ -0,0 +1,39 @@
1
+ $context: z-index-stacking-context(global,
2
+ (
3
+ content: 10,
4
+ sidebar: 20
5
+ )
6
+ );
7
+
8
+ body {
9
+ background-color: ui-color(gray);
10
+ }
11
+
12
+ .page {
13
+ height: 100vh;
14
+ max-height: 100vh;
15
+ display: flex;
16
+ }
17
+
18
+ .page__content,
19
+ .page__sidebar {
20
+ position: relative;
21
+ }
22
+
23
+ .page__content {
24
+ width: 100%;
25
+ max-width: 100%;
26
+ display: flex;
27
+ flex: 1 1 0px;
28
+ @include z-index(content, global);
29
+ background: color(white);
30
+
31
+ > * {
32
+ flex: 0 0 100%;
33
+ }
34
+ }
35
+
36
+ .page__sidebar {
37
+ @include z-index(sidebar, global);
38
+ flex: 0 0 auto;
39
+ }
@@ -0,0 +1,208 @@
1
+ // ___ ___ ___ ___
2
+ // / /\ / /\ /__/\ ___ / /\
3
+ // / /:/_ / /::\ \ \:\ / /\ / /:/_
4
+ // / /:/ /\/ /:/\:\ \ \:\ / /:/ / /:/ /\
5
+ // / /:/ /:/ /:/ \:\ _____\__\:\ / /:/ / /:/ /::\
6
+ // /__/:/ /:/__/:/ \__\:\/__/::::::::\/ /::\/__/:/ /:/\:\
7
+ // \ \:\/:/\ \:\ / /:/\ \:\~~\~~\/__/:/\:\ \:\/:/~/:/
8
+ // \ \::/ \ \:\ /:/ \ \:\ ~~~\__\/ \:\ \::/ /:/
9
+ // \ \:\ \ \:\/:/ \ \:\ \ \:\__\/ /:/
10
+ // \ \:\ \ \::/ \ \:\ \__\/ /__/:/
11
+ // \__\/ \__\/ \__\/ \__\/
12
+
13
+ @mixin type--default-font-family {
14
+ font-family: Source Sans Pro, Helvetica Neue, Helvetica, Arial, sans-serif;
15
+ }
16
+
17
+ @mixin type--monospace-font-family {
18
+ font-family: Consolas, monospace;
19
+ }
20
+
21
+ body {
22
+ text-size-adjust: 100%;
23
+ color: color(slate);
24
+ @include type--default-font-family;
25
+ }
26
+
27
+ button,
28
+ input {
29
+ @include type--default-font-family;
30
+ }
31
+
32
+
33
+
34
+
35
+ h1, h2, h3, h4, h5, h6, p, .type {
36
+ margin: 0;
37
+ font-size: inherit;
38
+ }
39
+
40
+ @mixin type--heading-1 {
41
+ font-weight: 400;
42
+ line-height: 1;
43
+ color: ui-color(gray, darkest);
44
+ @include font-size(heading-1);
45
+ }
46
+
47
+ @mixin type--heading-2 {
48
+ font-weight: 400;
49
+ color: ui-color(gray, darkest);
50
+ @include font-size(heading-2);
51
+ }
52
+
53
+ @mixin type--heading-3 {
54
+ font-weight: 400;
55
+ line-height: 1;
56
+ color: ui-color(gray, darkest);
57
+ @include font-size(heading-3);
58
+ }
59
+
60
+ @mixin type--heading-4 {
61
+ margin: default(spacing) auto half(default(spacing));
62
+ font-weight: 600;
63
+ text-transform: uppercase;
64
+ color: ui-color(gray, dark);
65
+ @include font-size(heading-4);
66
+ }
67
+
68
+ @mixin type--heading-5 {
69
+ margin: default(spacing) auto half(default(spacing));
70
+ font-weight: 400;
71
+ color: ui-color(gray, darkest);
72
+ @include font-size(heading-5);
73
+ }
74
+
75
+ @mixin type--paragraph {
76
+ @include font-size(paragraph);
77
+ @include default(line-height);
78
+ font-weight: 300;
79
+ color: ui-color(black);
80
+
81
+ + p {
82
+ margin-top: (0.75 * default(spacing));
83
+ }
84
+
85
+ > a {
86
+ display: inline-block;
87
+ text-decoration: none;
88
+ color: ui-color(blue, darker);
89
+ font-weight: normal;
90
+
91
+ > span {
92
+ border-bottom: 2px solid ui-color(blue, dark);
93
+ }
94
+
95
+ > code {
96
+ color: ui-color(blue, darker);
97
+ background-color: mix(ui-color(gray, light), ui-color(blue), 80%);
98
+ border-color: rgba(ui-color(blue, darker), 0.15);
99
+ }
100
+ }
101
+
102
+ code {
103
+ @include type--monospace-font-family;
104
+ display: inline-block;
105
+ padding: 0.05em 0.25em;
106
+ font-size: 0.8em;
107
+ background-color: ui-color(gray, light);
108
+ color: ui-color(gray, darkest);
109
+ border: 1px solid ui-color(gray);
110
+ @include default(border-radius);
111
+ }
112
+ }
113
+
114
+ @mixin type--paragraph-small {
115
+ @include font-size(paragraph-small);
116
+ }
117
+
118
+ @mixin type--after-paragraph {
119
+ .type--paragraph + &,
120
+ .user-type + & {
121
+ @content;
122
+ }
123
+ }
124
+
125
+
126
+
127
+ .type--heading-1 { @include type--heading-1; }
128
+ .type--heading-2 { @include type--heading-2; }
129
+ .type--heading-3 { @include type--heading-3; }
130
+ .type--heading-4 {
131
+ @include type--heading-4;
132
+ }
133
+
134
+ .type--heading-5 {
135
+ @include type--heading-5;
136
+
137
+ .type--heading-4 + & {
138
+ margin-top: half(default(spacing));
139
+ }
140
+
141
+ @include type--after-paragraph {
142
+ margin-top: (1.5 * default(spacing));
143
+ }
144
+ }
145
+
146
+ .type--heading-bordered {
147
+ padding-bottom: default(spacing);
148
+ margin-bottom: multiply(default(spacing), 1.3);
149
+ border-bottom: 2px solid ui-color(gray);
150
+
151
+ + .section {
152
+ margin-top: negative(default(spacing));
153
+ }
154
+ }
155
+
156
+ .type--paragraph { @include type--paragraph; }
157
+ .type--paragraph-small { @include type--paragraph-small; }
158
+
159
+ .type-container {
160
+ h1 { @include type--heading-1; }
161
+ h2 { @include type--heading-2; }
162
+ h3 { @include type--heading-3; }
163
+ h4 { @include type--heading-4; }
164
+ h5 { @include type--heading-5; }
165
+
166
+ p { @include type--paragraph; }
167
+ }
168
+
169
+ .type-container--small {
170
+ p { @include type--paragraph-small; }
171
+ }
172
+
173
+
174
+
175
+ .type--display {
176
+ font-size: 1.3rem;
177
+ margin-top: 0;
178
+ font-weight: 500;
179
+ line-height: 1;
180
+ }
181
+
182
+ .type--margin-bottom {
183
+ margin-bottom: default(spacing);
184
+ }
185
+
186
+ .type--subdued {
187
+ color: ui-color(gray, dark);
188
+ }
189
+
190
+
191
+
192
+
193
+
194
+
195
+
196
+
197
+
198
+
199
+
200
+ .type--code {
201
+ @include type--monospace-font-family;
202
+ font-size: 0.95em;
203
+ word-wrap: break-word;
204
+ }
205
+
206
+ ::selection {
207
+ background: ui-color(blue);
208
+ }
@@ -0,0 +1,127 @@
1
+ // ___ ___ ___ ___ ___
2
+ // / /\ /__/\ /__/\ / /\ / /\
3
+ // / /:/_ \ \:\ \ \:\ / /:/ / /:/_
4
+ // / /:/ /\ \ \:\ \ \:\ / /:/ / /:/ /\
5
+ // / /:/ /:/__ \ \:\ _____\__\:\ / /:/ ___ / /:/ /::\
6
+ // /__/:/ /:/__/\ \__\:\/__/::::::::\/__/:/ / /\/__/:/ /:/\:\
7
+ // \ \:\/:/\ \:\ / /:/\ \:\~~\~~\/\ \:\ / /:/\ \:\/:/~/:/
8
+ // \ \::/ \ \:\ /:/ \ \:\ ~~~ \ \:\ /:/ \ \::/ /:/
9
+ // \ \:\ \ \:\/:/ \ \:\ \ \:\/:/ \__\/ /:/
10
+ // \ \:\ \ \::/ \ \:\ \ \::/ /__/:/
11
+ // \__\/ \__\/ \__\/ \__\/ \__\/
12
+ //
13
+ //*
14
+ // @pattern Functions
15
+ // @group Helper
16
+ // @author Chris Sauve (github: lemonmade)
17
+ //
18
+ // Functions simply return a value: they don't actually add a any styles to
19
+ // the compiled stylesheet. Use these to provide solutions to common calculations
20
+ // or Sass operations.
21
+
22
+
23
+
24
+ //*
25
+ // Removes the units from a number.
26
+ //
27
+ // @deprecated 2.1.0
28
+ // @private
29
+ //
30
+ // @param {Number} $value - The number (usually a measurement) that you would
31
+ // like to remove units from.
32
+ // @returns {Number}
33
+ //
34
+ // @example
35
+ // $foo: strip-units(4rem); // => 4
36
+ // $bar: strip-units(30%); // => 30
37
+
38
+ @function strip-units($value) {
39
+ @return ($value / ($value*0 + 1));
40
+ }
41
+
42
+ //*
43
+ // Converts the passed value (assumed to be in pixels) to the corresponding `rem`
44
+ // value. This conversion assumes a base font size of `16px`.
45
+ //
46
+ // @param {Number} $value - The pixel value to convert.
47
+ // @returns {Number}
48
+
49
+ @function rem($value) {
50
+ @return (strip-units($value) / 16 * 1rem);
51
+ }
52
+
53
+ //*
54
+ // Halves a given measurement.
55
+ //
56
+ // @param {Number} $measurement - The measurement to halve.
57
+ // @returns {Number}
58
+ // @alias half
59
+ //
60
+ // @example
61
+ // $foo: halve(4rem); // => 2rem
62
+ // $bar: half(36); // => 18
63
+
64
+ @function halve($measurement) {
65
+ @return ($measurement / 2);
66
+ }
67
+
68
+ @function half($measurement) {
69
+ @return halve($measurement);
70
+ }
71
+
72
+ //*
73
+ // Quarters a given measurement.
74
+ //
75
+ // @param {Number} $measurement - The measurement to quarter.
76
+ // @returns {Number}
77
+ //
78
+ // @example
79
+ // $foo: quarter(4rem); // => 1rem
80
+
81
+ @function quarter($measurement) {
82
+ @return ($measurement / 4);
83
+ }
84
+
85
+ //*
86
+ // Doubles a given measurement.
87
+ //
88
+ // @param {Number} $measurement - The measurement to double.
89
+ // @returns {Number}
90
+ //
91
+ // @example
92
+ // $foo: double(4rem); // => 8rem
93
+
94
+ @function double($measurement) {
95
+ @return ($measurement * 2);
96
+ }
97
+
98
+ //*
99
+ // Negates a given measurement.
100
+ //
101
+ // @param {Number} $measurement - The measurement to negate.
102
+ // @returns {Number}
103
+ //
104
+ // @example
105
+ // $foo: negative(4rem); // => -4rem
106
+ // $bar: negative(-4rem); // => 4rem
107
+
108
+ @function negative($measurement) {
109
+ @return ($measurement * -1);
110
+ }
111
+
112
+ //*
113
+ // Multiples a given measurement by the provided factor. Use this in those
114
+ // (rare) instances where you need a factor that is not `2`, `0.5`, `0.25`, or
115
+ // `-1` (in which case, use the relevant multiplication function directly).
116
+ //
117
+ // @param {Number} $measurement - The measurement to multiple.
118
+ // @param {Number} $factor - The multiplication factor.
119
+ // @returns {Number}
120
+ //
121
+ // @example
122
+ // $foo: multiply(4rem, 3); // => 12rem
123
+ // $bar: multiply(4rem, 2); // => 8rem BUT don't do this — use double(4rem) instead
124
+
125
+ @function multiply($measurement, $factor) {
126
+ @return ($measurement * $factor);
127
+ }
@@ -0,0 +1,23 @@
1
+ const Keycodes = {
2
+ LEFT: 37,
3
+ UP: 38,
4
+ RIGHT: 39,
5
+ DOWN: 40,
6
+ ENTER: 13,
7
+ SPACE: 32,
8
+
9
+ get ARROWS() {
10
+ return [this.LEFT, this.RIGHT, this.UP, this.DOWN];
11
+ },
12
+ get NEXT() {
13
+ return [this.RIGHT, this.DOWN];
14
+ },
15
+ get PREVIOUS() {
16
+ return [this.LEFT, this.UP];
17
+ },
18
+ get ACTIVATE() {
19
+ return [this.SPACE, this.ENTER];
20
+ }
21
+ };
22
+
23
+ export default Keycodes;
@@ -0,0 +1,3 @@
1
+ {
2
+ "main": "package.json"
3
+ }
@@ -0,0 +1,90 @@
1
+ // ___ ___ ___ ___ ___ ___
2
+ // /__/\ / /\ / /\ /__/| /__/\ / /\
3
+ // | |::\ / /::\ / /::\ | |:| \ \:\ / /::\
4
+ // | |:|:\ / /:/\:\ / /:/\:\ | |:| \ \:\ / /:/\:\
5
+ // __|__|:|\:\ / /:/~/::\ / /:/~/:/ __| |:| ___ \ \:\ / /:/~/:/
6
+ // /__/::::| \:\/__/:/ /:/\:\/__/:/ /:/___/__/\_|:|____/__/\ \__\:\/__/:/ /:/
7
+ // \ \:\~~\__\/\ \:\/:/__\/\ \:\/:::::/\ \:\/:::::/\ \:\ / /:/\ \:\/:/
8
+ // \ \:\ \ \::/ \ \::/~~~~ \ \::/~~~~ \ \:\ /:/ \ \::/
9
+ // \ \:\ \ \:\ \ \:\ \ \:\ \ \:\/:/ \ \:\
10
+ // \ \:\ \ \:\ \ \:\ \ \:\ \ \::/ \ \:\
11
+ // \__\/ \__\/ \__\/ \__\/ \__\/ \__\/
12
+
13
+ import hljs from "../../vendor/highlight";
14
+
15
+ const [start_tag_test, end_tag_test, contains_end_tag] = [/^<[^\/]/, /^<\//, /<\//];
16
+
17
+ //*
18
+ // The size of manually re-indented code.
19
+ //
20
+ // @private
21
+ // @type Number
22
+ // @value 2
23
+
24
+ const INDENTATION_SIZE = 2;
25
+
26
+ var decode_html_entities, indent, clean, highlight;
27
+
28
+ decode_html_entities = (string) => {
29
+ var element = document.createElement("div");
30
+ element.innerHTML = string.trim();
31
+
32
+ return element.childNodes.length === 0 ? "" : (element.childNodes[0].nodeValue || element.innerHTML);
33
+ };
34
+
35
+ //*
36
+ // Indents HTML markup by finding opening and closing HTML tags.
37
+ //
38
+ // @param {String} code - The randomly-escaped HTML string.
39
+ // @returns {String} The indented string.
40
+
41
+ indent = (markup) => {
42
+ var indent_count = -INDENTATION_SIZE,
43
+ indented_markup = [],
44
+ markup_lines = markup.split("\n"),
45
+ markup_line,
46
+ start_tag,
47
+ end_tag;
48
+
49
+ for(markup_line of markup_lines) {
50
+ markup_line = markup_line.trim();
51
+ [start_tag, end_tag] = [start_tag_test.test(markup_line), end_tag_test.test(markup_line)];
52
+
53
+ if(start_tag) { indent_count += INDENTATION_SIZE; }
54
+ indent_count = Math.max(indent_count, 0);
55
+
56
+ if(indent_count > 0) {
57
+ markup_line = `${Array(indent_count + 1).join(" ")}${markup_line}`;
58
+ }
59
+
60
+ indented_markup.push(markup_line);
61
+ if(end_tag) { indent_count -= INDENTATION_SIZE; }
62
+ if(!end_tag && contains_end_tag.test(markup_line)) { indent_count -= INDENTATION_SIZE; }
63
+ }
64
+
65
+ return indented_markup.join("\n");
66
+ };
67
+
68
+ clean = (code, options = {}) => {
69
+ var leading_spaces;
70
+
71
+ if(!code) { return ""; }
72
+
73
+ code = decode_html_entities(code);
74
+ code = code.trim();
75
+ if(options.collapse_newlines) { code = code.replace(/\n^\s*\n/mg, "\n"); }
76
+
77
+ // Kills any leading spaces from each line
78
+ leading_spaces = code.match(/^\s*/);
79
+ if(leading_spaces) {
80
+ code = code.replace(new RegExp(`^\\s{${leading_spaces[0].length}}`, "gm"), "");
81
+ }
82
+
83
+ return code;
84
+ };
85
+
86
+ highlight = (code, options = {}) => {
87
+ return hljs.highlight(options.language_code || "html", code).value;
88
+ };
89
+
90
+ export { decode_html_entities, indent, clean, highlight };
@@ -0,0 +1,3 @@
1
+ {
2
+ "main": "markup.js"
3
+ }