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
@@ -0,0 +1,117 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var dss = require("dss"),
|
4
|
+
crypto = require("crypto"),
|
5
|
+
marked = require('marked'),
|
6
|
+
escaped = require("underscore.string/escapeHTML");
|
7
|
+
|
8
|
+
module.exports = {
|
9
|
+
|
10
|
+
/**
|
11
|
+
* Register DSS parsers
|
12
|
+
*
|
13
|
+
* @param {object} parsers - An object containing the declared parsers to register
|
14
|
+
*/
|
15
|
+
|
16
|
+
addParsers: function(parsers){
|
17
|
+
for(var key in parsers){
|
18
|
+
dss.parser(key, parsers[key]);
|
19
|
+
}
|
20
|
+
},
|
21
|
+
|
22
|
+
/**
|
23
|
+
* Removing ${modifiers} text from markup
|
24
|
+
*
|
25
|
+
* @param {string} escaped markup - The file to extract the variable values from
|
26
|
+
* @return {string} Escaped string without ${modifiers}
|
27
|
+
*/
|
28
|
+
|
29
|
+
addStateToExample: function(markup, state){
|
30
|
+
return markup.replace(/{\$modifiers}/g, state);
|
31
|
+
},
|
32
|
+
|
33
|
+
/**
|
34
|
+
* Removing ${modifiers} text from markup
|
35
|
+
*
|
36
|
+
* @param {string} escaped markup - The file to extract the variable values from
|
37
|
+
* @return {string} Escaped string without ${modifiers}
|
38
|
+
*/
|
39
|
+
removeModifiersFromMarkup: function(escaped){
|
40
|
+
return escaped.replace(/(\sclass=('|"){\$modifiers}('|")|\s{\$modifiers})/g, "");
|
41
|
+
},
|
42
|
+
|
43
|
+
/**
|
44
|
+
* Get parser for a file which will extract "@variable {name} - {description}"
|
45
|
+
*
|
46
|
+
* @param {object} file - The file to extract the variable values from
|
47
|
+
* @return {function} A DSS parser
|
48
|
+
*/
|
49
|
+
variableDssParser: function() {
|
50
|
+
|
51
|
+
var fileVariables = {},
|
52
|
+
fileVariablesRx = /^[\$|@]([a-zA-Z0-9_-]+):([^\;]+)\;/gim,
|
53
|
+
lineSplitRx = /(( - )+)/,
|
54
|
+
variables = {},
|
55
|
+
match, hash, tokens, name;
|
56
|
+
|
57
|
+
return function(i, line, block, css) {
|
58
|
+
hash = crypto.createHash('md5').update(css).digest('hex');
|
59
|
+
if (!fileVariables[hash]) {
|
60
|
+
while ((match = fileVariablesRx.exec(css)) !== null) {
|
61
|
+
variables[match[1].trim()] = match[2].trim();
|
62
|
+
}
|
63
|
+
fileVariables[hash] = variables;
|
64
|
+
}
|
65
|
+
|
66
|
+
// Extract name and any delimiter with description
|
67
|
+
tokens = line.split(lineSplitRx, 2);
|
68
|
+
name = tokens[0].trim();
|
69
|
+
if (variables.hasOwnProperty(name)) {
|
70
|
+
return {
|
71
|
+
name: name,
|
72
|
+
// Description is line with name and any delimiter replaced
|
73
|
+
description: line.replace(tokens.join(''), ''),
|
74
|
+
value: variables[name]
|
75
|
+
};
|
76
|
+
}
|
77
|
+
};
|
78
|
+
},
|
79
|
+
/**
|
80
|
+
* Read over multiple description lines and return a markdown version
|
81
|
+
*
|
82
|
+
* @param {number} i - line number
|
83
|
+
* @param {string} line - Line matching parser
|
84
|
+
* @param {string} block - Entire block of text matching
|
85
|
+
* @return {string} A markdown version of the description
|
86
|
+
*/
|
87
|
+
descriptionDssParser: function(i, line, block){
|
88
|
+
var nextParserIndex = block.indexOf("@", i+1),
|
89
|
+
markupLength = nextParserIndex > -1 ? nextParserIndex - i : block.length,
|
90
|
+
markup = block.split('')
|
91
|
+
.splice(i, markupLength)
|
92
|
+
.join('')
|
93
|
+
.replace(/\n/g, '\n\n')
|
94
|
+
.replace(/@description/, '');
|
95
|
+
|
96
|
+
return marked(markup);
|
97
|
+
},
|
98
|
+
|
99
|
+
/**
|
100
|
+
* Read over multiple lines and return a javascript code snippet
|
101
|
+
*
|
102
|
+
* @param {number} i - line number
|
103
|
+
* @param {string} line - Line matching parser
|
104
|
+
* @param {string} block - Entire block of text matching
|
105
|
+
* @return {string} JavaScript code snipper
|
106
|
+
*/
|
107
|
+
javascriptParser: function(i, line, block){
|
108
|
+
var nextParserIndex = block.indexOf("@", i+1),
|
109
|
+
markupLength = nextParserIndex > -1 ? nextParserIndex - i : block.length,
|
110
|
+
markup = block.split('')
|
111
|
+
.splice(i, markupLength)
|
112
|
+
.join('')
|
113
|
+
.replace(/@javascript/, '');
|
114
|
+
|
115
|
+
return escaped(markup);
|
116
|
+
}
|
117
|
+
};
|
@@ -0,0 +1,26 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var grunt = require('grunt');
|
4
|
+
|
5
|
+
module.exports = {
|
6
|
+
writeFile: function(file, dest, message){
|
7
|
+
var outputType = 'created',
|
8
|
+
oldFile = null;
|
9
|
+
|
10
|
+
if (grunt.file.exists(dest)) {
|
11
|
+
outputType = 'overwritten';
|
12
|
+
oldFile = grunt.file.read(dest);
|
13
|
+
}
|
14
|
+
|
15
|
+
if (oldFile !== file) {
|
16
|
+
grunt.file.write(dest, file);
|
17
|
+
grunt.log.writeln('✓ '+ message +' ' + outputType + ' at: ' + grunt.log.wordlist([dest], {color: 'cyan'}));
|
18
|
+
} else {
|
19
|
+
grunt.log.writeln('‣ '+ message +' unchanged');
|
20
|
+
}
|
21
|
+
},
|
22
|
+
|
23
|
+
isMarkdown: function(extension){
|
24
|
+
return extension === ".md";
|
25
|
+
}
|
26
|
+
}
|
@@ -0,0 +1,59 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var handlebars = require('handlebars'),
|
4
|
+
humanize = require('underscore.string/humanize');
|
5
|
+
|
6
|
+
function humanFileSize(size) {
|
7
|
+
if(size < 1024) return size;
|
8
|
+
var i = Math.floor( Math.log(size) / Math.log(1024) );
|
9
|
+
return new handlebars.SafeString( ( size / Math.pow(1024, i) ).toFixed(2) * 1 + '<span> ' + ['B', 'kB', 'MB', 'GB', 'TB'][i]+'</span>');
|
10
|
+
};
|
11
|
+
|
12
|
+
module.exports = {
|
13
|
+
registerHelpers: function(){
|
14
|
+
handlebars.registerHelper("humanize", function(name, options) {
|
15
|
+
return new handlebars.SafeString(humanize(name));
|
16
|
+
});
|
17
|
+
|
18
|
+
handlebars.registerHelper('json', function(context) {
|
19
|
+
return JSON.stringify(context);
|
20
|
+
});
|
21
|
+
|
22
|
+
handlebars.registerHelper("partial", function (name, options) {
|
23
|
+
// Get the partial with the given name. This is a string.
|
24
|
+
var partial = handlebars.partials[name];
|
25
|
+
|
26
|
+
// Return empty string if the partial is not defined
|
27
|
+
if (!partial) return "";
|
28
|
+
// Compile and call the partial with this as context
|
29
|
+
return new handlebars.SafeString(handlebars.compile(partial)(this));
|
30
|
+
});
|
31
|
+
|
32
|
+
handlebars.registerHelper('activeClass', function(name, attribute, context) {
|
33
|
+
var active = '';
|
34
|
+
if(name === context.data.root.page[attribute]) {
|
35
|
+
active = 'active'
|
36
|
+
}
|
37
|
+
return new handlebars.SafeString(active);
|
38
|
+
});
|
39
|
+
|
40
|
+
handlebars.registerHelper('isActive', function(name, attribute, context) {
|
41
|
+
if(name === attribute){
|
42
|
+
return context.fn(this);
|
43
|
+
}
|
44
|
+
return context.inverse(this);
|
45
|
+
});
|
46
|
+
|
47
|
+
handlebars.registerHelper('humanFileSize', function(size, context) {
|
48
|
+
return new handlebars.SafeString(humanFileSize(size));
|
49
|
+
});
|
50
|
+
|
51
|
+
handlebars.registerHelper('number', function(number, context) {
|
52
|
+
return new handlebars.SafeString(number.toPrecision(2));
|
53
|
+
});
|
54
|
+
|
55
|
+
handlebars.registerHelper('classSanitizer', function(klass){
|
56
|
+
return new handlebars.SafeString(klass.split('.')[1]);
|
57
|
+
});
|
58
|
+
}
|
59
|
+
};
|
@@ -0,0 +1,19 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
module.exports = function(grunt){
|
4
|
+
var browserSync = require("browser-sync");
|
5
|
+
|
6
|
+
grunt.registerTask("browserSync-init", function() {
|
7
|
+
var done = this.async();
|
8
|
+
browserSync({
|
9
|
+
server: "./docs",
|
10
|
+
notify: false
|
11
|
+
}, function (err, bs) {
|
12
|
+
done();
|
13
|
+
});
|
14
|
+
});
|
15
|
+
|
16
|
+
grunt.registerTask("browserSync-inject", function() {
|
17
|
+
browserSync.reload(["docs/css/main.css"]);
|
18
|
+
});
|
19
|
+
}
|
@@ -0,0 +1,72 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
module.exports = function(grunt){
|
4
|
+
|
5
|
+
grunt.registerMultiTask('builder', function() {
|
6
|
+
|
7
|
+
var handlebars = require('handlebars'),
|
8
|
+
async = require('async'),
|
9
|
+
path = require('path'),
|
10
|
+
fs = require('fs'),
|
11
|
+
template = require('../modules/templates'),
|
12
|
+
fileHelper = require('../modules/file'),
|
13
|
+
slugify = require("underscore.string/slugify"),
|
14
|
+
promise = this.async(),
|
15
|
+
files = this.files;
|
16
|
+
|
17
|
+
var options = this.options({
|
18
|
+
templates: './styleguide/**/*.tpl'
|
19
|
+
});
|
20
|
+
|
21
|
+
async.waterfall([
|
22
|
+
init,
|
23
|
+
generateStyleguide
|
24
|
+
], completeTask);
|
25
|
+
|
26
|
+
function completeTask(){
|
27
|
+
promise();
|
28
|
+
}
|
29
|
+
|
30
|
+
function init(callback){
|
31
|
+
template.registerHelpers();
|
32
|
+
generateTemplates(options.templates);
|
33
|
+
callback(null);
|
34
|
+
}
|
35
|
+
|
36
|
+
function generateStyleguide(callback){
|
37
|
+
files.forEach(function(file){
|
38
|
+
var dest = file.dest,
|
39
|
+
datum = grunt.file.readJSON(file.src[0]);
|
40
|
+
generatePages(datum, datum.pages, dest);
|
41
|
+
});
|
42
|
+
callback(null, 'done');
|
43
|
+
}
|
44
|
+
|
45
|
+
function generatePages(data, pages, dest){
|
46
|
+
pages.map(function(page){
|
47
|
+
var model = {
|
48
|
+
project: data.project,
|
49
|
+
navigation: data.navigation,
|
50
|
+
page: page,
|
51
|
+
pages: data.pages
|
52
|
+
};
|
53
|
+
var outputFilePath = dest + slugify(page.section) + "/" + page.page,
|
54
|
+
template = handlebars.compile(grunt.file.read(page.template))(model);
|
55
|
+
|
56
|
+
fileHelper.writeFile(template, outputFilePath, "Build");
|
57
|
+
});
|
58
|
+
}
|
59
|
+
|
60
|
+
function generateTemplates(templatePath){
|
61
|
+
var templates = {};
|
62
|
+
|
63
|
+
grunt.file.expand(templatePath).forEach(function(file){
|
64
|
+
var templateName = path.basename(file, '.tpl');
|
65
|
+
templates[templateName] = grunt.file.read(file);
|
66
|
+
});
|
67
|
+
|
68
|
+
handlebars.registerPartial(templates);
|
69
|
+
}
|
70
|
+
|
71
|
+
});
|
72
|
+
}
|
@@ -0,0 +1,290 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
// Expose
|
4
|
+
module.exports = function(grunt){
|
5
|
+
grunt.registerMultiTask('styleguide', 'Parse DSS comment blocks', function(){
|
6
|
+
|
7
|
+
var dss = require('dss'),
|
8
|
+
_ = require('lodash'),
|
9
|
+
async = require('async'),
|
10
|
+
path = require('path'),
|
11
|
+
fs = require('fs'),
|
12
|
+
dssHelper = require('../modules/dss-helper'),
|
13
|
+
fileHelper = require('../modules/file'),
|
14
|
+
humanize = require("underscore.string/humanize"),
|
15
|
+
underscored = require("underscore.string/underscored"),
|
16
|
+
slugify = require("underscore.string/slugify"),
|
17
|
+
matter = require("gray-matter"),
|
18
|
+
cssstats = require('cssstats'),
|
19
|
+
StyleStats = require('stylestats'),
|
20
|
+
marked = require('marked'),
|
21
|
+
semver = require('semver'),
|
22
|
+
exec = require('child_process').exec,
|
23
|
+
simpleGit = require('simple-git')( path.resolve('.') ),
|
24
|
+
promise = this.async(),
|
25
|
+
files = this.files,
|
26
|
+
outputFilePath = this.data.output,
|
27
|
+
styleguidePath = this.data.dir,
|
28
|
+
contentPath = path.join(styleguidePath, "content"),
|
29
|
+
templatePath = path.join(styleguidePath, "templates"),
|
30
|
+
cssStatsFile = this.data.statsFor,
|
31
|
+
tagStartVersion = this.data.tagStartVersion,
|
32
|
+
tagPlaceholder = this.data.tagPlaceholder,
|
33
|
+
styleguide = [];
|
34
|
+
|
35
|
+
var options = this.options({
|
36
|
+
template: "styleguide.tpl",
|
37
|
+
contentTemplate: "simple.tpl",
|
38
|
+
parsers: {
|
39
|
+
variable: dssHelper.variableDssParser(),
|
40
|
+
partial: function(i, line, block){ return line; },
|
41
|
+
page: function(i, line, block){ return line; },
|
42
|
+
description: dssHelper.descriptionDssParser,
|
43
|
+
javascript: dssHelper.javascriptParser
|
44
|
+
}
|
45
|
+
});
|
46
|
+
|
47
|
+
async.waterfall([
|
48
|
+
init,
|
49
|
+
parseDSS,
|
50
|
+
groupDSS,
|
51
|
+
generateStaticContent,
|
52
|
+
generateStyleguide,
|
53
|
+
generateStats,
|
54
|
+
writeFile
|
55
|
+
], completeTask);
|
56
|
+
|
57
|
+
function completeTask(){
|
58
|
+
promise();
|
59
|
+
}
|
60
|
+
|
61
|
+
function init(callback){
|
62
|
+
dssHelper.addParsers(options.parsers);
|
63
|
+
callback(null);
|
64
|
+
}
|
65
|
+
|
66
|
+
function parseDSS(callback){
|
67
|
+
var styleguide = [];
|
68
|
+
var srcFiles = files[0].src;
|
69
|
+
|
70
|
+
srcFiles.forEach(function(file){
|
71
|
+
dss.parse(grunt.file.read(file), { file: file }, function(parsed) {
|
72
|
+
|
73
|
+
// Continue only if file contains DSS annotation
|
74
|
+
if (parsed.blocks.length) {
|
75
|
+
// Add comment block to styleguide
|
76
|
+
parsed.blocks.map(function(block){
|
77
|
+
|
78
|
+
block['path'] = file;
|
79
|
+
block['file'] = path.basename(file);
|
80
|
+
block['link'] = underscored(slugify(block['name']));
|
81
|
+
|
82
|
+
// Normalize @state and @variable to array
|
83
|
+
['state', 'variable'].forEach(function(prop) {
|
84
|
+
if (block.hasOwnProperty(prop) && typeof block[prop].slice !== 'function') {
|
85
|
+
block[prop] = [block[prop]];
|
86
|
+
}
|
87
|
+
});
|
88
|
+
|
89
|
+
if(block.markup){
|
90
|
+
block.markup.escaped = dssHelper.removeModifiersFromMarkup(block.markup.escaped);
|
91
|
+
}
|
92
|
+
|
93
|
+
if(block.hasOwnProperty('state')){
|
94
|
+
block.state.map(function(state){
|
95
|
+
state.markup = {
|
96
|
+
example: dssHelper.addStateToExample(block.markup.example, state.escaped)
|
97
|
+
}
|
98
|
+
})
|
99
|
+
}
|
100
|
+
});
|
101
|
+
styleguide.push(parsed.blocks);
|
102
|
+
}
|
103
|
+
});
|
104
|
+
});
|
105
|
+
callback(null, styleguide);
|
106
|
+
}
|
107
|
+
|
108
|
+
function groupDSS(styleguide, callback){
|
109
|
+
var sections = _.chain(styleguide).flatten().groupBy('page')
|
110
|
+
.map(function(value, key) {
|
111
|
+
|
112
|
+
var structure = key.split("/"),
|
113
|
+
section = slugify(structure[0]),
|
114
|
+
page = structure[1];
|
115
|
+
|
116
|
+
return {
|
117
|
+
name: page,
|
118
|
+
page: slugify(page) + '.html',
|
119
|
+
template: _getTemplate(options.template),
|
120
|
+
section: slugify(section),
|
121
|
+
blocks: value
|
122
|
+
}
|
123
|
+
})
|
124
|
+
// As it's iterating over files, we don't want files that aren't documented to come through
|
125
|
+
.filter(function(object) { return object.section != "undefined" }).compact().value();
|
126
|
+
callback(null, sections);
|
127
|
+
}
|
128
|
+
|
129
|
+
function generateStaticContent(sections, callback) {
|
130
|
+
|
131
|
+
var pages = grunt.file.expand(contentPath + "/**/*")
|
132
|
+
.filter(function(dir){
|
133
|
+
var stats = fs.lstatSync(dir);
|
134
|
+
return !stats.isDirectory();
|
135
|
+
})
|
136
|
+
.map(function(file){
|
137
|
+
var data = matter.read(file),
|
138
|
+
extension = path.extname(file),
|
139
|
+
section = path.dirname(file).replace((new RegExp(contentPath + "\/?", "g")), ""),
|
140
|
+
filename = path.basename(file, extension);
|
141
|
+
|
142
|
+
return {
|
143
|
+
name: data.data.name || humanize(filename),
|
144
|
+
page: filename + '.html',
|
145
|
+
template: _getTemplate(data.data.template || options.contentTemplate),
|
146
|
+
section: section,
|
147
|
+
content: (fileHelper.isMarkdown(extension) ? marked(data.content) : data.content)
|
148
|
+
}
|
149
|
+
});
|
150
|
+
|
151
|
+
var data = _sortyByIndex(pages).concat(sections);
|
152
|
+
|
153
|
+
callback(null, _sortyByIndex(data));
|
154
|
+
}
|
155
|
+
|
156
|
+
function generateStyleguide(sections, callback){
|
157
|
+
var model = {
|
158
|
+
pages: sections,
|
159
|
+
navigation: _getSection(sections),
|
160
|
+
project: grunt.file.readJSON('package.json')
|
161
|
+
}
|
162
|
+
|
163
|
+
callback(null, model);
|
164
|
+
}
|
165
|
+
|
166
|
+
function generateStats(model, callback) {
|
167
|
+
var cssFileData, selectors, cssParser,
|
168
|
+
omitEntries, statsPage, cachedStatsFile;
|
169
|
+
|
170
|
+
cachedStatsFile = 'tmp/.stats-cache';
|
171
|
+
|
172
|
+
statsPage = {
|
173
|
+
name: 'Stats',
|
174
|
+
page: 'stats.html',
|
175
|
+
section: 'pattern-library',
|
176
|
+
content: {report: []},
|
177
|
+
template: 'styleguide/templates/stats.tpl',
|
178
|
+
};
|
179
|
+
|
180
|
+
//Get the latest tag, if the tag is different from the cached one
|
181
|
+
//fetch new data.
|
182
|
+
exec('git describe --tags `git rev-list --tags --max-count=1`',
|
183
|
+
function(error, stdout, sterr) {
|
184
|
+
var latestTag = semver.clean(stdout);
|
185
|
+
var data;
|
186
|
+
|
187
|
+
try {
|
188
|
+
data = grunt.file.readJSON(cachedStatsFile);
|
189
|
+
var latestVersion = data[0].version;
|
190
|
+
if(data[0] && data[0].version && semver.eq(latestVersion, latestTag)) {
|
191
|
+
statsPage.content.report = data;
|
192
|
+
next();
|
193
|
+
}else {
|
194
|
+
fetchNewStatsData();
|
195
|
+
}
|
196
|
+
}
|
197
|
+
catch(err) {
|
198
|
+
// File does't exist or wrong format.
|
199
|
+
fetchNewStatsData()
|
200
|
+
}
|
201
|
+
}
|
202
|
+
);
|
203
|
+
|
204
|
+
function fetchNewStatsData() {
|
205
|
+
async.waterfall([
|
206
|
+
getTags,
|
207
|
+
getStylesListing,
|
208
|
+
getStats,
|
209
|
+
], next);
|
210
|
+
}
|
211
|
+
|
212
|
+
function getTags(callback) {
|
213
|
+
simpleGit.tags(function(err, tags) {
|
214
|
+
callback(null, tags);
|
215
|
+
});
|
216
|
+
}
|
217
|
+
|
218
|
+
function getStylesListing(tags, callback) {
|
219
|
+
var styleListing = tags.all.map(function(tag){
|
220
|
+
var cleanTag = semver.clean(tag);
|
221
|
+
if(cleanTag!=null && semver.gt(cleanTag, tagStartVersion)) {
|
222
|
+
return {
|
223
|
+
version: cleanTag,
|
224
|
+
path: cssStatsFile.replace(tagPlaceholder, cleanTag)
|
225
|
+
}
|
226
|
+
}
|
227
|
+
});
|
228
|
+
callback(null, _.compact(styleListing));
|
229
|
+
}
|
230
|
+
|
231
|
+
function getStats(styleListing, callback) {
|
232
|
+
omitEntries = [
|
233
|
+
'dataUriSize', 'ratioOfDataUriSize','lowestCohesion',
|
234
|
+
'lowestCohesionSelector', 'uniqueFontSize', 'uniqueFontFamily',
|
235
|
+
'propertiesCount', 'published', 'paths', 'mostIdentifierSelector',
|
236
|
+
'totalUniqueFontSizes', 'mostIdentifier', 'totalUniqueFontFamilies',
|
237
|
+
'totalUniqueColors', 'unqualifiedAttributeSelectors', 'floatProperties',
|
238
|
+
'uniqueColor'
|
239
|
+
];
|
240
|
+
|
241
|
+
async.map(styleListing,
|
242
|
+
function(entry, cb){
|
243
|
+
cssParser = new StyleStats(entry.path, {});
|
244
|
+
cssParser.parse(function(err, styleStatsData){
|
245
|
+
var generalReport = _.omit(styleStatsData,omitEntries);
|
246
|
+
if(Object.keys(generalReport).length) {
|
247
|
+
generalReport.version = entry.version;
|
248
|
+
statsPage.content.report.push(generalReport);
|
249
|
+
}
|
250
|
+
cb();
|
251
|
+
});
|
252
|
+
},
|
253
|
+
function(){
|
254
|
+
//Sort array
|
255
|
+
var sortedReport = statsPage.content.report.sort(function(a,b){
|
256
|
+
return semver.rcompare(a.version, b.version);
|
257
|
+
});
|
258
|
+
statsPage.content.report = sortedReport;
|
259
|
+
fileHelper.writeFile(JSON.stringify(sortedReport), cachedStatsFile, "Cached stats");
|
260
|
+
callback();
|
261
|
+
}
|
262
|
+
);
|
263
|
+
}
|
264
|
+
|
265
|
+
function next(){
|
266
|
+
model.pages.push(statsPage);
|
267
|
+
callback(null, model);
|
268
|
+
}
|
269
|
+
}
|
270
|
+
|
271
|
+
function _getSection(sections){
|
272
|
+
return _.chain(sections).map(function(data){ return slugify(data.section) }).compact().uniq().value();
|
273
|
+
}
|
274
|
+
|
275
|
+
function _sortyByIndex(sections){
|
276
|
+
return sections.sort(function(a, b){
|
277
|
+
return (a.page == "index.html" ? -1 : 1);
|
278
|
+
})
|
279
|
+
}
|
280
|
+
|
281
|
+
function _getTemplate(name){
|
282
|
+
return path.join(templatePath, name);
|
283
|
+
}
|
284
|
+
|
285
|
+
function writeFile(model, callback){
|
286
|
+
fileHelper.writeFile(JSON.stringify(model), outputFilePath, "Styleguide");
|
287
|
+
callback(null, 'done');
|
288
|
+
}
|
289
|
+
});
|
290
|
+
};
|
@@ -0,0 +1,57 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
module.exports = function(grunt){
|
4
|
+
grunt.registerMultiTask('svg2png', 'Convert SVG to PNGs', function(){
|
5
|
+
|
6
|
+
var svg_to_png = require('svg-to-png'),
|
7
|
+
path = require('path'),
|
8
|
+
fs = require('fs'),
|
9
|
+
async = require('async'),
|
10
|
+
fileHelper = require('../modules/file'),
|
11
|
+
Promise = require('bluebird'),
|
12
|
+
dest = this.data.src,
|
13
|
+
files = grunt.file.expand(dest + "**/*.svg"),
|
14
|
+
done = this.async(),
|
15
|
+
tmpPath = "tmp/",
|
16
|
+
sizes = this.data.sizes,
|
17
|
+
promises = [];
|
18
|
+
|
19
|
+
deleteFolderRecursive(tmpPath);
|
20
|
+
|
21
|
+
files.forEach(function(file){
|
22
|
+
var svg = grunt.file.read(file);
|
23
|
+
var newSvg = svg.replace(/width=\"[0-9]+\" height=\"[0-9]+\"/, '');
|
24
|
+
fileHelper.writeFile(newSvg, tmpPath + path.basename(file), "Icon");
|
25
|
+
});
|
26
|
+
|
27
|
+
sizes.forEach(function(size){
|
28
|
+
var sizing = size.split(" ");
|
29
|
+
var sizeX = sizing[0];
|
30
|
+
var sizeY = sizing[1];
|
31
|
+
var tmpFiles = grunt.file.expand(tmpPath + "**/*.svg");
|
32
|
+
promises.push(convert(tmpFiles, sizeX, sizeY))
|
33
|
+
});
|
34
|
+
|
35
|
+
Promise.all(promises).then(function(){
|
36
|
+
done();
|
37
|
+
});
|
38
|
+
|
39
|
+
function convert(files, sizeX, sizeY){
|
40
|
+
return svg_to_png.convert(files, path.join( dest + sizeX + "px"), {defaultWidth: sizeX, defaultHeight: sizeY, compress: true})
|
41
|
+
}
|
42
|
+
|
43
|
+
function deleteFolderRecursive(path){
|
44
|
+
if( fs.existsSync(path) ) {
|
45
|
+
fs.readdirSync(path).forEach(function(file,index){
|
46
|
+
var curPath = path + "/" + file;
|
47
|
+
if(fs.lstatSync(curPath).isDirectory()) { // recurse
|
48
|
+
deleteFolderRecursive(curPath);
|
49
|
+
} else { // delete file
|
50
|
+
fs.unlinkSync(curPath);
|
51
|
+
}
|
52
|
+
});
|
53
|
+
fs.rmdirSync(path);
|
54
|
+
}
|
55
|
+
}
|
56
|
+
});
|
57
|
+
}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require "aws-sdk"
|
2
|
+
|
3
|
+
module Ustyle
|
4
|
+
REGION = 'eu-west-1'
|
5
|
+
BUCKET = 'uswitch-assets-eu'
|
6
|
+
CLOUDFRONT_DISTRIBUTION = 'E3F1XI0HIG20E0'
|
7
|
+
|
8
|
+
def self.s3_upload to, from, content_type, bucket = BUCKET
|
9
|
+
bucket = s3.bucket(bucket)
|
10
|
+
object = bucket.object(to)
|
11
|
+
object.put(body: open(from), content_type: content_type, acl: 'public-read')
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.invalidate files
|
15
|
+
cloudfront = Aws::CloudFront::Client.new(region: REGION)
|
16
|
+
cloudfront.create_invalidation(
|
17
|
+
distribution_id: CLOUDFRONT_DISTRIBUTION,
|
18
|
+
invalidation_batch: {
|
19
|
+
paths: {
|
20
|
+
quantity: files.length,
|
21
|
+
items: files
|
22
|
+
},
|
23
|
+
caller_reference: "ustyle invalidation at #{Time.now.to_s}"
|
24
|
+
}
|
25
|
+
)
|
26
|
+
end
|
27
|
+
|
28
|
+
def self.s3
|
29
|
+
@conn ||= Aws::S3::Resource.new(region: REGION)
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'autoprefixer-rails'
|
2
|
+
|
3
|
+
module Ustyle
|
4
|
+
class Engine < ::Rails::Engine
|
5
|
+
add_paths_block = lambda { |app|
|
6
|
+
Ustyle.asset_directories.each do |asset_directory|
|
7
|
+
app.config.assets.paths << File.join(Ustyle.assets_path, asset_directory)
|
8
|
+
end
|
9
|
+
}
|
10
|
+
|
11
|
+
initializer "ustyle.assets.precompile" do |app|
|
12
|
+
app.config.assets.precompile += %w( icons/**.* )
|
13
|
+
end
|
14
|
+
|
15
|
+
initializer "ustyle.update_asset_paths", &add_paths_block
|
16
|
+
initializer "ustyle.update_asset_paths", group: :assets, &add_paths_block
|
17
|
+
end
|
18
|
+
|
19
|
+
class Railtie < ::Rails::Railtie
|
20
|
+
initializer :setup_autoprefixer, group: :all do |app|
|
21
|
+
AutoprefixerRails.install(app.assets, *Ustyle.autoprefixer_config(app))
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|