reustyle 2.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (358) hide show
  1. checksums.yaml +7 -0
  2. data/.drone.yml +17 -0
  3. data/.gitignore +25 -0
  4. data/.nvmrc +1 -0
  5. data/.rbenv-gemsets +1 -0
  6. data/.ruby-version +1 -0
  7. data/CONTRIBUTING.md +68 -0
  8. data/Gemfile +4 -0
  9. data/Gruntfile.js +234 -0
  10. data/LICENSE.txt +13 -0
  11. data/README.md +196 -0
  12. data/Rakefile +6 -0
  13. data/bower.json +54 -0
  14. data/config/autoprefixer.yml +6 -0
  15. data/config/scss-lint.yml +55 -0
  16. data/dist/icons.svg +1 -0
  17. data/dist/ustyle-content.css +1 -0
  18. data/dist/ustyle-latest.css +1 -0
  19. data/dist/ustyle.js +567 -0
  20. data/dist/ustyle.json +1 -0
  21. data/dist/ustyle.min.js +1 -0
  22. data/grunt/modules/dss-helper.js +115 -0
  23. data/grunt/modules/file.js +24 -0
  24. data/grunt/modules/html-parser.js +22 -0
  25. data/grunt/modules/templates.js +57 -0
  26. data/grunt/tasks/browser-sync.js +23 -0
  27. data/grunt/tasks/builder.js +67 -0
  28. data/grunt/tasks/styleguide.js +299 -0
  29. data/index.js +37 -0
  30. data/lib/ustyle/deploy.rb +41 -0
  31. data/lib/ustyle/engine.rb +32 -0
  32. data/lib/ustyle/hash.rb +44 -0
  33. data/lib/ustyle/helpers/icon_helper.rb +15 -0
  34. data/lib/ustyle/icons.rb +13 -0
  35. data/lib/ustyle/middleware/icon_middleware.rb +27 -0
  36. data/lib/ustyle/sass_functions.rb +65 -0
  37. data/lib/ustyle/sinatra.rb +34 -0
  38. data/lib/ustyle/sprockets.rb +6 -0
  39. data/lib/ustyle/utils.rb +42 -0
  40. data/lib/ustyle/version.rb +4 -0
  41. data/lib/ustyle.rb +58 -0
  42. data/package-lock.json +9303 -0
  43. data/package.json +89 -0
  44. data/styleguide/CNAME +1 -0
  45. data/styleguide/assets/images/CTAs.png +0 -0
  46. data/styleguide/assets/images/badge-label-usp.png +0 -0
  47. data/styleguide/assets/images/bower-logo.png +0 -0
  48. data/styleguide/assets/images/caveat.png +0 -0
  49. data/styleguide/assets/images/cloudfront-logo.png +0 -0
  50. data/styleguide/assets/images/design-conventions.png +0 -0
  51. data/styleguide/assets/images/error-texts.png +0 -0
  52. data/styleguide/assets/images/external-requirements.png +0 -0
  53. data/styleguide/assets/images/favicon/android-chrome-192x192.png +0 -0
  54. data/styleguide/assets/images/favicon/android-chrome-512x512.png +0 -0
  55. data/styleguide/assets/images/favicon/apple-touch-icon-114x114.png +0 -0
  56. data/styleguide/assets/images/favicon/apple-touch-icon-120x120.png +0 -0
  57. data/styleguide/assets/images/favicon/apple-touch-icon-144x144.png +0 -0
  58. data/styleguide/assets/images/favicon/apple-touch-icon-152x152.png +0 -0
  59. data/styleguide/assets/images/favicon/apple-touch-icon-180x180.png +0 -0
  60. data/styleguide/assets/images/favicon/apple-touch-icon-57x57.png +0 -0
  61. data/styleguide/assets/images/favicon/apple-touch-icon-60x60.png +0 -0
  62. data/styleguide/assets/images/favicon/apple-touch-icon-72x72.png +0 -0
  63. data/styleguide/assets/images/favicon/apple-touch-icon-76x76.png +0 -0
  64. data/styleguide/assets/images/favicon/apple-touch-icon.png +0 -0
  65. data/styleguide/assets/images/favicon/browserconfig.xml +9 -0
  66. data/styleguide/assets/images/favicon/favicon-16x16.png +0 -0
  67. data/styleguide/assets/images/favicon/favicon-32x32.png +0 -0
  68. data/styleguide/assets/images/favicon/favicon.ico +0 -0
  69. data/styleguide/assets/images/favicon/manifest.json +18 -0
  70. data/styleguide/assets/images/favicon/mstile-144x144.png +0 -0
  71. data/styleguide/assets/images/favicon/mstile-150x150.png +0 -0
  72. data/styleguide/assets/images/favicon/mstile-310x150.png +0 -0
  73. data/styleguide/assets/images/favicon/mstile-310x310.png +0 -0
  74. data/styleguide/assets/images/favicon/mstile-70x70.png +0 -0
  75. data/styleguide/assets/images/favicon/safari-pinned-tab.svg +46 -0
  76. data/styleguide/assets/images/icons.svg +1 -0
  77. data/styleguide/assets/images/infographic-01.png +0 -0
  78. data/styleguide/assets/images/infographic-02.png +0 -0
  79. data/styleguide/assets/images/npm-logo.png +0 -0
  80. data/styleguide/assets/images/placeholder-text.png +0 -0
  81. data/styleguide/assets/images/ruby-logo.png +0 -0
  82. data/styleguide/assets/images/site-consistency01.png +0 -0
  83. data/styleguide/assets/images/site-consistency02.png +0 -0
  84. data/styleguide/assets/images/site-consistency03.png +0 -0
  85. data/styleguide/assets/images/styleguide-examples/accurate-housing.jpg +0 -0
  86. data/styleguide/assets/images/styleguide-examples/altered.jpg +0 -0
  87. data/styleguide/assets/images/styleguide-examples/bad-subject.jpg +0 -0
  88. data/styleguide/assets/images/styleguide-examples/centered.jpg +0 -0
  89. data/styleguide/assets/images/styleguide-examples/cliche.jpg +0 -0
  90. data/styleguide/assets/images/styleguide-examples/cold.jpg +0 -0
  91. data/styleguide/assets/images/styleguide-examples/good-subject.jpg +0 -0
  92. data/styleguide/assets/images/styleguide-examples/illustrations_1.png +0 -0
  93. data/styleguide/assets/images/styleguide-examples/illustrations_2.png +0 -0
  94. data/styleguide/assets/images/styleguide-examples/illustrations_3.png +0 -0
  95. data/styleguide/assets/images/styleguide-examples/illustrations_4.png +0 -0
  96. data/styleguide/assets/images/styleguide-examples/illustrations_5.png +0 -0
  97. data/styleguide/assets/images/styleguide-examples/illustrations_6.png +0 -0
  98. data/styleguide/assets/images/styleguide-examples/innaccurate-housing.jpg +0 -0
  99. data/styleguide/assets/images/styleguide-examples/natural-1.jpg +0 -0
  100. data/styleguide/assets/images/styleguide-examples/natural-2.jpg +0 -0
  101. data/styleguide/assets/images/styleguide-examples/natural-3.jpg +0 -0
  102. data/styleguide/assets/images/styleguide-examples/not-centered.jpg +0 -0
  103. data/styleguide/assets/images/styleguide-examples/realistic.jpg +0 -0
  104. data/styleguide/assets/images/styleguide-examples/unaltered.jpg +0 -0
  105. data/styleguide/assets/images/styleguide-examples/unnatural-1.jpg +0 -0
  106. data/styleguide/assets/images/styleguide-examples/unnatural-2.jpg +0 -0
  107. data/styleguide/assets/images/styleguide-examples/unnatural-3.jpg +0 -0
  108. data/styleguide/assets/images/styleguide-examples/warm.jpg +0 -0
  109. data/styleguide/assets/images/tone-framework.png +0 -0
  110. data/styleguide/assets/images/tone.png +0 -0
  111. data/styleguide/assets/images/tooltip.png +0 -0
  112. data/styleguide/assets/images/tsandcs.png +0 -0
  113. data/styleguide/assets/images/ustyle.svg +73 -0
  114. data/styleguide/assets/images/ux-conventions-consistency.png +0 -0
  115. data/styleguide/assets/images/ux-conventions-error.png +0 -0
  116. data/styleguide/assets/images/ux-conventions-errors.png +0 -0
  117. data/styleguide/assets/images/ux-conventions-flexibility.png +0 -0
  118. data/styleguide/assets/images/ux-conventions-freedom.png +0 -0
  119. data/styleguide/assets/images/ux-conventions-minimalist.png +0 -0
  120. data/styleguide/assets/images/ux-conventions-real-world.png +0 -0
  121. data/styleguide/assets/images/ux-conventions-recognition.png +0 -0
  122. data/styleguide/assets/images/ux-conventions-visibility.png +0 -0
  123. data/styleguide/assets/javascripts/app.js +115 -0
  124. data/styleguide/assets/javascripts/modules/stats.js +50 -0
  125. data/styleguide/assets/javascripts/vendor/highlight.js +1 -0
  126. data/styleguide/assets/javascripts/vendor/svg4everybody.js +1 -0
  127. data/styleguide/assets/sass/main.scss +42 -0
  128. data/styleguide/assets/sass/modules/_code.scss +8 -0
  129. data/styleguide/assets/sass/modules/_colours.scss +26 -0
  130. data/styleguide/assets/sass/modules/_copyright.scss +4 -0
  131. data/styleguide/assets/sass/modules/_grid.scss +12 -0
  132. data/styleguide/assets/sass/modules/_home.scss +5 -0
  133. data/styleguide/assets/sass/modules/_images.scss +24 -0
  134. data/styleguide/assets/sass/modules/_links.scss +3 -0
  135. data/styleguide/assets/sass/modules/_logo.scss +182 -0
  136. data/styleguide/assets/sass/modules/_made-at.scss +6 -0
  137. data/styleguide/assets/sass/modules/_markdown.scss +7 -0
  138. data/styleguide/assets/sass/modules/_nav-mobile.scss +72 -0
  139. data/styleguide/assets/sass/modules/_nav.scss +32 -0
  140. data/styleguide/assets/sass/modules/_sidebar.scss +94 -0
  141. data/styleguide/assets/sass/modules/_states.scss +4 -0
  142. data/styleguide/assets/sass/modules/_styleguide.scss +138 -0
  143. data/styleguide/assets/sass/modules/_table.scss +3 -0
  144. data/styleguide/assets/sass/modules/_tooltip.scss +9 -0
  145. data/styleguide/assets/sass/modules/_typography.scss +14 -0
  146. data/styleguide/assets/sass/modules/_version.scss +11 -0
  147. data/styleguide/assets/sass/structure/_base.scss +18 -0
  148. data/styleguide/assets/sass/structure/_header.scss +12 -0
  149. data/styleguide/assets/sass/vendor/_highlight.scss +139 -0
  150. data/styleguide/assets/sass/vendor/_pure-table.scss +75 -0
  151. data/styleguide/content/brand/index.md +47 -0
  152. data/styleguide/content/brand/logo.tpl +279 -0
  153. data/styleguide/content/design/accessibility-testing.md +82 -0
  154. data/styleguide/content/design/index.tpl +367 -0
  155. data/styleguide/content/design/typography.md +68 -0
  156. data/styleguide/content/design/validating-designs.tpl +304 -0
  157. data/styleguide/content/index.tpl +51 -0
  158. data/styleguide/content/language/grammar.md +220 -0
  159. data/styleguide/content/language/microcopy.md +170 -0
  160. data/styleguide/content/language/tone.md +135 -0
  161. data/styleguide/content/pattern-library/grid.tpl +64 -0
  162. data/styleguide/content/pattern-library/index.tpl +88 -0
  163. data/styleguide/partials/_footer.tpl +8 -0
  164. data/styleguide/partials/_head.tpl +26 -0
  165. data/styleguide/partials/_header.tpl +37 -0
  166. data/styleguide/partials/_sidebar.tpl +27 -0
  167. data/styleguide/partials/colour.tpl +24 -0
  168. data/styleguide/partials/icons.tpl +28 -0
  169. data/styleguide/partials/style_block.tpl +44 -0
  170. data/styleguide/templates/simple.tpl +25 -0
  171. data/styleguide/templates/stats.tpl +50 -0
  172. data/styleguide/templates/styleguide.tpl +36 -0
  173. data/tasks/publish.rake +67 -0
  174. data/ustyle.gemspec +32 -0
  175. data/vendor/assets/images/forms/checkbox-rebrand.svg +1 -0
  176. data/vendor/assets/images/forms/checkbox.svg +1 -0
  177. data/vendor/assets/images/icons/alarm.svg +1 -0
  178. data/vendor/assets/images/icons/android.svg +1 -0
  179. data/vendor/assets/images/icons/arrow-circle.svg +1 -0
  180. data/vendor/assets/images/icons/arrow-down.svg +1 -0
  181. data/vendor/assets/images/icons/arrow-up.svg +1 -0
  182. data/vendor/assets/images/icons/book.svg +1 -0
  183. data/vendor/assets/images/icons/bookmark.svg +1 -0
  184. data/vendor/assets/images/icons/breadcrumb.svg +1 -0
  185. data/vendor/assets/images/icons/calculator.svg +1 -0
  186. data/vendor/assets/images/icons/calendar.svg +1 -0
  187. data/vendor/assets/images/icons/car.svg +1 -0
  188. data/vendor/assets/images/icons/checkbox-tick.svg +1 -0
  189. data/vendor/assets/images/icons/chevron-left.svg +1 -0
  190. data/vendor/assets/images/icons/chevron-right.svg +1 -0
  191. data/vendor/assets/images/icons/clock.svg +1 -0
  192. data/vendor/assets/images/icons/close.svg +1 -0
  193. data/vendor/assets/images/icons/cog.svg +1 -0
  194. data/vendor/assets/images/icons/controller.svg +1 -0
  195. data/vendor/assets/images/icons/credit-card.svg +1 -0
  196. data/vendor/assets/images/icons/cross.svg +1 -0
  197. data/vendor/assets/images/icons/dashcam.svg +1 -0
  198. data/vendor/assets/images/icons/dual-fuel.svg +1 -0
  199. data/vendor/assets/images/icons/electric-light.svg +1 -0
  200. data/vendor/assets/images/icons/envelope.svg +1 -0
  201. data/vendor/assets/images/icons/exit-noexit.svg +1 -0
  202. data/vendor/assets/images/icons/facebook-brand.svg +1 -0
  203. data/vendor/assets/images/icons/facebook.svg +1 -0
  204. data/vendor/assets/images/icons/filter.svg +1 -0
  205. data/vendor/assets/images/icons/fixed-variable.svg +1 -0
  206. data/vendor/assets/images/icons/gas.svg +1 -0
  207. data/vendor/assets/images/icons/gauge.svg +1 -0
  208. data/vendor/assets/images/icons/github.svg +1 -0
  209. data/vendor/assets/images/icons/google-brand.svg +1 -0
  210. data/vendor/assets/images/icons/google.svg +1 -0
  211. data/vendor/assets/images/icons/graph-up.svg +1 -0
  212. data/vendor/assets/images/icons/home.svg +1 -0
  213. data/vendor/assets/images/icons/hot.svg +1 -0
  214. data/vendor/assets/images/icons/info.svg +1 -0
  215. data/vendor/assets/images/icons/kettle.svg +1 -0
  216. data/vendor/assets/images/icons/key.svg +1 -0
  217. data/vendor/assets/images/icons/lock.svg +1 -0
  218. data/vendor/assets/images/icons/magnify-in.svg +1 -0
  219. data/vendor/assets/images/icons/magnify.svg +1 -0
  220. data/vendor/assets/images/icons/menu.svg +1 -0
  221. data/vendor/assets/images/icons/message.svg +1 -0
  222. data/vendor/assets/images/icons/mobile.svg +1 -0
  223. data/vendor/assets/images/icons/monthly-dd.svg +1 -0
  224. data/vendor/assets/images/icons/network.svg +1 -0
  225. data/vendor/assets/images/icons/no-exit.svg +1 -0
  226. data/vendor/assets/images/icons/pdf.svg +1 -0
  227. data/vendor/assets/images/icons/pencil.svg +1 -0
  228. data/vendor/assets/images/icons/person-add.svg +1 -0
  229. data/vendor/assets/images/icons/person.svg +1 -0
  230. data/vendor/assets/images/icons/phone.svg +1 -0
  231. data/vendor/assets/images/icons/piggy-bank.svg +1 -0
  232. data/vendor/assets/images/icons/pin.svg +1 -0
  233. data/vendor/assets/images/icons/play.svg +1 -0
  234. data/vendor/assets/images/icons/pound-circle.svg +1 -0
  235. data/vendor/assets/images/icons/pound-note.svg +1 -0
  236. data/vendor/assets/images/icons/present.svg +1 -0
  237. data/vendor/assets/images/icons/print.svg +1 -0
  238. data/vendor/assets/images/icons/quarterly-dd.svg +1 -0
  239. data/vendor/assets/images/icons/question-circle.svg +1 -0
  240. data/vendor/assets/images/icons/quote.svg +1 -0
  241. data/vendor/assets/images/icons/recycle.svg +1 -0
  242. data/vendor/assets/images/icons/remove.svg +1 -0
  243. data/vendor/assets/images/icons/renewable.svg +1 -0
  244. data/vendor/assets/images/icons/results.svg +1 -0
  245. data/vendor/assets/images/icons/save.svg +1 -0
  246. data/vendor/assets/images/icons/share.svg +1 -0
  247. data/vendor/assets/images/icons/shield.svg +1 -0
  248. data/vendor/assets/images/icons/sim.svg +1 -0
  249. data/vendor/assets/images/icons/smiley.svg +1 -0
  250. data/vendor/assets/images/icons/sort.svg +1 -0
  251. data/vendor/assets/images/icons/speech-circle.svg +1 -0
  252. data/vendor/assets/images/icons/speech.svg +1 -0
  253. data/vendor/assets/images/icons/spinner-rebrand.svg +1 -0
  254. data/vendor/assets/images/icons/spinner.svg +1 -0
  255. data/vendor/assets/images/icons/star-half.svg +1 -0
  256. data/vendor/assets/images/icons/star.svg +1 -0
  257. data/vendor/assets/images/icons/starline-half.svg +1 -0
  258. data/vendor/assets/images/icons/starline.svg +1 -0
  259. data/vendor/assets/images/icons/talk.svg +1 -0
  260. data/vendor/assets/images/icons/tick-circle.svg +1 -0
  261. data/vendor/assets/images/icons/tick.svg +1 -0
  262. data/vendor/assets/images/icons/tv.svg +1 -0
  263. data/vendor/assets/images/icons/twitter-brand.svg +1 -0
  264. data/vendor/assets/images/icons/twitter.svg +1 -0
  265. data/vendor/assets/images/icons/ustyle.svg +1 -0
  266. data/vendor/assets/images/icons/uswitch.svg +1 -0
  267. data/vendor/assets/images/icons/variable.svg +1 -0
  268. data/vendor/assets/images/icons/warning-circle.svg +1 -0
  269. data/vendor/assets/images/icons/warning.svg +1 -0
  270. data/vendor/assets/images/icons/wifi.svg +1 -0
  271. data/vendor/assets/images/icons/wiki.svg +1 -0
  272. data/vendor/assets/images/icons/xml.svg +1 -0
  273. data/vendor/assets/images/icons.svg +1 -0
  274. data/vendor/assets/javascripts/ustyle/backdrop.js +56 -0
  275. data/vendor/assets/javascripts/ustyle/classtoggler.js +76 -0
  276. data/vendor/assets/javascripts/ustyle/overlay.js +152 -0
  277. data/vendor/assets/javascripts/ustyle/tabs.js +166 -0
  278. data/vendor/assets/javascripts/ustyle/utils.js +113 -0
  279. data/vendor/assets/javascripts/ustyle.js +4 -0
  280. data/vendor/assets/stylesheets/rebrand-content.scss +1 -0
  281. data/vendor/assets/stylesheets/rebrand.scss +1 -0
  282. data/vendor/assets/stylesheets/ustyle/_all.scss +55 -0
  283. data/vendor/assets/stylesheets/ustyle/_content.scss +5 -0
  284. data/vendor/assets/stylesheets/ustyle/_global.scss +20 -0
  285. data/vendor/assets/stylesheets/ustyle/articles/_base.scss +100 -0
  286. data/vendor/assets/stylesheets/ustyle/articles/_guide.scss +57 -0
  287. data/vendor/assets/stylesheets/ustyle/articles/_more.scss +31 -0
  288. data/vendor/assets/stylesheets/ustyle/articles/_news.scss +213 -0
  289. data/vendor/assets/stylesheets/ustyle/articles/_related.scss +76 -0
  290. data/vendor/assets/stylesheets/ustyle/basics/_extends.scss +73 -0
  291. data/vendor/assets/stylesheets/ustyle/basics/_fonts.scss +27 -0
  292. data/vendor/assets/stylesheets/ustyle/basics/_functions.scss +78 -0
  293. data/vendor/assets/stylesheets/ustyle/basics/_grid.scss +86 -0
  294. data/vendor/assets/stylesheets/ustyle/basics/_typography.scss +123 -0
  295. data/vendor/assets/stylesheets/ustyle/basics/_variables.scss +166 -0
  296. data/vendor/assets/stylesheets/ustyle/basics/variables/_colors.scss +94 -0
  297. data/vendor/assets/stylesheets/ustyle/basics/variables/_forms.scss +98 -0
  298. data/vendor/assets/stylesheets/ustyle/basics/variables/_icons.scss +43 -0
  299. data/vendor/assets/stylesheets/ustyle/components/_backdrop.scss +23 -0
  300. data/vendor/assets/stylesheets/ustyle/components/_breadcrumbs.scss +66 -0
  301. data/vendor/assets/stylesheets/ustyle/components/_button.scss +187 -0
  302. data/vendor/assets/stylesheets/ustyle/components/_calculator.scss +41 -0
  303. data/vendor/assets/stylesheets/ustyle/components/_comp-table-row.scss +341 -0
  304. data/vendor/assets/stylesheets/ustyle/components/_compliance-banner.scss +38 -0
  305. data/vendor/assets/stylesheets/ustyle/components/_content-group.scss +33 -0
  306. data/vendor/assets/stylesheets/ustyle/components/_cta.scss +66 -0
  307. data/vendor/assets/stylesheets/ustyle/components/_grid-classes.scss +52 -0
  308. data/vendor/assets/stylesheets/ustyle/components/_hero.scss +115 -0
  309. data/vendor/assets/stylesheets/ustyle/components/_links.scss +26 -0
  310. data/vendor/assets/stylesheets/ustyle/components/_lists-li.scss +92 -0
  311. data/vendor/assets/stylesheets/ustyle/components/_lists.scss +39 -0
  312. data/vendor/assets/stylesheets/ustyle/components/_loader.scss +139 -0
  313. data/vendor/assets/stylesheets/ustyle/components/_overlay.scss +183 -0
  314. data/vendor/assets/stylesheets/ustyle/components/_progress.scss +138 -0
  315. data/vendor/assets/stylesheets/ustyle/components/_promo-banner.scss +131 -0
  316. data/vendor/assets/stylesheets/ustyle/components/_reminder.scss +87 -0
  317. data/vendor/assets/stylesheets/ustyle/components/_tab-navigation.scss +114 -0
  318. data/vendor/assets/stylesheets/ustyle/components/_table-toolbar.scss +91 -0
  319. data/vendor/assets/stylesheets/ustyle/components/_tabs.scss +300 -0
  320. data/vendor/assets/stylesheets/ustyle/components/_tooltip.scss +243 -0
  321. data/vendor/assets/stylesheets/ustyle/components/_usp.scss +88 -0
  322. data/vendor/assets/stylesheets/ustyle/content/_base.scss +227 -0
  323. data/vendor/assets/stylesheets/ustyle/content/_c-header.scss +27 -0
  324. data/vendor/assets/stylesheets/ustyle/content/_c-social.scss +9 -0
  325. data/vendor/assets/stylesheets/ustyle/content/_c-tabs.scss +30 -0
  326. data/vendor/assets/stylesheets/ustyle/forms/_base.scss +9 -0
  327. data/vendor/assets/stylesheets/ustyle/forms/_fields.scss +78 -0
  328. data/vendor/assets/stylesheets/ustyle/forms/_input-group.scss +154 -0
  329. data/vendor/assets/stylesheets/ustyle/forms/_input.scss +61 -0
  330. data/vendor/assets/stylesheets/ustyle/forms/_radio-checkbox.scss +144 -0
  331. data/vendor/assets/stylesheets/ustyle/forms/_reset.scss +21 -0
  332. data/vendor/assets/stylesheets/ustyle/forms/_select.scss +154 -0
  333. data/vendor/assets/stylesheets/ustyle/forms/_textarea.scss +33 -0
  334. data/vendor/assets/stylesheets/ustyle/forms/_toggle.scss +114 -0
  335. data/vendor/assets/stylesheets/ustyle/forms/_validation.scss +104 -0
  336. data/vendor/assets/stylesheets/ustyle/icons/_base.scss +241 -0
  337. data/vendor/assets/stylesheets/ustyle/mixins/_arrow.scss +51 -0
  338. data/vendor/assets/stylesheets/ustyle/mixins/_base.scss +7 -0
  339. data/vendor/assets/stylesheets/ustyle/mixins/_baseline.scss +43 -0
  340. data/vendor/assets/stylesheets/ustyle/mixins/_forms.scss +84 -0
  341. data/vendor/assets/stylesheets/ustyle/mixins/_general.scss +24 -0
  342. data/vendor/assets/stylesheets/ustyle/mixins/_link-colors.scss +44 -0
  343. data/vendor/assets/stylesheets/ustyle/mixins/_media-query.scss +121 -0
  344. data/vendor/assets/stylesheets/ustyle/mixins/_typography.scss +98 -0
  345. data/vendor/assets/stylesheets/ustyle/tables/_base.scss +4 -0
  346. data/vendor/assets/stylesheets/ustyle/tables/_tables-basic.scss +72 -0
  347. data/vendor/assets/stylesheets/ustyle/tables/_tables-sortable.scss +72 -0
  348. data/vendor/assets/stylesheets/ustyle/tables/_tables-with-key-cells.scss +18 -0
  349. data/vendor/assets/stylesheets/ustyle/tables/_variables.scss +15 -0
  350. data/vendor/assets/stylesheets/ustyle/utilities/_general.scss +116 -0
  351. data/vendor/assets/stylesheets/ustyle/utilities/_grid.scss +13 -0
  352. data/vendor/assets/stylesheets/ustyle/utilities/_images.scss +34 -0
  353. data/vendor/assets/stylesheets/ustyle/utilities/_responsive.scss +101 -0
  354. data/vendor/assets/stylesheets/ustyle/utilities/_spacing.scss +73 -0
  355. data/vendor/assets/stylesheets/ustyle/vendor/normalize.scss +427 -0
  356. data/vendor/assets/stylesheets/ustyle-content.scss +2 -0
  357. data/vendor/assets/stylesheets/ustyle.scss +1 -0
  358. metadata +517 -0
@@ -0,0 +1,144 @@
1
+ // @page Pattern Library/Forms
2
+ // @name Radios and checkboxes
3
+ //
4
+ // @description
5
+ // Browsers that support screen density media features display our font icon tick or a box shadow circle. Other browsers fallback to default styling.
6
+ //
7
+ // #### Best practices
8
+ // * Like select boxes, radio buttons are good for making a selection from a mutually exclusive list of options. The main difference between the two is that with radio buttons, the user must choose exactly one of the options.
9
+ // * Use radio buttons when each of the choices matters to the user. Each needs to be considered before they make their choice.
10
+ // * Checkboxes in a group should be used for choosing zero or more options from a list of independent options. Toggling one should not change the state of others in the group.
11
+ // * A stand-alone checkbox is good for toggling something on/off or opting in/out.
12
+ // * Provide a default selection to radio and checkbox groups if it's necessary and wont be changed by 90% of your users.
13
+ // * Try to keep the number of radio buttons and checkboxes in the same group to a maximum of 6.
14
+ //
15
+ // @state us-form-input--disabled - Like other types of form inputs, adding this class to the element in conjunction with the disabled attribute helps to make the element look like it can't be interacted with.
16
+ //
17
+ // @markup
18
+ // <div class="us-field us-field--blocked">
19
+ // <label>Do you have a different billing address?</label>
20
+ // <div class="us-field-toggle">
21
+ // <label>
22
+ // <input checked="checked" class="us-form-input {$modifiers}" name="null" type="radio">
23
+ // Yes
24
+ // </label>
25
+ //
26
+ // <label>
27
+ // <input class="us-form-input" name="null" type="radio">
28
+ // No
29
+ // </label>
30
+ // </div>
31
+ // </div>
32
+ //
33
+ // <div class="us-field us-field--blocked">
34
+ // <label>How would you like to be contacted?</label>
35
+ // <div class="us-field-toggle">
36
+ // <label>
37
+ // <input checked="checked" class="us-form-input {$modifiers}" name="null" type="checkbox">
38
+ // Mobile
39
+ // </label>
40
+ //
41
+ // <label>
42
+ // <input class="us-form-input" name="null" type="checkbox">
43
+ // Email
44
+ // </label>
45
+ // </div>
46
+ // </div>
47
+
48
+ .us-form-input {
49
+ @include hidpi(.1) {
50
+ &[type="checkbox"] {
51
+ &:after {
52
+ position: absolute;
53
+ top: 50%;
54
+ left: 50%;
55
+ display: block;
56
+ width: 1em;
57
+ height: 1em;
58
+ margin: -.5em 0 0 -.5em;
59
+ pointer-events: none;
60
+ background-image: inline-svg("forms/checkbox-rebrand.svg");
61
+ background-position: 0 75%;
62
+ background-size: cover;
63
+ content: "";
64
+ opacity: 0;
65
+ }
66
+
67
+ &:focus {
68
+ border-width: 2px;
69
+ }
70
+
71
+ &:checked:after {
72
+ opacity: 1;
73
+ }
74
+
75
+ &.us-form-input--disabled,
76
+ &:disabled {
77
+ background: $c-form-element-disabled-bg;
78
+
79
+ // scss-lint:disable NestingDepth
80
+ &:after {
81
+ opacity: 0;
82
+ }
83
+ }
84
+
85
+ &.us-form-input--disabled {
86
+
87
+ // scss-lint:disable NestingDepth
88
+ &:checked:after {
89
+ background-position: 0 50%;
90
+ opacity: .35;
91
+ }
92
+ }
93
+ }
94
+
95
+ &[type="radio"] {
96
+
97
+ &:checked,
98
+ &:checked:focus {
99
+ background: $c-form-element-border-active;
100
+ }
101
+
102
+ &:focus {
103
+ box-shadow: inset 0 0 0 2px $c-form-element-border-hover;
104
+ }
105
+
106
+ &:checked {
107
+ box-shadow: inset 0 0 0 .35em #fff;
108
+ }
109
+
110
+ &:checked:focus {
111
+ box-shadow: inset 0 0 0 1px $c-form-element-border-hover, inset 0 0 0 .35em #fff;
112
+ }
113
+
114
+ &.us-form-input--disabled:checked {
115
+ background: $c-form-element-disabled-fg;
116
+ box-shadow: inset 0 0 0 .35em $c-form-element-disabled-bg;
117
+ }
118
+ }
119
+ }
120
+
121
+ &[type="checkbox"],
122
+ &[type="radio"] {
123
+ position: relative;
124
+ width: 1.6em;
125
+ height: 1.6em;
126
+ padding: 0;
127
+ font-size: .8em;
128
+ cursor: pointer;
129
+
130
+ .us-field-toggle & {
131
+ margin-top: .1em;
132
+ margin-right: .5em;
133
+ vertical-align: top;
134
+ }
135
+ }
136
+
137
+ &[type="radio"] {
138
+ border-radius: 50%;
139
+ }
140
+
141
+ &[type="checkbox"] {
142
+ border-radius: .3em;
143
+ }
144
+ }
@@ -0,0 +1,21 @@
1
+ %base-form-element {
2
+ @include form-element-style($c-form-element-border, $c-form-element-border-hover, $c-form-element-border-active);
3
+ display: inline-block;
4
+ color: $c-form-element-text;
5
+ vertical-align: middle;
6
+ background: $c-form-element-background;
7
+ border-style: solid;
8
+ border-width: 1px;
9
+ box-sizing: border-box;
10
+ -ms-appearance: none;
11
+ -webkit-appearance: none;
12
+ appearance: none;
13
+ }
14
+
15
+ %base-form-element--error {
16
+ @include form-element-style($c-form-error);
17
+ }
18
+
19
+ %base-form-element--success {
20
+ @include form-element-style($c-form-success);
21
+ }
@@ -0,0 +1,154 @@
1
+ // @page Pattern Library/Forms
2
+ // @name Selects
3
+ //
4
+ // @description
5
+ // Select boxes allow users to choose an option or options from a list of options.
6
+ //
7
+ // #### Best practices
8
+ // * Use select boxes when choosing one or more options from a list of related, but mutually exclusive options e.g. profession, title, month.
9
+ // * It can be tempting to put many things in a select box for users to choose from. Try to keep the list of options to between 4 and 15 so the user doesn't become overwhelmed with choices.
10
+ //
11
+ // @state .us-form-select--multiple - Removes the drop down arrow and adjusts the padding of <option> elements. Useful when using <select> elements that have the size="" attribute set to anything higher than 1.
12
+ // @state .us-form-select--blocked - Fluid style.
13
+ // @state .us-form-select--error - Visual feedback for when the input has an error.
14
+ // @state .us-form-select--success - Visual feedback for when success needs to be communicated to the user.
15
+ // @state .us-form-select--disabled - Inactive state for select boxes. You may also just add the disabled attribute to the <select> element in order to achieve the same effect.
16
+ //
17
+ // @markup
18
+ // <select class="us-form-select {$modifiers}">
19
+ // <option>A select menu</option>
20
+ // <option>With lots of options</option>
21
+ // <option>And a few more</option>
22
+ // </select>
23
+
24
+ $select-default-color: $c-form-element-border !default;
25
+ $select-hover-color: $c-form-element-border-hover !default;
26
+
27
+ @function select-arrow($color) {
28
+ @return url("data:image/svg+xml;charset=utf-8;base64," + base64encode("<svg version='1.1' baseProfile='tiny' xmlns='http://www.w3.org/2000/svg' x='0px' y='0px' width='40px' height='6px' viewBox='0 0 40 6'><polygon fill='#{$color}' points='25.3,0 20.3,6 15.3,0 '/></svg>"));
29
+ }
30
+
31
+ @mixin select-background($color, $color--active: false) {
32
+ background-image: select-arrow($color);
33
+
34
+ &:hover,
35
+ &:focus {
36
+ background-image: select-arrow(if($color--active, $color--active, $color));
37
+ }
38
+ }
39
+
40
+ // [deprecated]
41
+ .us-form-select-wrap {
42
+ position: relative;
43
+ display: inline-block;
44
+ }
45
+
46
+ .us-form-select {
47
+ @extend %base-form-element;
48
+ @include select-background($select-default-color, $select-hover-color);
49
+ @include input-sizing();
50
+ max-width: 100%;
51
+ padding-right: 40px;
52
+ cursor: pointer;
53
+ background-position: 100% 50%;
54
+ background-repeat: no-repeat;
55
+ outline: 0;
56
+
57
+ // [nodoc] Fix for FF < 35 https://gist.github.com/joaocunha/6273016/
58
+ @-moz-document url-prefix() {
59
+ text-indent: .01px;
60
+ text-overflow: "";
61
+ -moz-appearance: none;
62
+ }
63
+
64
+ &:focus {
65
+ &:-moz-focusring {
66
+ color: transparent;
67
+ text-shadow: 0 0 0 $c-form-element-text;
68
+ }
69
+ }
70
+
71
+ &::-ms-expand {
72
+ display: none;
73
+ }
74
+
75
+ @if $media-query-legacy-support {
76
+ .ie8 & {
77
+ padding: $form-element-base-padding;
78
+ }
79
+ }
80
+
81
+ .ie9 & {
82
+ padding: $form-element-base-padding;
83
+ }
84
+ }
85
+
86
+ .us-form-select-wrap--multiple, // [deprecated]
87
+ .us-form-select--multiple,
88
+ .us-form-select[multiple],
89
+ .us-form-select[size] {
90
+ &,
91
+ .us-form-select {
92
+ height: auto;
93
+ overflow: hidden {
94
+ x: auto;
95
+ y: auto;
96
+ };
97
+ vertical-align: middle;
98
+ cursor: default;
99
+ background-image: none;
100
+ -webkit-overflow-scrolling: touch;
101
+ }
102
+
103
+ &:hover,
104
+ &:focus {
105
+ background-image: none;
106
+ }
107
+
108
+ option {
109
+ cursor: pointer;
110
+ }
111
+
112
+ &::-webkit-scrollbar {
113
+ width: 16px;
114
+ height: 16px;
115
+
116
+ &:window-inactive {
117
+ opacity: 0;
118
+ }
119
+ }
120
+
121
+ &::-webkit-scrollbar-thumb {
122
+ background: rgba(0, 0, 0, .2);
123
+ border: 4px solid rgba(0, 0, 0, 0);
124
+ border-radius: 8px;
125
+ background-clip: padding-box;
126
+ }
127
+
128
+ &::-webkit-scrollbar-corner {
129
+ background-color: transparent;
130
+ }
131
+ }
132
+
133
+ .us-form-select-wrap--blocked, // [deprecated]
134
+ .us-form-select--blocked {
135
+ width: 100%;
136
+ }
137
+
138
+ .us-form-select-wrap--disabled, // [deprecated]
139
+ .us-form-select--disabled,
140
+ .us-form-select:disabled {
141
+ &,
142
+ .us-form-select {
143
+ @include form-element-disabled;
144
+ @include select-background($c-form-element-disabled-fg);
145
+ }
146
+ }
147
+
148
+ .us-form-select--error {
149
+ @extend %base-form-element--error;
150
+ }
151
+
152
+ .us-form-select--success {
153
+ @extend %base-form-element--success;
154
+ }
@@ -0,0 +1,33 @@
1
+ // @page Pattern Library/Forms
2
+ // @name Textarea
3
+ //
4
+ // @description
5
+ // Our standard textarea styling across the website.
6
+ //
7
+ //
8
+ // @state .us-form-textarea--blocked - Fluid textarea style.
9
+ // @state .us-form-textarea--disabled - Inactive state for textareas that can't be interacted with.
10
+ //
11
+ // @markup
12
+ // <textarea class="us-form-textarea {$modifiers}"></textarea>
13
+
14
+ .us-form-textarea {
15
+ @extend %base-form-element;
16
+ @extend %input-background--normalise;
17
+ padding: $form-element-base-padding;
18
+ font-size: 1em;
19
+ outline: 0;
20
+
21
+ &:focus {
22
+ @include placeholder(darken($input-placeholder-color, 15%));
23
+ }
24
+ }
25
+
26
+ .us-form-textarea--blocked {
27
+ width: 100%;
28
+ }
29
+
30
+ .us-form-textarea:disabled,
31
+ .us-form-textarea--disabled {
32
+ @include form-element-disabled;
33
+ }
@@ -0,0 +1,114 @@
1
+ // @page Pattern Library/Forms
2
+ // @name Toggle
3
+ //
4
+ // @description
5
+ // Toggle buttons provide an alternative way of displaying radio groups with a small number of options to a user.
6
+ // IE8 support is included with `radioToggle.js` which sets a `.checked` class on the radio button when clicked.
7
+ //
8
+ // #### Best practices
9
+ // * Use as an alternative to radio groups that have short labels for each option (Yes/No, Opt-in/Opt-out).
10
+ // * For forms that have many short radio group questions in them, toggle buttons provide a better experience for quickly selecting answers on both desktop and mobile due to larger visible click areas for each option.
11
+ // * Limit the number of options in the toggle group to 3.
12
+ //
13
+ // @state .us-toggle__btn--disabled - Visual styling for toggle buttons that can't be interacted with.
14
+ //
15
+ // @javascript
16
+ // var radioToggle = new RadioToggle({
17
+ // $target: $(".us-toggle")
18
+ // })
19
+ //
20
+ // @markup
21
+ // <div class="us-field us-field--blocked">
22
+ // <label>Answer truthfully</label>
23
+ // <div class="us-toggle">
24
+ // <label class="us-toggle__label">
25
+ // <input class="us-form-input" name="choice" type="radio">
26
+ // <span class="us-toggle__btn {$modifiers}">
27
+ // Yes
28
+ // </span>
29
+ // </label>
30
+ //
31
+ // <label class="us-toggle__label">
32
+ // <input class="us-form-input" name="choice" type="radio">
33
+ // <span class="us-toggle__btn">
34
+ // No
35
+ // </span>
36
+ // </label>
37
+ // </div>
38
+ // </div>
39
+
40
+ $toggle-btn-padding: 10px 26px !default;
41
+ $toggle-active-bg: $c-white !default;
42
+
43
+ @mixin toggle-active-style {
44
+ background: $toggle-active-bg;
45
+ border-color: $c-form-element-border-active;
46
+ text-shadow: 1px 0 0 $c-form-element-text;
47
+ color: $c-uswitch-navy;
48
+ }
49
+
50
+ @mixin toggle-disabled-style {
51
+ color: $c-form-element-disabled-fg;
52
+ background-color: $c-form-element-disabled-bg;
53
+ border-color: $c-form-element-disabled-fg;
54
+ }
55
+
56
+ .us-toggle {
57
+ @extend %clearfix;
58
+ display: block;
59
+
60
+ @include respond-to($default-grid-breakpoint, true) {
61
+ display: inline-block;
62
+ }
63
+ }
64
+
65
+ .us-toggle__label {
66
+ position: relative;
67
+ float: left;
68
+ width: 50%;
69
+ vertical-align: middle;
70
+ cursor: pointer;
71
+
72
+ @include respond-to($default-grid-breakpoint, true) {
73
+ width: auto;
74
+ }
75
+
76
+ // Don't hide inputs due to tabbing
77
+ .us-form-input {
78
+ position: absolute;
79
+ left: -999em;
80
+ }
81
+ }
82
+
83
+ .us-toggle__btn {
84
+ display: block;
85
+ padding: $toggle-btn-padding;
86
+ color: $c-grey;
87
+ text-align: center;
88
+ background-color: $c-form-element-background;
89
+ border: 1px solid $c-form-element-border;
90
+
91
+ .us-toggle__label:hover & {
92
+ border-color: $c-form-element-border-hover;
93
+ }
94
+
95
+ .us-toggle__label:focus &,
96
+ .us-toggle__label .us-form-input:focus + & {
97
+ color: $c-uswitch-navy;
98
+ border-color: $c-form-element-border-active;
99
+ box-shadow: inset 0 0 0 1px $c-form-element-border-active;
100
+ }
101
+
102
+ // [nodoc] Legacy, as grouping selectors will fail on pseudo-selector :checked
103
+ .us-toggle__label .us-form-input.checked + & {
104
+ @include toggle-active-style;
105
+ }
106
+
107
+ .us-toggle__label .us-form-input:checked + & {
108
+ @include toggle-active-style;
109
+ }
110
+ }
111
+
112
+ .us-toggle__btn--disabled {
113
+ @include form-element-disabled;
114
+ }
@@ -0,0 +1,104 @@
1
+ // @page Pattern Library/Forms
2
+ // @name Validation messages
3
+ //
4
+ // @description
5
+ // Used to provide more detailed feedback about the data users have entered into forms.
6
+ //
7
+ // #### Best practices
8
+ // * For inputs that have a label above them, place the validation message between the input and the label.
9
+ // * Use success validation messages only when it makes sense to contextually. For example, they can help to reassure users about the data they entered when multiple criteria need to be satisfied, e.g. password fields.
10
+ //
11
+ // @state .us-validation--error - Error styling for incorrect data on forms.
12
+ // @state .us-validation--success - Success styling for correct forms.
13
+ //
14
+ // @markup
15
+ // <div class="us-field">
16
+ // <label>Email</label>
17
+ //
18
+ // <div class="us-validation {$modifiers}">
19
+ // <div class="us-validation__icon"></div>
20
+ // <div class="us-validation__message">Validation message here</div>
21
+ // </div>
22
+ //
23
+ // <input type="email" class="us-form-input" name="email" />
24
+ // </div>
25
+
26
+ $message-padding-vertical: .35em !default;
27
+ $message-padding-horizontal: .5em !default;
28
+ $message-min-height: 2.4em !default;
29
+
30
+ $icon-size: 18px !default;
31
+ $icon-bg-size: 26px !default;
32
+ $icon-text-color: #fff !default;
33
+
34
+ $error-color: $c-red !default;
35
+ $error-icon: "!" !default;
36
+
37
+ $success-color: $c-green !default;
38
+ $success-icon: "\2713" !default;
39
+
40
+ @mixin validation-style($color, $icon) {
41
+ .us-validation__message {
42
+ color: $color;
43
+ border-color: $color;
44
+
45
+ &:before,
46
+ &:after {
47
+ border-color: $color;
48
+ }
49
+
50
+ &:after {
51
+ border-right-color: #fff;
52
+ }
53
+ }
54
+
55
+ .us-validation__icon {
56
+ background-color: $color;
57
+
58
+ &:before {
59
+ content: $icon;
60
+ }
61
+ }
62
+ }
63
+
64
+ %validation-icon {
65
+ @include heading-font;
66
+ position: absolute;
67
+ color: $icon-text-color;
68
+ text-align: center;
69
+ border-radius: 50%;
70
+ }
71
+
72
+ .us-validation {
73
+ position: relative;
74
+ display: block;
75
+ padding: .25em 0 .25em ($icon-bg-size + 5);
76
+ }
77
+
78
+ .us-validation,
79
+ .us-validation--error {
80
+ @include validation-style($error-color, $error-icon);
81
+ }
82
+
83
+ .us-validation--success {
84
+ @include validation-style($success-color, $success-icon);
85
+ }
86
+
87
+ .us-validation__message {
88
+ position: relative;
89
+ display: block;
90
+ min-height: $message-min-height;
91
+ padding: $message-padding-vertical $message-padding-horizontal;
92
+ margin: 0;
93
+ line-height: 1.5;
94
+ }
95
+
96
+ .us-validation__icon {
97
+ @extend %validation-icon;
98
+ top: 10px;
99
+ left: 0;
100
+ width: $icon-bg-size;
101
+ height: $icon-bg-size;
102
+ font-size: $icon-size;
103
+ line-height: $icon-bg-size;
104
+ }