ustyle 1.3.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +23 -0
- data/.rbenv-gemsets +1 -0
- data/.ruby-version +1 -0
- data/CONTRIBUTING.md +68 -0
- data/Gemfile +4 -0
- data/Gruntfile.js +189 -0
- data/JAVASCRIPT_STANDARDS.md +88 -0
- data/LICENSE.txt +13 -0
- data/README.md +93 -0
- data/Rakefile +6 -0
- data/bower.json +54 -0
- data/config/.jscsrc +76 -0
- data/config/autoprefixer.yml +6 -0
- data/config/scss-lint.yml +54 -0
- data/dist/ustyle-content.css +1 -0
- data/dist/ustyle-icons.css +1 -0
- data/dist/ustyle-latest.css +1 -0
- data/dist/ustyle.js +799 -0
- data/dist/ustyle.json +1 -0
- data/grunt/modules/dss-helper.js +117 -0
- data/grunt/modules/file.js +26 -0
- data/grunt/modules/templates.js +59 -0
- data/grunt/tasks/browser-sync.js +19 -0
- data/grunt/tasks/builder.js +72 -0
- data/grunt/tasks/styleguide.js +290 -0
- data/grunt/tasks/svg2png.js +57 -0
- data/lib/ustyle/deploy.rb +31 -0
- data/lib/ustyle/engine.rb +24 -0
- data/lib/ustyle/hash.rb +44 -0
- data/lib/ustyle/icons.rb +13 -0
- data/lib/ustyle/sass_functions.rb +104 -0
- data/lib/ustyle/sinatra.rb +34 -0
- data/lib/ustyle/sprockets.rb +6 -0
- data/lib/ustyle/utils.rb +40 -0
- data/lib/ustyle/version.rb +4 -0
- data/lib/ustyle.rb +54 -0
- data/package.json +74 -0
- data/styleguide/CNAME +1 -0
- data/styleguide/assets/images/bower-logo.png +0 -0
- data/styleguide/assets/images/cloudfront-logo.png +0 -0
- data/styleguide/assets/images/illustration-01.png +0 -0
- data/styleguide/assets/images/illustration-02.png +0 -0
- data/styleguide/assets/images/illustration-03.png +0 -0
- data/styleguide/assets/images/illustration-04.png +0 -0
- data/styleguide/assets/images/illustration-05.png +0 -0
- data/styleguide/assets/images/illustration-06.png +0 -0
- data/styleguide/assets/images/illustration-07.png +0 -0
- data/styleguide/assets/images/illustration-08.png +0 -0
- data/styleguide/assets/images/infographic-01.png +0 -0
- data/styleguide/assets/images/infographic-02.png +0 -0
- data/styleguide/assets/images/lifestyle-photography-01.png +0 -0
- data/styleguide/assets/images/lifestyle-photography-02.png +0 -0
- data/styleguide/assets/images/lifestyle-photography-03.png +0 -0
- data/styleguide/assets/images/lifestyle-photography-04.png +0 -0
- data/styleguide/assets/images/lifestyle-photography-05.png +0 -0
- data/styleguide/assets/images/lifestyle-photography-06.png +0 -0
- data/styleguide/assets/images/lifestyle-photography-07.png +0 -0
- data/styleguide/assets/images/lifestyle-photography-08.png +0 -0
- data/styleguide/assets/images/npm-logo.png +0 -0
- data/styleguide/assets/images/object-photography-01.png +0 -0
- data/styleguide/assets/images/object-photography-02.png +0 -0
- data/styleguide/assets/images/object-photography-03.png +0 -0
- data/styleguide/assets/images/object-photography-04.png +0 -0
- data/styleguide/assets/images/object-photography-05.png +0 -0
- data/styleguide/assets/images/object-photography-06.png +0 -0
- data/styleguide/assets/images/object-photography-07.png +0 -0
- data/styleguide/assets/images/object-photography-08.png +0 -0
- data/styleguide/assets/images/ruby-logo.png +0 -0
- data/styleguide/assets/images/ustyle.svg +73 -0
- data/styleguide/assets/javascripts/app.js +91 -0
- data/styleguide/assets/javascripts/modules/cleanWhiteSpace.js +34 -0
- data/styleguide/assets/javascripts/modules/stats.js +51 -0
- data/styleguide/assets/javascripts/vendor/highlight.js +1 -0
- data/styleguide/assets/sass/main.scss +152 -0
- data/styleguide/assets/sass/modules/_code.scss +8 -0
- data/styleguide/assets/sass/modules/_colours.scss +25 -0
- data/styleguide/assets/sass/modules/_copyright.scss +4 -0
- data/styleguide/assets/sass/modules/_grid.scss +12 -0
- data/styleguide/assets/sass/modules/_home.scss +5 -0
- data/styleguide/assets/sass/modules/_links.scss +3 -0
- data/styleguide/assets/sass/modules/_logo.scss +56 -0
- data/styleguide/assets/sass/modules/_made-at.scss +6 -0
- data/styleguide/assets/sass/modules/_markdown.scss +7 -0
- data/styleguide/assets/sass/modules/_nav-mobile.scss +72 -0
- data/styleguide/assets/sass/modules/_nav.scss +32 -0
- data/styleguide/assets/sass/modules/_sidebar.scss +94 -0
- data/styleguide/assets/sass/modules/_states.scss +4 -0
- data/styleguide/assets/sass/modules/_styleguide.scss +134 -0
- data/styleguide/assets/sass/modules/_table.scss +3 -0
- data/styleguide/assets/sass/modules/_tooltip.scss +9 -0
- data/styleguide/assets/sass/modules/_typography.scss +14 -0
- data/styleguide/assets/sass/modules/_version.scss +11 -0
- data/styleguide/assets/sass/structure/_base.scss +18 -0
- data/styleguide/assets/sass/structure/_header.scss +12 -0
- data/styleguide/assets/sass/vendor/_highlight.scss +139 -0
- data/styleguide/assets/sass/vendor/_pure-table.scss +75 -0
- data/styleguide/content/brand/index.md +47 -0
- data/styleguide/content/brand/language.md +102 -0
- data/styleguide/content/brand/logo.tpl +102 -0
- data/styleguide/content/design/index.tpl +79 -0
- data/styleguide/content/design/typography.md +30 -0
- data/styleguide/content/index.tpl +44 -0
- data/styleguide/content/pattern-library/grid.tpl +64 -0
- data/styleguide/content/pattern-library/index.tpl +92 -0
- data/styleguide/partials/_footer.tpl +8 -0
- data/styleguide/partials/_head.tpl +20 -0
- data/styleguide/partials/_header.tpl +7 -0
- data/styleguide/partials/_sidebar.tpl +22 -0
- data/styleguide/partials/colour.tpl +24 -0
- data/styleguide/partials/icons.tpl +28 -0
- data/styleguide/partials/style_block.tpl +44 -0
- data/styleguide/templates/simple.tpl +15 -0
- data/styleguide/templates/stats.tpl +50 -0
- data/styleguide/templates/styleguide.tpl +33 -0
- data/tasks/publish.rake +65 -0
- data/ustyle.gemspec +34 -0
- data/vendor/assets/images/icons/16px/alarm.png +0 -0
- data/vendor/assets/images/icons/16px/android.png +0 -0
- data/vendor/assets/images/icons/16px/angry.png +0 -0
- data/vendor/assets/images/icons/16px/apple.png +0 -0
- data/vendor/assets/images/icons/16px/arrow-circle.png +0 -0
- data/vendor/assets/images/icons/16px/arrow-up-left.png +0 -0
- data/vendor/assets/images/icons/16px/arrow-up.png +0 -0
- data/vendor/assets/images/icons/16px/barchart.png +0 -0
- data/vendor/assets/images/icons/16px/blackberry.png +0 -0
- data/vendor/assets/images/icons/16px/book.png +0 -0
- data/vendor/assets/images/icons/16px/bookmark.png +0 -0
- data/vendor/assets/images/icons/16px/breadcrumb.png +0 -0
- data/vendor/assets/images/icons/16px/calculator.png +0 -0
- data/vendor/assets/images/icons/16px/calendar.png +0 -0
- data/vendor/assets/images/icons/16px/car.png +0 -0
- data/vendor/assets/images/icons/16px/checkbox-tick.png +0 -0
- data/vendor/assets/images/icons/16px/clock.png +0 -0
- data/vendor/assets/images/icons/16px/close.png +0 -0
- data/vendor/assets/images/icons/16px/cog.png +0 -0
- data/vendor/assets/images/icons/16px/controller.png +0 -0
- data/vendor/assets/images/icons/16px/credit-card.png +0 -0
- data/vendor/assets/images/icons/16px/cross.png +0 -0
- data/vendor/assets/images/icons/16px/desktop.png +0 -0
- data/vendor/assets/images/icons/16px/doc.png +0 -0
- data/vendor/assets/images/icons/16px/down-arrow.png +0 -0
- data/vendor/assets/images/icons/16px/dual-fuel.png +0 -0
- data/vendor/assets/images/icons/16px/electric-light.png +0 -0
- data/vendor/assets/images/icons/16px/envelope.png +0 -0
- data/vendor/assets/images/icons/16px/exit-noexit.png +0 -0
- data/vendor/assets/images/icons/16px/facebook.png +0 -0
- data/vendor/assets/images/icons/16px/filter.png +0 -0
- data/vendor/assets/images/icons/16px/fixed-variable.png +0 -0
- data/vendor/assets/images/icons/16px/gas.png +0 -0
- data/vendor/assets/images/icons/16px/gauge.png +0 -0
- data/vendor/assets/images/icons/16px/github.png +0 -0
- data/vendor/assets/images/icons/16px/google.png +0 -0
- data/vendor/assets/images/icons/16px/graph-up.png +0 -0
- data/vendor/assets/images/icons/16px/happy.png +0 -0
- data/vendor/assets/images/icons/16px/home.png +0 -0
- data/vendor/assets/images/icons/16px/hot.png +0 -0
- data/vendor/assets/images/icons/16px/info.png +0 -0
- data/vendor/assets/images/icons/16px/kettle.png +0 -0
- data/vendor/assets/images/icons/16px/key.png +0 -0
- data/vendor/assets/images/icons/16px/laptop.png +0 -0
- data/vendor/assets/images/icons/16px/lock.png +0 -0
- data/vendor/assets/images/icons/16px/magnify-in.png +0 -0
- data/vendor/assets/images/icons/16px/magnify-out.png +0 -0
- data/vendor/assets/images/icons/16px/magnify.png +0 -0
- data/vendor/assets/images/icons/16px/menu.png +0 -0
- data/vendor/assets/images/icons/16px/message.png +0 -0
- data/vendor/assets/images/icons/16px/mobile.png +0 -0
- data/vendor/assets/images/icons/16px/monthly-dd.png +0 -0
- data/vendor/assets/images/icons/16px/neutral.png +0 -0
- data/vendor/assets/images/icons/16px/no-exit.png +0 -0
- data/vendor/assets/images/icons/16px/pdf.png +0 -0
- data/vendor/assets/images/icons/16px/pencil.png +0 -0
- data/vendor/assets/images/icons/16px/person-add.png +0 -0
- data/vendor/assets/images/icons/16px/person.png +0 -0
- data/vendor/assets/images/icons/16px/phone.png +0 -0
- data/vendor/assets/images/icons/16px/piggy-bank.png +0 -0
- data/vendor/assets/images/icons/16px/pin.png +0 -0
- data/vendor/assets/images/icons/16px/play.png +0 -0
- data/vendor/assets/images/icons/16px/pound-circle.png +0 -0
- data/vendor/assets/images/icons/16px/pound-note.png +0 -0
- data/vendor/assets/images/icons/16px/power.png +0 -0
- data/vendor/assets/images/icons/16px/present.png +0 -0
- data/vendor/assets/images/icons/16px/print.png +0 -0
- data/vendor/assets/images/icons/16px/quarterly-dd.png +0 -0
- data/vendor/assets/images/icons/16px/question-circle.png +0 -0
- data/vendor/assets/images/icons/16px/question.png +0 -0
- data/vendor/assets/images/icons/16px/quote.png +0 -0
- data/vendor/assets/images/icons/16px/recycle.png +0 -0
- data/vendor/assets/images/icons/16px/remove.png +0 -0
- data/vendor/assets/images/icons/16px/renewable.png +0 -0
- data/vendor/assets/images/icons/16px/results.png +0 -0
- data/vendor/assets/images/icons/16px/sad.png +0 -0
- data/vendor/assets/images/icons/16px/save.png +0 -0
- data/vendor/assets/images/icons/16px/share.png +0 -0
- data/vendor/assets/images/icons/16px/sim.png +0 -0
- data/vendor/assets/images/icons/16px/smiley.png +0 -0
- data/vendor/assets/images/icons/16px/sort.png +0 -0
- data/vendor/assets/images/icons/16px/speech-circle.png +0 -0
- data/vendor/assets/images/icons/16px/speech.png +0 -0
- data/vendor/assets/images/icons/16px/spinner 2.png +0 -0
- data/vendor/assets/images/icons/16px/spinner.png +0 -0
- data/vendor/assets/images/icons/16px/star-half.png +0 -0
- data/vendor/assets/images/icons/16px/star.png +0 -0
- data/vendor/assets/images/icons/16px/starline-half.png +0 -0
- data/vendor/assets/images/icons/16px/starline.png +0 -0
- data/vendor/assets/images/icons/16px/tablet.png +0 -0
- data/vendor/assets/images/icons/16px/talk.png +0 -0
- data/vendor/assets/images/icons/16px/tick-circle.png +0 -0
- data/vendor/assets/images/icons/16px/tick.png +0 -0
- data/vendor/assets/images/icons/16px/tv.png +0 -0
- data/vendor/assets/images/icons/16px/twitter.png +0 -0
- data/vendor/assets/images/icons/16px/ustyle.png +0 -0
- data/vendor/assets/images/icons/16px/uswitch.png +0 -0
- data/vendor/assets/images/icons/16px/variable.png +0 -0
- data/vendor/assets/images/icons/16px/warning-circle.png +0 -0
- data/vendor/assets/images/icons/16px/warning.png +0 -0
- data/vendor/assets/images/icons/16px/wifi.png +0 -0
- data/vendor/assets/images/icons/16px/wiki.png +0 -0
- data/vendor/assets/images/icons/16px/windows.png +0 -0
- data/vendor/assets/images/icons/16px/wondering.png +0 -0
- data/vendor/assets/images/icons/16px/world.png +0 -0
- data/vendor/assets/images/icons/16px/xml.png +0 -0
- data/vendor/assets/images/icons/32px/alarm.png +0 -0
- data/vendor/assets/images/icons/32px/android.png +0 -0
- data/vendor/assets/images/icons/32px/angry.png +0 -0
- data/vendor/assets/images/icons/32px/apple.png +0 -0
- data/vendor/assets/images/icons/32px/arrow-circle.png +0 -0
- data/vendor/assets/images/icons/32px/arrow-up-left.png +0 -0
- data/vendor/assets/images/icons/32px/arrow-up.png +0 -0
- data/vendor/assets/images/icons/32px/barchart.png +0 -0
- data/vendor/assets/images/icons/32px/blackberry.png +0 -0
- data/vendor/assets/images/icons/32px/book.png +0 -0
- data/vendor/assets/images/icons/32px/bookmark.png +0 -0
- data/vendor/assets/images/icons/32px/breadcrumb.png +0 -0
- data/vendor/assets/images/icons/32px/calculator.png +0 -0
- data/vendor/assets/images/icons/32px/calendar.png +0 -0
- data/vendor/assets/images/icons/32px/car.png +0 -0
- data/vendor/assets/images/icons/32px/checkbox-tick.png +0 -0
- data/vendor/assets/images/icons/32px/clock.png +0 -0
- data/vendor/assets/images/icons/32px/close.png +0 -0
- data/vendor/assets/images/icons/32px/cog.png +0 -0
- data/vendor/assets/images/icons/32px/controller.png +0 -0
- data/vendor/assets/images/icons/32px/credit-card.png +0 -0
- data/vendor/assets/images/icons/32px/cross.png +0 -0
- data/vendor/assets/images/icons/32px/desktop.png +0 -0
- data/vendor/assets/images/icons/32px/doc.png +0 -0
- data/vendor/assets/images/icons/32px/down-arrow.png +0 -0
- data/vendor/assets/images/icons/32px/dual-fuel.png +0 -0
- data/vendor/assets/images/icons/32px/electric-light.png +0 -0
- data/vendor/assets/images/icons/32px/envelope.png +0 -0
- data/vendor/assets/images/icons/32px/exit-noexit.png +0 -0
- data/vendor/assets/images/icons/32px/facebook.png +0 -0
- data/vendor/assets/images/icons/32px/filter.png +0 -0
- data/vendor/assets/images/icons/32px/fixed-variable.png +0 -0
- data/vendor/assets/images/icons/32px/gas.png +0 -0
- data/vendor/assets/images/icons/32px/gauge.png +0 -0
- data/vendor/assets/images/icons/32px/github.png +0 -0
- data/vendor/assets/images/icons/32px/google.png +0 -0
- data/vendor/assets/images/icons/32px/graph-up.png +0 -0
- data/vendor/assets/images/icons/32px/happy.png +0 -0
- data/vendor/assets/images/icons/32px/home.png +0 -0
- data/vendor/assets/images/icons/32px/hot.png +0 -0
- data/vendor/assets/images/icons/32px/info.png +0 -0
- data/vendor/assets/images/icons/32px/kettle.png +0 -0
- data/vendor/assets/images/icons/32px/key.png +0 -0
- data/vendor/assets/images/icons/32px/laptop.png +0 -0
- data/vendor/assets/images/icons/32px/lock.png +0 -0
- data/vendor/assets/images/icons/32px/magnify-in.png +0 -0
- data/vendor/assets/images/icons/32px/magnify-out.png +0 -0
- data/vendor/assets/images/icons/32px/magnify.png +0 -0
- data/vendor/assets/images/icons/32px/menu.png +0 -0
- data/vendor/assets/images/icons/32px/message.png +0 -0
- data/vendor/assets/images/icons/32px/mobile.png +0 -0
- data/vendor/assets/images/icons/32px/monthly-dd.png +0 -0
- data/vendor/assets/images/icons/32px/neutral.png +0 -0
- data/vendor/assets/images/icons/32px/no-exit.png +0 -0
- data/vendor/assets/images/icons/32px/pdf.png +0 -0
- data/vendor/assets/images/icons/32px/pencil.png +0 -0
- data/vendor/assets/images/icons/32px/person-add.png +0 -0
- data/vendor/assets/images/icons/32px/person.png +0 -0
- data/vendor/assets/images/icons/32px/phone.png +0 -0
- data/vendor/assets/images/icons/32px/piggy-bank.png +0 -0
- data/vendor/assets/images/icons/32px/pin.png +0 -0
- data/vendor/assets/images/icons/32px/play.png +0 -0
- data/vendor/assets/images/icons/32px/pound-circle.png +0 -0
- data/vendor/assets/images/icons/32px/pound-note.png +0 -0
- data/vendor/assets/images/icons/32px/power.png +0 -0
- data/vendor/assets/images/icons/32px/present.png +0 -0
- data/vendor/assets/images/icons/32px/print.png +0 -0
- data/vendor/assets/images/icons/32px/quarterly-dd.png +0 -0
- data/vendor/assets/images/icons/32px/question-circle.png +0 -0
- data/vendor/assets/images/icons/32px/question.png +0 -0
- data/vendor/assets/images/icons/32px/quote.png +0 -0
- data/vendor/assets/images/icons/32px/recycle.png +0 -0
- data/vendor/assets/images/icons/32px/remove.png +0 -0
- data/vendor/assets/images/icons/32px/renewable.png +0 -0
- data/vendor/assets/images/icons/32px/results.png +0 -0
- data/vendor/assets/images/icons/32px/sad.png +0 -0
- data/vendor/assets/images/icons/32px/save.png +0 -0
- data/vendor/assets/images/icons/32px/share.png +0 -0
- data/vendor/assets/images/icons/32px/sim.png +0 -0
- data/vendor/assets/images/icons/32px/smiley.png +0 -0
- data/vendor/assets/images/icons/32px/sort.png +0 -0
- data/vendor/assets/images/icons/32px/speech-circle.png +0 -0
- data/vendor/assets/images/icons/32px/speech.png +0 -0
- data/vendor/assets/images/icons/32px/spinner 2.png +0 -0
- data/vendor/assets/images/icons/32px/spinner.png +0 -0
- data/vendor/assets/images/icons/32px/star-half.png +0 -0
- data/vendor/assets/images/icons/32px/star.png +0 -0
- data/vendor/assets/images/icons/32px/starline-half.png +0 -0
- data/vendor/assets/images/icons/32px/starline.png +0 -0
- data/vendor/assets/images/icons/32px/tablet.png +0 -0
- data/vendor/assets/images/icons/32px/talk.png +0 -0
- data/vendor/assets/images/icons/32px/tick-circle.png +0 -0
- data/vendor/assets/images/icons/32px/tick.png +0 -0
- data/vendor/assets/images/icons/32px/tv.png +0 -0
- data/vendor/assets/images/icons/32px/twitter.png +0 -0
- data/vendor/assets/images/icons/32px/ustyle.png +0 -0
- data/vendor/assets/images/icons/32px/uswitch.png +0 -0
- data/vendor/assets/images/icons/32px/variable.png +0 -0
- data/vendor/assets/images/icons/32px/warning-circle.png +0 -0
- data/vendor/assets/images/icons/32px/warning.png +0 -0
- data/vendor/assets/images/icons/32px/wifi.png +0 -0
- data/vendor/assets/images/icons/32px/wiki.png +0 -0
- data/vendor/assets/images/icons/32px/windows.png +0 -0
- data/vendor/assets/images/icons/32px/wondering.png +0 -0
- data/vendor/assets/images/icons/32px/world.png +0 -0
- data/vendor/assets/images/icons/32px/xml.png +0 -0
- data/vendor/assets/images/icons/64px/alarm.png +0 -0
- data/vendor/assets/images/icons/64px/android.png +0 -0
- data/vendor/assets/images/icons/64px/angry.png +0 -0
- data/vendor/assets/images/icons/64px/apple.png +0 -0
- data/vendor/assets/images/icons/64px/arrow-circle.png +0 -0
- data/vendor/assets/images/icons/64px/arrow-up-left.png +0 -0
- data/vendor/assets/images/icons/64px/arrow-up.png +0 -0
- data/vendor/assets/images/icons/64px/barchart.png +0 -0
- data/vendor/assets/images/icons/64px/blackberry.png +0 -0
- data/vendor/assets/images/icons/64px/book.png +0 -0
- data/vendor/assets/images/icons/64px/bookmark.png +0 -0
- data/vendor/assets/images/icons/64px/breadcrumb.png +0 -0
- data/vendor/assets/images/icons/64px/calculator.png +0 -0
- data/vendor/assets/images/icons/64px/calendar.png +0 -0
- data/vendor/assets/images/icons/64px/car.png +0 -0
- data/vendor/assets/images/icons/64px/checkbox-tick.png +0 -0
- data/vendor/assets/images/icons/64px/clock.png +0 -0
- data/vendor/assets/images/icons/64px/close.png +0 -0
- data/vendor/assets/images/icons/64px/cog.png +0 -0
- data/vendor/assets/images/icons/64px/controller.png +0 -0
- data/vendor/assets/images/icons/64px/credit-card.png +0 -0
- data/vendor/assets/images/icons/64px/cross.png +0 -0
- data/vendor/assets/images/icons/64px/desktop.png +0 -0
- data/vendor/assets/images/icons/64px/doc.png +0 -0
- data/vendor/assets/images/icons/64px/down-arrow.png +0 -0
- data/vendor/assets/images/icons/64px/dual-fuel.png +0 -0
- data/vendor/assets/images/icons/64px/electric-light.png +0 -0
- data/vendor/assets/images/icons/64px/envelope.png +0 -0
- data/vendor/assets/images/icons/64px/exit-noexit.png +0 -0
- data/vendor/assets/images/icons/64px/facebook.png +0 -0
- data/vendor/assets/images/icons/64px/filter.png +0 -0
- data/vendor/assets/images/icons/64px/fixed-variable.png +0 -0
- data/vendor/assets/images/icons/64px/gas.png +0 -0
- data/vendor/assets/images/icons/64px/gauge.png +0 -0
- data/vendor/assets/images/icons/64px/github.png +0 -0
- data/vendor/assets/images/icons/64px/google.png +0 -0
- data/vendor/assets/images/icons/64px/graph-up.png +0 -0
- data/vendor/assets/images/icons/64px/happy.png +0 -0
- data/vendor/assets/images/icons/64px/home.png +0 -0
- data/vendor/assets/images/icons/64px/hot.png +0 -0
- data/vendor/assets/images/icons/64px/info.png +0 -0
- data/vendor/assets/images/icons/64px/kettle.png +0 -0
- data/vendor/assets/images/icons/64px/key.png +0 -0
- data/vendor/assets/images/icons/64px/laptop.png +0 -0
- data/vendor/assets/images/icons/64px/lock.png +0 -0
- data/vendor/assets/images/icons/64px/magnify-in.png +0 -0
- data/vendor/assets/images/icons/64px/magnify-out.png +0 -0
- data/vendor/assets/images/icons/64px/magnify.png +0 -0
- data/vendor/assets/images/icons/64px/menu.png +0 -0
- data/vendor/assets/images/icons/64px/message.png +0 -0
- data/vendor/assets/images/icons/64px/mobile.png +0 -0
- data/vendor/assets/images/icons/64px/monthly-dd.png +0 -0
- data/vendor/assets/images/icons/64px/neutral.png +0 -0
- data/vendor/assets/images/icons/64px/no-exit.png +0 -0
- data/vendor/assets/images/icons/64px/pdf.png +0 -0
- data/vendor/assets/images/icons/64px/pencil.png +0 -0
- data/vendor/assets/images/icons/64px/person-add.png +0 -0
- data/vendor/assets/images/icons/64px/person.png +0 -0
- data/vendor/assets/images/icons/64px/phone.png +0 -0
- data/vendor/assets/images/icons/64px/piggy-bank.png +0 -0
- data/vendor/assets/images/icons/64px/pin.png +0 -0
- data/vendor/assets/images/icons/64px/play.png +0 -0
- data/vendor/assets/images/icons/64px/pound-circle.png +0 -0
- data/vendor/assets/images/icons/64px/pound-note.png +0 -0
- data/vendor/assets/images/icons/64px/power.png +0 -0
- data/vendor/assets/images/icons/64px/present.png +0 -0
- data/vendor/assets/images/icons/64px/print.png +0 -0
- data/vendor/assets/images/icons/64px/quarterly-dd.png +0 -0
- data/vendor/assets/images/icons/64px/question-circle.png +0 -0
- data/vendor/assets/images/icons/64px/question.png +0 -0
- data/vendor/assets/images/icons/64px/quote.png +0 -0
- data/vendor/assets/images/icons/64px/recycle.png +0 -0
- data/vendor/assets/images/icons/64px/remove.png +0 -0
- data/vendor/assets/images/icons/64px/renewable.png +0 -0
- data/vendor/assets/images/icons/64px/results.png +0 -0
- data/vendor/assets/images/icons/64px/sad.png +0 -0
- data/vendor/assets/images/icons/64px/save.png +0 -0
- data/vendor/assets/images/icons/64px/share.png +0 -0
- data/vendor/assets/images/icons/64px/sim.png +0 -0
- data/vendor/assets/images/icons/64px/smiley.png +0 -0
- data/vendor/assets/images/icons/64px/sort.png +0 -0
- data/vendor/assets/images/icons/64px/speech-circle.png +0 -0
- data/vendor/assets/images/icons/64px/speech.png +0 -0
- data/vendor/assets/images/icons/64px/spinner 2.png +0 -0
- data/vendor/assets/images/icons/64px/spinner.png +0 -0
- data/vendor/assets/images/icons/64px/star-half.png +0 -0
- data/vendor/assets/images/icons/64px/star.png +0 -0
- data/vendor/assets/images/icons/64px/starline-half.png +0 -0
- data/vendor/assets/images/icons/64px/starline.png +0 -0
- data/vendor/assets/images/icons/64px/tablet.png +0 -0
- data/vendor/assets/images/icons/64px/talk.png +0 -0
- data/vendor/assets/images/icons/64px/tick-circle.png +0 -0
- data/vendor/assets/images/icons/64px/tick.png +0 -0
- data/vendor/assets/images/icons/64px/tv.png +0 -0
- data/vendor/assets/images/icons/64px/twitter.png +0 -0
- data/vendor/assets/images/icons/64px/ustyle.png +0 -0
- data/vendor/assets/images/icons/64px/uswitch.png +0 -0
- data/vendor/assets/images/icons/64px/variable.png +0 -0
- data/vendor/assets/images/icons/64px/warning-circle.png +0 -0
- data/vendor/assets/images/icons/64px/warning.png +0 -0
- data/vendor/assets/images/icons/64px/wifi.png +0 -0
- data/vendor/assets/images/icons/64px/wiki.png +0 -0
- data/vendor/assets/images/icons/64px/windows.png +0 -0
- data/vendor/assets/images/icons/64px/wondering.png +0 -0
- data/vendor/assets/images/icons/64px/world.png +0 -0
- data/vendor/assets/images/icons/64px/xml.png +0 -0
- data/vendor/assets/images/icons/alarm.svg +1 -0
- data/vendor/assets/images/icons/android.svg +1 -0
- data/vendor/assets/images/icons/angry.svg +1 -0
- data/vendor/assets/images/icons/apple.svg +1 -0
- data/vendor/assets/images/icons/arrow-circle.svg +1 -0
- data/vendor/assets/images/icons/arrow-up-left.svg +1 -0
- data/vendor/assets/images/icons/arrow-up.svg +1 -0
- data/vendor/assets/images/icons/barchart.svg +1 -0
- data/vendor/assets/images/icons/blackberry.svg +1 -0
- data/vendor/assets/images/icons/book.svg +1 -0
- data/vendor/assets/images/icons/bookmark.svg +1 -0
- data/vendor/assets/images/icons/breadcrumb.svg +1 -0
- data/vendor/assets/images/icons/calculator.svg +1 -0
- data/vendor/assets/images/icons/calendar.svg +1 -0
- data/vendor/assets/images/icons/car.svg +1 -0
- data/vendor/assets/images/icons/checkbox-tick.svg +1 -0
- data/vendor/assets/images/icons/clock.svg +1 -0
- data/vendor/assets/images/icons/close.svg +1 -0
- data/vendor/assets/images/icons/cog.svg +1 -0
- data/vendor/assets/images/icons/controller.svg +1 -0
- data/vendor/assets/images/icons/credit-card.svg +1 -0
- data/vendor/assets/images/icons/cross.svg +1 -0
- data/vendor/assets/images/icons/desktop.svg +1 -0
- data/vendor/assets/images/icons/doc.svg +1 -0
- data/vendor/assets/images/icons/down-arrow.svg +1 -0
- data/vendor/assets/images/icons/dual-fuel.svg +1 -0
- data/vendor/assets/images/icons/electric-light.svg +1 -0
- data/vendor/assets/images/icons/envelope.svg +1 -0
- data/vendor/assets/images/icons/exit-noexit.svg +1 -0
- data/vendor/assets/images/icons/facebook.svg +1 -0
- data/vendor/assets/images/icons/filter.svg +1 -0
- data/vendor/assets/images/icons/fixed-variable.svg +1 -0
- data/vendor/assets/images/icons/gas.svg +1 -0
- data/vendor/assets/images/icons/gauge.svg +1 -0
- data/vendor/assets/images/icons/github.svg +1 -0
- data/vendor/assets/images/icons/google.svg +1 -0
- data/vendor/assets/images/icons/graph-up.svg +1 -0
- data/vendor/assets/images/icons/happy.svg +1 -0
- data/vendor/assets/images/icons/home.svg +1 -0
- data/vendor/assets/images/icons/hot.svg +1 -0
- data/vendor/assets/images/icons/info.svg +1 -0
- data/vendor/assets/images/icons/kettle.svg +1 -0
- data/vendor/assets/images/icons/key.svg +1 -0
- data/vendor/assets/images/icons/laptop.svg +1 -0
- data/vendor/assets/images/icons/lock.svg +1 -0
- data/vendor/assets/images/icons/magnify-in.svg +1 -0
- data/vendor/assets/images/icons/magnify-out.svg +1 -0
- data/vendor/assets/images/icons/magnify.svg +1 -0
- data/vendor/assets/images/icons/menu.svg +1 -0
- data/vendor/assets/images/icons/message.svg +1 -0
- data/vendor/assets/images/icons/mobile.svg +1 -0
- data/vendor/assets/images/icons/monthly-dd.svg +1 -0
- data/vendor/assets/images/icons/neutral.svg +1 -0
- data/vendor/assets/images/icons/no-exit.svg +1 -0
- data/vendor/assets/images/icons/pdf.svg +1 -0
- data/vendor/assets/images/icons/pencil.svg +1 -0
- data/vendor/assets/images/icons/person-add.svg +1 -0
- data/vendor/assets/images/icons/person.svg +1 -0
- data/vendor/assets/images/icons/phone.svg +1 -0
- data/vendor/assets/images/icons/piggy-bank.svg +1 -0
- data/vendor/assets/images/icons/pin.svg +1 -0
- data/vendor/assets/images/icons/play.svg +1 -0
- data/vendor/assets/images/icons/pound-circle.svg +1 -0
- data/vendor/assets/images/icons/pound-note.svg +1 -0
- data/vendor/assets/images/icons/power.svg +1 -0
- data/vendor/assets/images/icons/present.svg +1 -0
- data/vendor/assets/images/icons/print.svg +1 -0
- data/vendor/assets/images/icons/quarterly-dd.svg +1 -0
- data/vendor/assets/images/icons/question-circle.svg +1 -0
- data/vendor/assets/images/icons/question.svg +1 -0
- data/vendor/assets/images/icons/quote.svg +1 -0
- data/vendor/assets/images/icons/recycle.svg +1 -0
- data/vendor/assets/images/icons/remove.svg +1 -0
- data/vendor/assets/images/icons/renewable.svg +1 -0
- data/vendor/assets/images/icons/results.svg +1 -0
- data/vendor/assets/images/icons/sad.svg +1 -0
- data/vendor/assets/images/icons/save.svg +1 -0
- data/vendor/assets/images/icons/share.svg +1 -0
- data/vendor/assets/images/icons/sim.svg +1 -0
- data/vendor/assets/images/icons/smiley.svg +1 -0
- data/vendor/assets/images/icons/sort.svg +1 -0
- data/vendor/assets/images/icons/speech-circle.svg +1 -0
- data/vendor/assets/images/icons/speech.svg +1 -0
- data/vendor/assets/images/icons/spinner 2.svg +1 -0
- data/vendor/assets/images/icons/spinner.svg +1 -0
- data/vendor/assets/images/icons/spinner_fallback.gif +0 -0
- data/vendor/assets/images/icons/star-half.svg +1 -0
- data/vendor/assets/images/icons/star.svg +1 -0
- data/vendor/assets/images/icons/starline-half.svg +1 -0
- data/vendor/assets/images/icons/starline.svg +1 -0
- data/vendor/assets/images/icons/tablet.svg +1 -0
- data/vendor/assets/images/icons/talk.svg +1 -0
- data/vendor/assets/images/icons/tick-circle.svg +1 -0
- data/vendor/assets/images/icons/tick.svg +1 -0
- data/vendor/assets/images/icons/tv.svg +1 -0
- data/vendor/assets/images/icons/twitter.svg +1 -0
- data/vendor/assets/images/icons/ustyle.svg +1 -0
- data/vendor/assets/images/icons/uswitch.svg +1 -0
- data/vendor/assets/images/icons/variable.svg +1 -0
- data/vendor/assets/images/icons/warning-circle.svg +1 -0
- data/vendor/assets/images/icons/warning.svg +1 -0
- data/vendor/assets/images/icons/wifi.svg +1 -0
- data/vendor/assets/images/icons/wiki.svg +1 -0
- data/vendor/assets/images/icons/windows.svg +1 -0
- data/vendor/assets/images/icons/wondering.svg +1 -0
- data/vendor/assets/images/icons/world.svg +1 -0
- data/vendor/assets/images/icons/xml.svg +1 -0
- data/vendor/assets/javascripts/ustyle/anchor.js +300 -0
- data/vendor/assets/javascripts/ustyle/backdrop.js +56 -0
- data/vendor/assets/javascripts/ustyle/classtoggler.js +58 -0
- data/vendor/assets/javascripts/ustyle/login/login.js +165 -0
- data/vendor/assets/javascripts/ustyle/login/password-helper.js +151 -0
- data/vendor/assets/javascripts/ustyle/overlay.js +125 -0
- data/vendor/assets/javascripts/ustyle/radioToggle.js +28 -0
- data/vendor/assets/javascripts/ustyle/tabs.js +120 -0
- data/vendor/assets/javascripts/ustyle/utils.js +106 -0
- data/vendor/assets/javascripts/ustyle.js +7 -0
- data/vendor/assets/stylesheets/ustyle/_all.scss +50 -0
- data/vendor/assets/stylesheets/ustyle/_content.scss +5 -0
- data/vendor/assets/stylesheets/ustyle/_global.scss +24 -0
- data/vendor/assets/stylesheets/ustyle/_icons.scss +20 -0
- data/vendor/assets/stylesheets/ustyle/articles/_base.scss +88 -0
- data/vendor/assets/stylesheets/ustyle/articles/_guide.scss +57 -0
- data/vendor/assets/stylesheets/ustyle/articles/_more.scss +31 -0
- data/vendor/assets/stylesheets/ustyle/articles/_news.scss +214 -0
- data/vendor/assets/stylesheets/ustyle/articles/_related.scss +74 -0
- data/vendor/assets/stylesheets/ustyle/basics/_extends.scss +69 -0
- data/vendor/assets/stylesheets/ustyle/basics/_font-face-ie.scss +31 -0
- data/vendor/assets/stylesheets/ustyle/basics/_font-face.scss +31 -0
- data/vendor/assets/stylesheets/ustyle/basics/_fonts.scss +27 -0
- data/vendor/assets/stylesheets/ustyle/basics/_functions.scss +78 -0
- data/vendor/assets/stylesheets/ustyle/basics/_grid.scss +86 -0
- data/vendor/assets/stylesheets/ustyle/basics/_typography.scss +123 -0
- data/vendor/assets/stylesheets/ustyle/basics/_variables.scss +188 -0
- data/vendor/assets/stylesheets/ustyle/basics/variables/_colors.scss +95 -0
- data/vendor/assets/stylesheets/ustyle/basics/variables/_forms.scss +65 -0
- data/vendor/assets/stylesheets/ustyle/basics/variables/_icons.scss +166 -0
- data/vendor/assets/stylesheets/ustyle/components/_anchor.scss +134 -0
- data/vendor/assets/stylesheets/ustyle/components/_backdrop.scss +19 -0
- data/vendor/assets/stylesheets/ustyle/components/_breadcrumbs.scss +59 -0
- data/vendor/assets/stylesheets/ustyle/components/_button.scss +184 -0
- data/vendor/assets/stylesheets/ustyle/components/_content-group.scss +33 -0
- data/vendor/assets/stylesheets/ustyle/components/_cta.scss +64 -0
- data/vendor/assets/stylesheets/ustyle/components/_featured.scss +112 -0
- data/vendor/assets/stylesheets/ustyle/components/_grid-classes.scss +52 -0
- data/vendor/assets/stylesheets/ustyle/components/_hero.scss +42 -0
- data/vendor/assets/stylesheets/ustyle/components/_links.scss +30 -0
- data/vendor/assets/stylesheets/ustyle/components/_lists-li.scss +89 -0
- data/vendor/assets/stylesheets/ustyle/components/_lists.scss +46 -0
- data/vendor/assets/stylesheets/ustyle/components/_loader.scss +142 -0
- data/vendor/assets/stylesheets/ustyle/components/_overlay.scss +183 -0
- data/vendor/assets/stylesheets/ustyle/components/_progress.scss +126 -0
- data/vendor/assets/stylesheets/ustyle/components/_tabs.scss +239 -0
- data/vendor/assets/stylesheets/ustyle/components/_tooltip.scss +244 -0
- data/vendor/assets/stylesheets/ustyle/components/_usp.scss +69 -0
- data/vendor/assets/stylesheets/ustyle/content/_base.scss +195 -0
- data/vendor/assets/stylesheets/ustyle/content/_c-header.scss +30 -0
- data/vendor/assets/stylesheets/ustyle/content/_c-social.scss +10 -0
- data/vendor/assets/stylesheets/ustyle/content/_c-tabs.scss +30 -0
- data/vendor/assets/stylesheets/ustyle/forms/_base.scss +9 -0
- data/vendor/assets/stylesheets/ustyle/forms/_fields.scss +75 -0
- data/vendor/assets/stylesheets/ustyle/forms/_input-group.scss +101 -0
- data/vendor/assets/stylesheets/ustyle/forms/_input.scss +63 -0
- data/vendor/assets/stylesheets/ustyle/forms/_radio-checkbox.scss +133 -0
- data/vendor/assets/stylesheets/ustyle/forms/_reset.scss +23 -0
- data/vendor/assets/stylesheets/ustyle/forms/_select.scss +125 -0
- data/vendor/assets/stylesheets/ustyle/forms/_textarea.scss +33 -0
- data/vendor/assets/stylesheets/ustyle/forms/_toggle.scss +125 -0
- data/vendor/assets/stylesheets/ustyle/forms/_validation.scss +104 -0
- data/vendor/assets/stylesheets/ustyle/icons/_base.scss +239 -0
- data/vendor/assets/stylesheets/ustyle/icons/_png.scss +37 -0
- data/vendor/assets/stylesheets/ustyle/icons/_svg.scss +29 -0
- data/vendor/assets/stylesheets/ustyle/login/_base.scss +81 -0
- data/vendor/assets/stylesheets/ustyle/login/_password-help.scss +61 -0
- data/vendor/assets/stylesheets/ustyle/login/_social.scss +63 -0
- data/vendor/assets/stylesheets/ustyle/mixins/_arrow.scss +51 -0
- data/vendor/assets/stylesheets/ustyle/mixins/_base.scss +8 -0
- data/vendor/assets/stylesheets/ustyle/mixins/_baseline.scss +41 -0
- data/vendor/assets/stylesheets/ustyle/mixins/_forms.scss +62 -0
- data/vendor/assets/stylesheets/ustyle/mixins/_general.scss +24 -0
- data/vendor/assets/stylesheets/ustyle/mixins/_link-colors.scss +44 -0
- data/vendor/assets/stylesheets/ustyle/mixins/_media-query.scss +116 -0
- data/vendor/assets/stylesheets/ustyle/mixins/_rgba-inline.scss +18 -0
- data/vendor/assets/stylesheets/ustyle/mixins/_typography.scss +98 -0
- data/vendor/assets/stylesheets/ustyle/tables/_base.scss +4 -0
- data/vendor/assets/stylesheets/ustyle/tables/_tables-basic.scss +72 -0
- data/vendor/assets/stylesheets/ustyle/tables/_tables-sortable.scss +72 -0
- data/vendor/assets/stylesheets/ustyle/tables/_tables-with-key-cells.scss +18 -0
- data/vendor/assets/stylesheets/ustyle/tables/_variables.scss +15 -0
- data/vendor/assets/stylesheets/ustyle/utilities/_general.scss +106 -0
- data/vendor/assets/stylesheets/ustyle/utilities/_grid.scss +13 -0
- data/vendor/assets/stylesheets/ustyle/utilities/_images.scss +34 -0
- data/vendor/assets/stylesheets/ustyle/utilities/_responsive.scss +101 -0
- data/vendor/assets/stylesheets/ustyle/utilities/_spacing.scss +74 -0
- data/vendor/assets/stylesheets/ustyle/vendor/normalize.scss +427 -0
- data/vendor/assets/stylesheets/ustyle-content.scss +2 -0
- data/vendor/assets/stylesheets/ustyle-icons.scss +1 -0
- data/vendor/assets/stylesheets/ustyle.scss +1 -0
- metadata +822 -0
data/lib/ustyle/hash.rb
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
# taken from activesupport-4.1.7/lib/active_support/core_ext/hash/keys.rb
|
2
|
+
class Hash
|
3
|
+
# Returns a new hash with all keys converted using the block operation.
|
4
|
+
#
|
5
|
+
# hash = { name: 'Rob', age: '28' }
|
6
|
+
#
|
7
|
+
# hash.transform_keys{ |key| key.to_s.upcase }
|
8
|
+
# # => {"NAME"=>"Rob", "AGE"=>"28"}
|
9
|
+
def transform_keys
|
10
|
+
result = {}
|
11
|
+
each_key do |key|
|
12
|
+
result[yield(key)] = self[key]
|
13
|
+
end
|
14
|
+
result
|
15
|
+
end
|
16
|
+
|
17
|
+
# Destructively convert all keys using the block operations.
|
18
|
+
# Same as transform_keys but modifies +self+.
|
19
|
+
def transform_keys!
|
20
|
+
keys.each do |key|
|
21
|
+
self[yield(key)] = delete(key)
|
22
|
+
end
|
23
|
+
self
|
24
|
+
end
|
25
|
+
|
26
|
+
# Returns a new hash with all keys converted to symbols, as long as
|
27
|
+
# they respond to +to_sym+.
|
28
|
+
#
|
29
|
+
# hash = { 'name' => 'Rob', 'age' => '28' }
|
30
|
+
#
|
31
|
+
# hash.symbolize_keys
|
32
|
+
# # => { name: "Rob", age: "28" }
|
33
|
+
def symbolize_keys
|
34
|
+
transform_keys{ |key| key.to_sym rescue key }
|
35
|
+
end
|
36
|
+
alias_method :to_options, :symbolize_keys
|
37
|
+
|
38
|
+
# Destructively convert all keys to symbols, as long as they respond
|
39
|
+
# to +to_sym+. Same as +symbolize_keys+, but modifies +self+.
|
40
|
+
def symbolize_keys!
|
41
|
+
transform_keys!{ |key| key.to_sym rescue key }
|
42
|
+
end
|
43
|
+
alias_method :to_options!, :symbolize_keys!
|
44
|
+
end
|
data/lib/ustyle/icons.rb
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
module Ustyle
|
2
|
+
module Icons
|
3
|
+
def self.loader svg_css_path, png_css_path
|
4
|
+
"
|
5
|
+
<script>
|
6
|
+
var svgCSSPath = '#{svg_css_path}',
|
7
|
+
pngCSSPath = '#{png_css_path}';
|
8
|
+
var isSVG=!!document.createElementNS&&!!document.createElementNS(\"http://www.w3.org/2000/svg\",\"svg\").createSVGRect&&!!document.implementation.hasFeature(\"http://www.w3.org/TR/SVG11/feature#Image\",\"1.1\")&&!(window.opera&&-1===navigator.userAgent.indexOf(\"Chrome\"))&&-1===navigator.userAgent.indexOf(\"Series40\");function loadCSSAsync(e){function f(){for(var b,c=0;c<d.length;c++)d[c].href&&-1<d[c].href.indexOf(e)&&(b=!0);b?a.media=\"all\":setTimeout(f)}var a=window.document.createElement(\"link\"),b=window.document.getElementsByTagName(\"script\")[0],d=window.document.styleSheets;a.rel=\"stylesheet\";a.href=e;a.media=\"only x\";a.onload=null;b.parentNode.insertBefore(a,b);f();return a}var img=new Image;img.onload=function(){isSVG?loadCSSAsync(svgCSSPath):loadCSSAsync(pngCSSPath)};img.src=\"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==\";
|
9
|
+
</script>
|
10
|
+
"
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,104 @@
|
|
1
|
+
require "sass"
|
2
|
+
require "cgi"
|
3
|
+
require "base64"
|
4
|
+
require "chunky_png"
|
5
|
+
|
6
|
+
module Sass::Script::Functions
|
7
|
+
|
8
|
+
def ustyle_version
|
9
|
+
::Sass::Script::String.new ::Ustyle::VERSION
|
10
|
+
end
|
11
|
+
declare :ustyle_version, []
|
12
|
+
|
13
|
+
def inline_asset(source)
|
14
|
+
assert_type source, :String
|
15
|
+
if Ustyle.sprockets?
|
16
|
+
::Sass::Script::String.new "url(#{sprockets_context.asset_data_uri(source.value)})"
|
17
|
+
else
|
18
|
+
path = File.join(::Ustyle.assets_path, "images", source.value)
|
19
|
+
asset_data_uri(path)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
declare :inline_asset, :args => [:source]
|
23
|
+
|
24
|
+
def inline_svg(source)
|
25
|
+
assert_type source, :String
|
26
|
+
if Ustyle.sprockets?
|
27
|
+
svg = escaped_svg(sprockets_context.environment.find_asset(source.value).to_s)
|
28
|
+
::Sass::Script::String.new "url(data:#{Ustyle.mime_type_for(source.value)};charset=utf-8,#{svg})"
|
29
|
+
else
|
30
|
+
path = File.join(::Ustyle.assets_path, "images", source.value)
|
31
|
+
asset_data_uri(path, svg = true)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
declare :inline_svg, :args => [:source]
|
35
|
+
|
36
|
+
def base64encode(string)
|
37
|
+
assert_type string, :String
|
38
|
+
Sass::Script::String.new(Base64.strict_encode64(string.value))
|
39
|
+
end
|
40
|
+
declare :base64encode, :args => [:string]
|
41
|
+
|
42
|
+
def ustyle_image_path(source)
|
43
|
+
ustyle_asset_path source, :image
|
44
|
+
end
|
45
|
+
declare :ustyle_image_path, :args => [:source]
|
46
|
+
|
47
|
+
def ustyle_asset_path(source, type)
|
48
|
+
url = if Ustyle.sprockets?
|
49
|
+
sprockets_context.send(:"#{type}_path", source.value)
|
50
|
+
else
|
51
|
+
Ustyle.cloudfront_url(source.value, type)
|
52
|
+
end
|
53
|
+
|
54
|
+
# sass-only
|
55
|
+
url ||= source.value.gsub('"', '')
|
56
|
+
Sass::Script::String.new(url, :string)
|
57
|
+
end
|
58
|
+
declare :ustyle_asset_path, :args => [:source, :type]
|
59
|
+
|
60
|
+
def rgba_inline(c, px = 5)
|
61
|
+
color = ChunkyPNG::Color.rgba(c.red, c.green, c.blue, (c.alpha * 100 * 2.55).round)
|
62
|
+
image = ChunkyPNG::Image.new(px.to_i, px.to_i, color)
|
63
|
+
data = Base64.encode64(image.to_blob).gsub("\n", "")
|
64
|
+
|
65
|
+
Sass::Script::String.new("url('data:image/png;base64,#{data}')")
|
66
|
+
end
|
67
|
+
declare :rgba_inline, :args => [:c, :px]
|
68
|
+
|
69
|
+
protected
|
70
|
+
|
71
|
+
def asset_data_uri(path, svg = false)
|
72
|
+
asset = data(path)
|
73
|
+
encoding = "base64"
|
74
|
+
if svg
|
75
|
+
asset = escaped_svg(asset)
|
76
|
+
encoding = "charset=utf-8"
|
77
|
+
else
|
78
|
+
asset = CGI::escape(Base64.strict_encode64(data(path).to_s))
|
79
|
+
end
|
80
|
+
url = "data:#{Ustyle.mime_type_for(path)};#{encoding},#{asset}"
|
81
|
+
::Sass::Script::String.new "url('#{url}')"
|
82
|
+
end
|
83
|
+
|
84
|
+
def escaped_svg(data)
|
85
|
+
CGI::escape(data).gsub('+', '%20')
|
86
|
+
end
|
87
|
+
|
88
|
+
def data(path)
|
89
|
+
File.open(path, "rb") {|io| io.read}
|
90
|
+
end
|
91
|
+
|
92
|
+
def sprockets_context
|
93
|
+
# Modern Rails way to get context:
|
94
|
+
if options.key?(:sprockets)
|
95
|
+
options[:sprockets][:context]
|
96
|
+
# Sprockets-sass context:
|
97
|
+
elsif options.key?(:custom) && options[:custom].key?(:sprockets_context)
|
98
|
+
options[:custom][:sprockets_context]
|
99
|
+
# Compatibility with sprockets pre 2.10.0:
|
100
|
+
elsif (importer = options[:importer]) && importer.respond_to?(:context)
|
101
|
+
importer.context
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
if defined?(::Sinatra)
|
2
|
+
module Sinatra
|
3
|
+
module Ustyle
|
4
|
+
def self.registered app
|
5
|
+
app.set :root, Dir.pwd
|
6
|
+
app.set :sprockets, ::Ustyle.sprockets_env
|
7
|
+
app.set :assets_prefix, %w(assets)
|
8
|
+
app.set :assets_path, File.join(app.root, "app", app.assets_prefix.join)
|
9
|
+
app.set :public_folder, File.join(app.root, "public")
|
10
|
+
app.set :assets_helper_path, "/assets"
|
11
|
+
app.set :static, true
|
12
|
+
app.set :assets_digest, true
|
13
|
+
|
14
|
+
# Setup Sprockets
|
15
|
+
::Ustyle.asset_directories.each do |asset_directory|
|
16
|
+
app.sprockets.append_path File.join(app.assets_path, asset_directory)
|
17
|
+
end
|
18
|
+
|
19
|
+
Sprockets::Helpers.configure do |config|
|
20
|
+
config.environment = app.sprockets
|
21
|
+
config.prefix = app.assets_helper_path
|
22
|
+
config.digest = app.assets_digest
|
23
|
+
config.public_path = app.public_folder
|
24
|
+
end
|
25
|
+
|
26
|
+
require 'autoprefixer-rails'
|
27
|
+
AutoprefixerRails.install(app.sprockets, *::Ustyle.autoprefixer_config(app))
|
28
|
+
|
29
|
+
app.helpers Sprockets::Helpers
|
30
|
+
end
|
31
|
+
end
|
32
|
+
register Ustyle
|
33
|
+
end
|
34
|
+
end
|
data/lib/ustyle/utils.rb
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
require 'digest'
|
2
|
+
require 'mime/types'
|
3
|
+
|
4
|
+
module Ustyle
|
5
|
+
|
6
|
+
def self.production?
|
7
|
+
ENV['RACK_ENV'] == 'production' || ENV['RAILS_ENV'] == 'production' || ENV['NODE_ENV'] == 'production' || false
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.cloudfront_url path, type
|
11
|
+
File.join "https://assets0.uswitch.com/s3/uswitch-assets-eu/ustyle/", Ustyle::VERSION, folder_by_type(type), asset_digest(path)
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.asset_digest path
|
15
|
+
path.sub(/\.(\w+)$/) { |ext| "-#{digest}#{ext}" }
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.mime_type_for asset
|
19
|
+
MIME::Types.type_for( asset ).first.content_type
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.versioned_path file
|
23
|
+
File.join "ustyle", Ustyle::VERSION, file
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.digest
|
27
|
+
Digest::SHA1.hexdigest Ustyle::VERSION
|
28
|
+
end
|
29
|
+
|
30
|
+
def self.folder_by_type type
|
31
|
+
case type
|
32
|
+
when :image
|
33
|
+
"images"
|
34
|
+
when :font
|
35
|
+
"fonts"
|
36
|
+
else ""
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
data/lib/ustyle.rb
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
dir = File.dirname(__FILE__)
|
2
|
+
$LOAD_PATH.unshift dir unless $LOAD_PATH.include?(dir)
|
3
|
+
|
4
|
+
require "ustyle/version"
|
5
|
+
require "ustyle/utils"
|
6
|
+
require "ustyle/hash"
|
7
|
+
|
8
|
+
module Ustyle
|
9
|
+
class << self
|
10
|
+
def load!
|
11
|
+
require "ustyle/sass_functions"
|
12
|
+
require "ustyle/icons"
|
13
|
+
|
14
|
+
if defined?(::Rails)
|
15
|
+
require "ustyle/engine"
|
16
|
+
elsif sprockets?
|
17
|
+
require "ustyle/sprockets"
|
18
|
+
require "ustyle/sinatra"
|
19
|
+
end
|
20
|
+
|
21
|
+
::Sass.load_paths << File.join(assets_path, "stylesheets")
|
22
|
+
end
|
23
|
+
|
24
|
+
def sprockets?
|
25
|
+
defined?(::Sprockets)
|
26
|
+
end
|
27
|
+
|
28
|
+
def gem_path
|
29
|
+
@gem_path ||= File.expand_path "..", File.dirname(__FILE__)
|
30
|
+
end
|
31
|
+
|
32
|
+
def assets_path
|
33
|
+
@assets_path ||= File.join gem_path, "vendor", "assets"
|
34
|
+
end
|
35
|
+
|
36
|
+
def asset_directories
|
37
|
+
%w(stylesheets javascripts images fonts)
|
38
|
+
end
|
39
|
+
|
40
|
+
def sprockets_env
|
41
|
+
@sprockets_env ||= ::Sprockets::Environment.new
|
42
|
+
end
|
43
|
+
|
44
|
+
def autoprefixer_config app
|
45
|
+
file = File.join Ustyle.gem_path, 'config/autoprefixer.yml'
|
46
|
+
params = YAML.load_file(file).symbolize_keys
|
47
|
+
opts = { }
|
48
|
+
opts[:safe] = true if params.delete(:safe)
|
49
|
+
[params, opts]
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
Ustyle.load!
|
data/package.json
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
{
|
2
|
+
"name": "ustyle",
|
3
|
+
"version": "1.3.6",
|
4
|
+
"description": "A living styleguide and pattern library by uSwitch.",
|
5
|
+
"keywords": [
|
6
|
+
"css",
|
7
|
+
"sass",
|
8
|
+
"scss",
|
9
|
+
"js",
|
10
|
+
"javascript",
|
11
|
+
"front-end",
|
12
|
+
"styleguide",
|
13
|
+
"uswitch",
|
14
|
+
"ustyle"
|
15
|
+
],
|
16
|
+
"homepage": "http://ustyle.guide",
|
17
|
+
"bugs": {
|
18
|
+
"url": "https://github.com/uswitch/ustyle/issues"
|
19
|
+
},
|
20
|
+
"license": "Apache-2.0",
|
21
|
+
"author": "uSwitch Limited",
|
22
|
+
"contributors": [
|
23
|
+
"Joe Green <joe.green@uswitch.com>",
|
24
|
+
"David Annez <david.annez@uswitch.com>",
|
25
|
+
"Thomas Britton <thomas.britton@uswitch.com>",
|
26
|
+
"Ricardo Cerqueira <ricardo.cerqueira@uswitch.com>",
|
27
|
+
"Ivo Reis <ivo.reis@uswitch.com>"
|
28
|
+
],
|
29
|
+
"main": "dist/ustyle-latest.css",
|
30
|
+
"files": [
|
31
|
+
"dist/"
|
32
|
+
],
|
33
|
+
"repository": "uswitch/ustyle",
|
34
|
+
"scripts": {
|
35
|
+
"test": "grunt test"
|
36
|
+
},
|
37
|
+
"devDependencies": {
|
38
|
+
"async": "^0.9.0",
|
39
|
+
"autoprefixer-core": "^4.0.1",
|
40
|
+
"bluebird": "^2.9.7",
|
41
|
+
"browser-sync": "^1.8.2",
|
42
|
+
"cssstats": "^1.0.1",
|
43
|
+
"dss": "^1.0.4",
|
44
|
+
"gray-matter": "^2.0.0",
|
45
|
+
"grunt": "^0.4.5",
|
46
|
+
"grunt-build-control": "^0.3.0",
|
47
|
+
"grunt-contrib-concat": "^0.5.0",
|
48
|
+
"grunt-contrib-copy": "^0.8.0",
|
49
|
+
"grunt-contrib-sass": "^0.9.2",
|
50
|
+
"grunt-contrib-uglify": "^0.9.2",
|
51
|
+
"grunt-contrib-watch": "^0.6.1",
|
52
|
+
"grunt-env": "^0.4.2",
|
53
|
+
"grunt-newer": "^1.1.0",
|
54
|
+
"grunt-postcss": "^0.2.0",
|
55
|
+
"grunt-sassdoc": "^2.0.0",
|
56
|
+
"grunt-scss-lint": "~0.3.4",
|
57
|
+
"grunt-shell": "^1.1.1",
|
58
|
+
"grunt-svgmin": "^2.0.0",
|
59
|
+
"grunt-version": "^1.0.0",
|
60
|
+
"handlebars": "^2.0.0",
|
61
|
+
"load-grunt-tasks": "~3.1.0",
|
62
|
+
"lodash": "^2.4.1",
|
63
|
+
"marked": "^0.3.2",
|
64
|
+
"path": "^0.11.14",
|
65
|
+
"semver": "^4.3.3",
|
66
|
+
"simple-git": "^1.3.0",
|
67
|
+
"stylestats": "^4.2.2",
|
68
|
+
"svg-to-png": "^2.0.0",
|
69
|
+
"svgo": "^0.5.0",
|
70
|
+
"underscore.string": "^3.0.2",
|
71
|
+
"grunt-jscs": "~2.0.0",
|
72
|
+
"jscs": "~2.1.0"
|
73
|
+
}
|
74
|
+
}
|
data/styleguide/CNAME
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ustyle.guide
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,73 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<!-- Generator: Adobe Illustrator 18.1.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
3
|
+
<svg version="1.1" baseProfile="tiny" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
4
|
+
x="0px" y="0px" width="32px" height="32px" viewBox="0 0 32 32" xml:space="preserve">
|
5
|
+
<g>
|
6
|
+
<polygon fill="#548DCA" points="15.1,14.1 10.9,18.5 13.4,18.8 "/>
|
7
|
+
<polygon fill="#437CBE" points="15.1,14.1 16.9,19.3 13.4,18.8 "/>
|
8
|
+
<polygon fill="#4983C3" points="15.1,14.1 16.9,13 16.9,19.3 "/>
|
9
|
+
<polygon fill="#437CBE" points="16.9,13 20.2,15.9 16.9,19.3 "/>
|
10
|
+
<polygon fill="#568FCB" points="16.9,13 19.9,10.6 20.2,15.9 "/>
|
11
|
+
<polygon fill="#9BC6EB" points="19.9,10.6 21.6,18 20.2,15.9 "/>
|
12
|
+
<polygon fill="#68A0D6" points="21.6,18 16.9,19.3 20.2,15.9 "/>
|
13
|
+
<polygon fill="#80B2E0" points="21.6,18 21.6,24.4 18.9,22.5 "/>
|
14
|
+
<polygon fill="#5A94CE" points="18.9,22.5 16.9,19.3 21.6,18 "/>
|
15
|
+
<polygon fill="#679FD6" points="16.9,19.3 12.6,27.5 15.9,26.3 "/>
|
16
|
+
<polygon fill="#558FCB" points="16.9,19.3 15.9,26.3 18.9,22.5 "/>
|
17
|
+
<polygon fill="#8FBDE6" points="18.9,22.5 17.2,27.5 15.9,26.3 "/>
|
18
|
+
<polygon fill="#7DB1E0" points="18.9,22.5 21.6,24.4 17.2,27.5 "/>
|
19
|
+
<polygon fill="#417CBE" points="16.9,19.3 13.4,18.8 10.2,25.7 "/>
|
20
|
+
<polygon fill="#3D73B8" points="16.9,19.3 10.2,25.7 12.6,27.5 "/>
|
21
|
+
<polygon fill="#558FCB" points="10.9,18.5 10.2,25.7 13.4,18.8 "/>
|
22
|
+
<polygon fill="#548DCA" points="10.9,18.5 8,26.6 10.2,25.7 "/>
|
23
|
+
<polygon fill="#427BBD" points="8,26.6 8.7,29.6 10.2,25.7 "/>
|
24
|
+
<polygon fill="#3D73B8" points="10.2,25.7 10.8,30.1 8.7,29.6 "/>
|
25
|
+
<polygon fill="#386FB4" points="10.2,25.7 12.6,27.5 10.8,30.1 "/>
|
26
|
+
<polygon fill="#427BBD" points="12.6,27.5 10.8,30.1 13.5,29.7 "/>
|
27
|
+
<polygon fill="#649ED5" points="12.6,27.5 15.9,26.3 13.5,29.7 "/>
|
28
|
+
<polygon fill="#87B8E4" points="15.9,26.3 15.1,29.3 13.5,29.7 "/>
|
29
|
+
<polygon fill="#93C1E8" points="15.9,26.3 17.2,27.5 15.1,29.3 "/>
|
30
|
+
<polygon fill="#5B95CF" points="8.7,29.6 10.7,32 10.8,30.1 "/>
|
31
|
+
<polygon fill="#568FCB" points="10.8,30.1 13.5,29.7 12.7,31.8 "/>
|
32
|
+
<polygon fill="#5E98D1" points="10.8,30.1 10.7,32 12.7,31.8 "/>
|
33
|
+
<polygon fill="#8DBCE6" points="12.7,31.8 15.1,29.3 13.5,29.7 "/>
|
34
|
+
<polygon fill="#90BDE6" points="12.7,31.8 14.1,31.6 15.1,29.3 "/>
|
35
|
+
<polygon fill="#A2CAEC" points="14.1,31.6 15.4,29.5 15.1,29.3 "/>
|
36
|
+
<polygon fill="#A1C9EC" points="17.2,27.5 15.4,29.5 15.1,29.3 "/>
|
37
|
+
<polygon fill="#84B6E2" points="10.7,32 9.5,31 8.7,29.6 "/>
|
38
|
+
<polygon fill="#82B3E1" points="8,26.6 8.3,28.7 8.7,29.6 "/>
|
39
|
+
<polygon fill="#558FCB" points="10.9,18.5 14.5,12.8 15.1,14.1 "/>
|
40
|
+
<polygon fill="#5B95CF" points="14.5,12.8 10.8,15 10.9,18.5 "/>
|
41
|
+
<polygon fill="#72A9DB" points="10.8,15 14.4,11.1 14.5,12.8 "/>
|
42
|
+
<polygon fill="#5894CF" points="19.9,10.6 16.1,11.4 16.9,13 "/>
|
43
|
+
<polygon fill="#7AAEDF" points="19.9,10.6 18.5,8.9 16.1,11.4 "/>
|
44
|
+
<polygon fill="#95C0E7" points="18.5,8.9 15.1,10.3 14.4,11.1 16.1,11.4 "/>
|
45
|
+
<polygon fill="#70A8DB" points="18.5,8.9 13.8,5.9 15.1,10.3 "/>
|
46
|
+
<polygon fill="#629DD5" points="18.5,8.9 23.9,6.2 19.9,10.6 "/>
|
47
|
+
<polygon fill="#99D1F3" points="23.9,6.2 21,10 19.9,10.6 "/>
|
48
|
+
<polygon fill="#599BD4" points="23.9,6.2 22.3,11.5 21,10 "/>
|
49
|
+
<polygon fill="#7FBBE7" points="22.3,11.5 19.9,10.6 21,10 "/>
|
50
|
+
<polygon fill="#78AEDE" points="19.9,10.6 22.3,11.5 21.6,18 "/>
|
51
|
+
<polygon fill="#92C1E8" points="22.3,11.5 23.3,16.7 21.6,18 "/>
|
52
|
+
<polygon fill="#A1CAED" points="23.3,16.7 23,21.5 21.6,18 "/>
|
53
|
+
<polygon fill="#90BDE6" points="21.6,18 23,21.5 21.6,24.4 "/>
|
54
|
+
<polygon fill="#9BC6EB" points="26.3,15.8 23.3,16.7 26.9,20.7 "/>
|
55
|
+
<polygon fill="#95C1E8" points="26.9,20.7 23,21.5 23.3,16.7 "/>
|
56
|
+
<polygon fill="#9CC6EA" points="26.9,20.7 26,24.9 23,21.5 "/>
|
57
|
+
<polygon fill="#93C1E8" points="23,21.5 26,24.9 23.7,27 "/>
|
58
|
+
<polygon fill="#93C1E8" points="23,21.5 23.7,27 21.7,24 "/>
|
59
|
+
<polygon fill="#91BFE7" points="21.4,24.5 23.7,27 21.7,24 21.6,24.4 "/>
|
60
|
+
<polygon fill="#98C4EA" points="23.3,16.7 26.3,15.8 22.5,12.4 "/>
|
61
|
+
<polygon fill="#AFD3F0" points="26.3,15.8 23.7,11.4 22.5,12.4 "/>
|
62
|
+
<polygon fill="#ABD0EF" points="23.7,11.4 22.4,11.2 22.3,11.5 22.5,12.4 "/>
|
63
|
+
<polygon fill="#4E5861" points="14.7,8.9 13.9,10.4 16.9,13 "/>
|
64
|
+
<polygon fill="#020304" points="7.6,0 9.1,3.5 11.3,7.4 14,10.4 12.5,6.8 9.7,3.4 "/>
|
65
|
+
<polygon fill="#3F4040" points="7.6,0 10.1,2.8 12.5,6.8 9.7,3.4 "/>
|
66
|
+
<polygon fill="#111E2E" points="12.6,10.3 15.1,14.2 14,10.4 13.8,10.4 "/>
|
67
|
+
<polygon fill="#1B2837" points="11.3,7.4 12.6,10.3 14,10.4 "/>
|
68
|
+
<polygon fill="#585D61" points="14.7,8.9 12.5,6.8 14,10.4 "/>
|
69
|
+
<polygon fill="#848687" points="10.1,2.8 12.3,6.1 14.7,8.9 12.5,6.8 "/>
|
70
|
+
<polyline fill="#183553" points="14,10.4 16.9,13 15.1,14.2 14,10.4 "/>
|
71
|
+
<polygon fill="#8B9DB0" points="15.1,9.7 16.1,11.3 16.1,11.3 16.9,13 15.9,11.2 "/>
|
72
|
+
</g>
|
73
|
+
</svg>
|
@@ -0,0 +1,91 @@
|
|
1
|
+
(function(document, window, cleanWhiteSpace, $, Overlay, ClassToggler, Tabs, Anchor, RadioToggle){
|
2
|
+
"use strict";
|
3
|
+
|
4
|
+
function App(){
|
5
|
+
|
6
|
+
var toggleLinks = document.querySelectorAll(".js-toggle__link");
|
7
|
+
|
8
|
+
for (var i = toggleLinks.length - 1; i >= 0; i--) {
|
9
|
+
var toggleLink = toggleLinks[i];
|
10
|
+
toggleLink.addEventListener("click", clickToggle, false);
|
11
|
+
};
|
12
|
+
|
13
|
+
var sidebarNavLinks = document.querySelectorAll(".js-sidebar-nav-link");
|
14
|
+
|
15
|
+
for (var i = sidebarNavLinks.length - 1; i >= 0; i--) {
|
16
|
+
var sidebarNavLink = sidebarNavLinks[i];
|
17
|
+
sidebarNavLink.addEventListener("click", sideBarToggle, false);
|
18
|
+
};
|
19
|
+
|
20
|
+
if(!$("html").hasClass("ie8")) {
|
21
|
+
cleanWhiteSpace(document.querySelectorAll('pre code'));
|
22
|
+
}
|
23
|
+
|
24
|
+
var stickySidebar = function() {
|
25
|
+
var $sidebar = $(".js-sticky");
|
26
|
+
if(!$sidebar.length) return;
|
27
|
+
var offset = $sidebar.offset();
|
28
|
+
|
29
|
+
$(window).on("scroll", function(){
|
30
|
+
var winTop = $(window).scrollTop();
|
31
|
+
set(winTop);
|
32
|
+
});
|
33
|
+
|
34
|
+
function set(winTop){
|
35
|
+
if (offset.top < winTop) {
|
36
|
+
$sidebar.addClass("stuck");
|
37
|
+
} else {
|
38
|
+
$sidebar.removeClass("stuck");
|
39
|
+
}
|
40
|
+
}
|
41
|
+
}
|
42
|
+
|
43
|
+
stickySidebar();
|
44
|
+
|
45
|
+
var overlays = [];
|
46
|
+
|
47
|
+
$(".js-open-overlay").each(function(e){
|
48
|
+
overlays.push(
|
49
|
+
new Overlay({
|
50
|
+
openButton: $(".js-open-overlay[modifier='"+$(this).attr('modifier')+"']"),
|
51
|
+
overlay: $(".us-overlay-parent[modifier='"+$(this).attr('modifier')+"']")
|
52
|
+
})
|
53
|
+
)
|
54
|
+
});
|
55
|
+
|
56
|
+
var tooltips = new ClassToggler({
|
57
|
+
containerClass: '.us-tooltip',
|
58
|
+
$target: $('.us-tooltip__icon'),
|
59
|
+
activeClass: "us-tooltip--active"
|
60
|
+
});
|
61
|
+
|
62
|
+
var tabs = new Tabs({collapsible: true, autoScroll: false});
|
63
|
+
var radio = new RadioToggle();
|
64
|
+
var anchor = new Anchor({
|
65
|
+
target: document.querySelector(".js-example-anchor"),
|
66
|
+
content: document.querySelector(".js-example-anchor__target")
|
67
|
+
});
|
68
|
+
}
|
69
|
+
|
70
|
+
function clickToggle(event){
|
71
|
+
var toggleLink = event.currentTarget;
|
72
|
+
var target = document.querySelector("." + toggleLink.getAttribute("data-target"));
|
73
|
+
var targetActiveClass = getActiveClass(target);
|
74
|
+
var activeClass = getActiveClass(toggleLink);
|
75
|
+
toggleLink.classList.toggle(activeClass);
|
76
|
+
target.classList.toggle(targetActiveClass);
|
77
|
+
}
|
78
|
+
|
79
|
+
function sideBarToggle(event){
|
80
|
+
event.preventDefault();
|
81
|
+
var sidebarSubNav = event.currentTarget.parentElement;
|
82
|
+
sidebarSubNav.classList.toggle("active");
|
83
|
+
}
|
84
|
+
|
85
|
+
function getActiveClass(selector){
|
86
|
+
return selector.classList[0] + "--active";
|
87
|
+
}
|
88
|
+
|
89
|
+
return new App();
|
90
|
+
|
91
|
+
})(document, window, cleanWhiteSpace, $, Overlay, ClassToggler, Tabs, Anchor, RadioToggle);
|
@@ -0,0 +1,34 @@
|
|
1
|
+
function cleanWhiteSpace(codeBlocks){
|
2
|
+
if (!codeBlocks) return;
|
3
|
+
|
4
|
+
for (var i = codeBlocks.length - 1; i >= 0; i--) {
|
5
|
+
var codeBlock = codeBlocks[i],
|
6
|
+
lines, offset;
|
7
|
+
|
8
|
+
var text = codeBlock.textContent || codeBlock.innerText;
|
9
|
+
|
10
|
+
lines = text.split( '\n' );
|
11
|
+
|
12
|
+
if ( lines.length > 1 && lines[ lines.length - 1 ].trim() === '' ){
|
13
|
+
lines.pop();
|
14
|
+
}
|
15
|
+
|
16
|
+
var canClean = lines[1] != undefined;
|
17
|
+
|
18
|
+
if (canClean) {
|
19
|
+
// how much white-space do we need to remove form each line?
|
20
|
+
offset = lines[ 1 ].match( /^\s*/ )[ 0 ].length;
|
21
|
+
|
22
|
+
// remove the excess white-space from the beginning of each line
|
23
|
+
lines = lines.map( function ( line ) {
|
24
|
+
return line.slice( offset );
|
25
|
+
});
|
26
|
+
|
27
|
+
lines.shift();
|
28
|
+
|
29
|
+
codeBlock.textContent = lines.join( '\n' );
|
30
|
+
}
|
31
|
+
|
32
|
+
hljs.highlightBlock(codeBlock);
|
33
|
+
};
|
34
|
+
}
|