reustyle 2.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.drone.yml +17 -0
- data/.gitignore +25 -0
- data/.nvmrc +1 -0
- data/.rbenv-gemsets +1 -0
- data/.ruby-version +1 -0
- data/CONTRIBUTING.md +68 -0
- data/Gemfile +4 -0
- data/Gruntfile.js +234 -0
- data/LICENSE.txt +13 -0
- data/README.md +196 -0
- data/Rakefile +6 -0
- data/bower.json +54 -0
- data/config/autoprefixer.yml +6 -0
- data/config/scss-lint.yml +55 -0
- data/dist/icons.svg +1 -0
- data/dist/ustyle-content.css +1 -0
- data/dist/ustyle-latest.css +1 -0
- data/dist/ustyle.js +567 -0
- data/dist/ustyle.json +1 -0
- data/dist/ustyle.min.js +1 -0
- data/grunt/modules/dss-helper.js +115 -0
- data/grunt/modules/file.js +24 -0
- data/grunt/modules/html-parser.js +22 -0
- data/grunt/modules/templates.js +57 -0
- data/grunt/tasks/browser-sync.js +23 -0
- data/grunt/tasks/builder.js +67 -0
- data/grunt/tasks/styleguide.js +299 -0
- data/index.js +37 -0
- data/lib/ustyle/deploy.rb +41 -0
- data/lib/ustyle/engine.rb +32 -0
- data/lib/ustyle/hash.rb +44 -0
- data/lib/ustyle/helpers/icon_helper.rb +15 -0
- data/lib/ustyle/icons.rb +13 -0
- data/lib/ustyle/middleware/icon_middleware.rb +27 -0
- data/lib/ustyle/sass_functions.rb +65 -0
- data/lib/ustyle/sinatra.rb +34 -0
- data/lib/ustyle/sprockets.rb +6 -0
- data/lib/ustyle/utils.rb +42 -0
- data/lib/ustyle/version.rb +4 -0
- data/lib/ustyle.rb +58 -0
- data/package-lock.json +9303 -0
- data/package.json +89 -0
- data/styleguide/CNAME +1 -0
- data/styleguide/assets/images/CTAs.png +0 -0
- data/styleguide/assets/images/badge-label-usp.png +0 -0
- data/styleguide/assets/images/bower-logo.png +0 -0
- data/styleguide/assets/images/caveat.png +0 -0
- data/styleguide/assets/images/cloudfront-logo.png +0 -0
- data/styleguide/assets/images/design-conventions.png +0 -0
- data/styleguide/assets/images/error-texts.png +0 -0
- data/styleguide/assets/images/external-requirements.png +0 -0
- data/styleguide/assets/images/favicon/android-chrome-192x192.png +0 -0
- data/styleguide/assets/images/favicon/android-chrome-512x512.png +0 -0
- data/styleguide/assets/images/favicon/apple-touch-icon-114x114.png +0 -0
- data/styleguide/assets/images/favicon/apple-touch-icon-120x120.png +0 -0
- data/styleguide/assets/images/favicon/apple-touch-icon-144x144.png +0 -0
- data/styleguide/assets/images/favicon/apple-touch-icon-152x152.png +0 -0
- data/styleguide/assets/images/favicon/apple-touch-icon-180x180.png +0 -0
- data/styleguide/assets/images/favicon/apple-touch-icon-57x57.png +0 -0
- data/styleguide/assets/images/favicon/apple-touch-icon-60x60.png +0 -0
- data/styleguide/assets/images/favicon/apple-touch-icon-72x72.png +0 -0
- data/styleguide/assets/images/favicon/apple-touch-icon-76x76.png +0 -0
- data/styleguide/assets/images/favicon/apple-touch-icon.png +0 -0
- data/styleguide/assets/images/favicon/browserconfig.xml +9 -0
- data/styleguide/assets/images/favicon/favicon-16x16.png +0 -0
- data/styleguide/assets/images/favicon/favicon-32x32.png +0 -0
- data/styleguide/assets/images/favicon/favicon.ico +0 -0
- data/styleguide/assets/images/favicon/manifest.json +18 -0
- data/styleguide/assets/images/favicon/mstile-144x144.png +0 -0
- data/styleguide/assets/images/favicon/mstile-150x150.png +0 -0
- data/styleguide/assets/images/favicon/mstile-310x150.png +0 -0
- data/styleguide/assets/images/favicon/mstile-310x310.png +0 -0
- data/styleguide/assets/images/favicon/mstile-70x70.png +0 -0
- data/styleguide/assets/images/favicon/safari-pinned-tab.svg +46 -0
- data/styleguide/assets/images/icons.svg +1 -0
- data/styleguide/assets/images/infographic-01.png +0 -0
- data/styleguide/assets/images/infographic-02.png +0 -0
- data/styleguide/assets/images/npm-logo.png +0 -0
- data/styleguide/assets/images/placeholder-text.png +0 -0
- data/styleguide/assets/images/ruby-logo.png +0 -0
- data/styleguide/assets/images/site-consistency01.png +0 -0
- data/styleguide/assets/images/site-consistency02.png +0 -0
- data/styleguide/assets/images/site-consistency03.png +0 -0
- data/styleguide/assets/images/styleguide-examples/accurate-housing.jpg +0 -0
- data/styleguide/assets/images/styleguide-examples/altered.jpg +0 -0
- data/styleguide/assets/images/styleguide-examples/bad-subject.jpg +0 -0
- data/styleguide/assets/images/styleguide-examples/centered.jpg +0 -0
- data/styleguide/assets/images/styleguide-examples/cliche.jpg +0 -0
- data/styleguide/assets/images/styleguide-examples/cold.jpg +0 -0
- data/styleguide/assets/images/styleguide-examples/good-subject.jpg +0 -0
- data/styleguide/assets/images/styleguide-examples/illustrations_1.png +0 -0
- data/styleguide/assets/images/styleguide-examples/illustrations_2.png +0 -0
- data/styleguide/assets/images/styleguide-examples/illustrations_3.png +0 -0
- data/styleguide/assets/images/styleguide-examples/illustrations_4.png +0 -0
- data/styleguide/assets/images/styleguide-examples/illustrations_5.png +0 -0
- data/styleguide/assets/images/styleguide-examples/illustrations_6.png +0 -0
- data/styleguide/assets/images/styleguide-examples/innaccurate-housing.jpg +0 -0
- data/styleguide/assets/images/styleguide-examples/natural-1.jpg +0 -0
- data/styleguide/assets/images/styleguide-examples/natural-2.jpg +0 -0
- data/styleguide/assets/images/styleguide-examples/natural-3.jpg +0 -0
- data/styleguide/assets/images/styleguide-examples/not-centered.jpg +0 -0
- data/styleguide/assets/images/styleguide-examples/realistic.jpg +0 -0
- data/styleguide/assets/images/styleguide-examples/unaltered.jpg +0 -0
- data/styleguide/assets/images/styleguide-examples/unnatural-1.jpg +0 -0
- data/styleguide/assets/images/styleguide-examples/unnatural-2.jpg +0 -0
- data/styleguide/assets/images/styleguide-examples/unnatural-3.jpg +0 -0
- data/styleguide/assets/images/styleguide-examples/warm.jpg +0 -0
- data/styleguide/assets/images/tone-framework.png +0 -0
- data/styleguide/assets/images/tone.png +0 -0
- data/styleguide/assets/images/tooltip.png +0 -0
- data/styleguide/assets/images/tsandcs.png +0 -0
- data/styleguide/assets/images/ustyle.svg +73 -0
- data/styleguide/assets/images/ux-conventions-consistency.png +0 -0
- data/styleguide/assets/images/ux-conventions-error.png +0 -0
- data/styleguide/assets/images/ux-conventions-errors.png +0 -0
- data/styleguide/assets/images/ux-conventions-flexibility.png +0 -0
- data/styleguide/assets/images/ux-conventions-freedom.png +0 -0
- data/styleguide/assets/images/ux-conventions-minimalist.png +0 -0
- data/styleguide/assets/images/ux-conventions-real-world.png +0 -0
- data/styleguide/assets/images/ux-conventions-recognition.png +0 -0
- data/styleguide/assets/images/ux-conventions-visibility.png +0 -0
- data/styleguide/assets/javascripts/app.js +115 -0
- data/styleguide/assets/javascripts/modules/stats.js +50 -0
- data/styleguide/assets/javascripts/vendor/highlight.js +1 -0
- data/styleguide/assets/javascripts/vendor/svg4everybody.js +1 -0
- data/styleguide/assets/sass/main.scss +42 -0
- data/styleguide/assets/sass/modules/_code.scss +8 -0
- data/styleguide/assets/sass/modules/_colours.scss +26 -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/_images.scss +24 -0
- data/styleguide/assets/sass/modules/_links.scss +3 -0
- data/styleguide/assets/sass/modules/_logo.scss +182 -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 +138 -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/logo.tpl +279 -0
- data/styleguide/content/design/accessibility-testing.md +82 -0
- data/styleguide/content/design/index.tpl +367 -0
- data/styleguide/content/design/typography.md +68 -0
- data/styleguide/content/design/validating-designs.tpl +304 -0
- data/styleguide/content/index.tpl +51 -0
- data/styleguide/content/language/grammar.md +220 -0
- data/styleguide/content/language/microcopy.md +170 -0
- data/styleguide/content/language/tone.md +135 -0
- data/styleguide/content/pattern-library/grid.tpl +64 -0
- data/styleguide/content/pattern-library/index.tpl +88 -0
- data/styleguide/partials/_footer.tpl +8 -0
- data/styleguide/partials/_head.tpl +26 -0
- data/styleguide/partials/_header.tpl +37 -0
- data/styleguide/partials/_sidebar.tpl +27 -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 +25 -0
- data/styleguide/templates/stats.tpl +50 -0
- data/styleguide/templates/styleguide.tpl +36 -0
- data/tasks/publish.rake +67 -0
- data/ustyle.gemspec +32 -0
- data/vendor/assets/images/forms/checkbox-rebrand.svg +1 -0
- data/vendor/assets/images/forms/checkbox.svg +1 -0
- data/vendor/assets/images/icons/alarm.svg +1 -0
- data/vendor/assets/images/icons/android.svg +1 -0
- data/vendor/assets/images/icons/arrow-circle.svg +1 -0
- data/vendor/assets/images/icons/arrow-down.svg +1 -0
- data/vendor/assets/images/icons/arrow-up.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/chevron-left.svg +1 -0
- data/vendor/assets/images/icons/chevron-right.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/dashcam.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-brand.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-brand.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/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/lock.svg +1 -0
- data/vendor/assets/images/icons/magnify-in.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/network.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/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/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/save.svg +1 -0
- data/vendor/assets/images/icons/share.svg +1 -0
- data/vendor/assets/images/icons/shield.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-rebrand.svg +1 -0
- data/vendor/assets/images/icons/spinner.svg +1 -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/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-brand.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/xml.svg +1 -0
- data/vendor/assets/images/icons.svg +1 -0
- data/vendor/assets/javascripts/ustyle/backdrop.js +56 -0
- data/vendor/assets/javascripts/ustyle/classtoggler.js +76 -0
- data/vendor/assets/javascripts/ustyle/overlay.js +152 -0
- data/vendor/assets/javascripts/ustyle/tabs.js +166 -0
- data/vendor/assets/javascripts/ustyle/utils.js +113 -0
- data/vendor/assets/javascripts/ustyle.js +4 -0
- data/vendor/assets/stylesheets/rebrand-content.scss +1 -0
- data/vendor/assets/stylesheets/rebrand.scss +1 -0
- data/vendor/assets/stylesheets/ustyle/_all.scss +55 -0
- data/vendor/assets/stylesheets/ustyle/_content.scss +5 -0
- data/vendor/assets/stylesheets/ustyle/_global.scss +20 -0
- data/vendor/assets/stylesheets/ustyle/articles/_base.scss +100 -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 +213 -0
- data/vendor/assets/stylesheets/ustyle/articles/_related.scss +76 -0
- data/vendor/assets/stylesheets/ustyle/basics/_extends.scss +73 -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 +166 -0
- data/vendor/assets/stylesheets/ustyle/basics/variables/_colors.scss +94 -0
- data/vendor/assets/stylesheets/ustyle/basics/variables/_forms.scss +98 -0
- data/vendor/assets/stylesheets/ustyle/basics/variables/_icons.scss +43 -0
- data/vendor/assets/stylesheets/ustyle/components/_backdrop.scss +23 -0
- data/vendor/assets/stylesheets/ustyle/components/_breadcrumbs.scss +66 -0
- data/vendor/assets/stylesheets/ustyle/components/_button.scss +187 -0
- data/vendor/assets/stylesheets/ustyle/components/_calculator.scss +41 -0
- data/vendor/assets/stylesheets/ustyle/components/_comp-table-row.scss +341 -0
- data/vendor/assets/stylesheets/ustyle/components/_compliance-banner.scss +38 -0
- data/vendor/assets/stylesheets/ustyle/components/_content-group.scss +33 -0
- data/vendor/assets/stylesheets/ustyle/components/_cta.scss +66 -0
- data/vendor/assets/stylesheets/ustyle/components/_grid-classes.scss +52 -0
- data/vendor/assets/stylesheets/ustyle/components/_hero.scss +115 -0
- data/vendor/assets/stylesheets/ustyle/components/_links.scss +26 -0
- data/vendor/assets/stylesheets/ustyle/components/_lists-li.scss +92 -0
- data/vendor/assets/stylesheets/ustyle/components/_lists.scss +39 -0
- data/vendor/assets/stylesheets/ustyle/components/_loader.scss +139 -0
- data/vendor/assets/stylesheets/ustyle/components/_overlay.scss +183 -0
- data/vendor/assets/stylesheets/ustyle/components/_progress.scss +138 -0
- data/vendor/assets/stylesheets/ustyle/components/_promo-banner.scss +131 -0
- data/vendor/assets/stylesheets/ustyle/components/_reminder.scss +87 -0
- data/vendor/assets/stylesheets/ustyle/components/_tab-navigation.scss +114 -0
- data/vendor/assets/stylesheets/ustyle/components/_table-toolbar.scss +91 -0
- data/vendor/assets/stylesheets/ustyle/components/_tabs.scss +300 -0
- data/vendor/assets/stylesheets/ustyle/components/_tooltip.scss +243 -0
- data/vendor/assets/stylesheets/ustyle/components/_usp.scss +88 -0
- data/vendor/assets/stylesheets/ustyle/content/_base.scss +227 -0
- data/vendor/assets/stylesheets/ustyle/content/_c-header.scss +27 -0
- data/vendor/assets/stylesheets/ustyle/content/_c-social.scss +9 -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 +78 -0
- data/vendor/assets/stylesheets/ustyle/forms/_input-group.scss +154 -0
- data/vendor/assets/stylesheets/ustyle/forms/_input.scss +61 -0
- data/vendor/assets/stylesheets/ustyle/forms/_radio-checkbox.scss +144 -0
- data/vendor/assets/stylesheets/ustyle/forms/_reset.scss +21 -0
- data/vendor/assets/stylesheets/ustyle/forms/_select.scss +154 -0
- data/vendor/assets/stylesheets/ustyle/forms/_textarea.scss +33 -0
- data/vendor/assets/stylesheets/ustyle/forms/_toggle.scss +114 -0
- data/vendor/assets/stylesheets/ustyle/forms/_validation.scss +104 -0
- data/vendor/assets/stylesheets/ustyle/icons/_base.scss +241 -0
- data/vendor/assets/stylesheets/ustyle/mixins/_arrow.scss +51 -0
- data/vendor/assets/stylesheets/ustyle/mixins/_base.scss +7 -0
- data/vendor/assets/stylesheets/ustyle/mixins/_baseline.scss +43 -0
- data/vendor/assets/stylesheets/ustyle/mixins/_forms.scss +84 -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 +121 -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 +116 -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 +73 -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.scss +1 -0
- metadata +517 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 9ba3d932d07b7a852c9a3a9dcb229fef14599c37ded0f32dc272d2b0eaed6ba9
|
4
|
+
data.tar.gz: bd7b6b496118275ba7a3d7acd7d75c971ab9d9d5f49e48566357a276870ff717
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 2dc754699e78b534101118a72c46d5ba7f811bfc2bc67fbdc0a7561955335da974d46f2d509f3d4aecd8b1440fa9127fd169c2e7131f82220f00688656c5960a
|
7
|
+
data.tar.gz: 3ae0ed5d8c66a6551d4405ad0f9de4a21b7d6e75781e7214298d035bf3ebb3b1876de9a6e617a724fbe286758c620be5d242eeb463bef2dc74e05120e515a0cd
|
data/.drone.yml
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
pipeline:
|
2
|
+
build:
|
3
|
+
when:
|
4
|
+
event: push
|
5
|
+
branch: master
|
6
|
+
image: starefossen/ruby-node:2-8
|
7
|
+
commands:
|
8
|
+
- npm install --silent
|
9
|
+
- bundle install --binstubs
|
10
|
+
- npm run publish
|
11
|
+
|
12
|
+
publish:
|
13
|
+
when:
|
14
|
+
event: push
|
15
|
+
branch: master
|
16
|
+
image: plugins/gh-pages
|
17
|
+
secrets: [ github_username, github_password ]
|
data/.gitignore
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
.bundle
|
4
|
+
.config
|
5
|
+
.yardoc
|
6
|
+
Gemfile.lock
|
7
|
+
InstalledFiles
|
8
|
+
_yardoc
|
9
|
+
coverage
|
10
|
+
doc/
|
11
|
+
lib/bundler/man
|
12
|
+
pkg
|
13
|
+
rdoc
|
14
|
+
spec/reports
|
15
|
+
test/tmp
|
16
|
+
test/version_tmp
|
17
|
+
tmp
|
18
|
+
.DS_Store
|
19
|
+
*.sublime-*
|
20
|
+
docs/
|
21
|
+
.sass-cache/
|
22
|
+
node_modules/
|
23
|
+
build/
|
24
|
+
npm-debug.log
|
25
|
+
bin/
|
data/.nvmrc
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
8.9
|
data/.rbenv-gemsets
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ustyle
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.3.0
|
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,68 @@
|
|
1
|
+
# Contributing
|
2
|
+
|
3
|
+
### Code style
|
4
|
+
Please see [uStyle](http://ustyle.guide)
|
5
|
+
|
6
|
+
## Modifying the code
|
7
|
+
|
8
|
+
You have several options with regards to modifying, each of which come with their advantages and disadvantages.
|
9
|
+
|
10
|
+
### Documentation
|
11
|
+
|
12
|
+
Documentation must be written for any component you are actively working on. All documentation that isn't full page examples remains within the source code `.scss` files. We use [DSS](https://github.com/darcyclarke/DSS) for documenting components. This is done like this:
|
13
|
+
|
14
|
+
```scss
|
15
|
+
// @page Forms
|
16
|
+
// @name Inputs
|
17
|
+
//
|
18
|
+
// @description
|
19
|
+
// The standard form input, `.us-form-input`, styled with our brand colours. Explicitly
|
20
|
+
// classed to allow individual app styling for other inputs
|
21
|
+
//
|
22
|
+
// @state .large - Larger input style
|
23
|
+
//
|
24
|
+
// @markup
|
25
|
+
// <input class='us-form-input {$modifiers}' type='text'>
|
26
|
+
```
|
27
|
+
|
28
|
+
`{$modifiers}` is a placeholder where the different states get rendered. If the component you are documenting requires an additional, more complex, component that doesn't quite fit the basic `style_block.tpl` layout, you can declare a partial, like so:
|
29
|
+
|
30
|
+
```scss
|
31
|
+
@page Colours
|
32
|
+
@name Base colours
|
33
|
+
@partial colours
|
34
|
+
```
|
35
|
+
|
36
|
+
Then you can have a partial named `colours.tpl` in `partials/` and run with that.
|
37
|
+
|
38
|
+
All output of our documentation goes to `ustyle.json` in `build/`. This contains the JSON which is then parsed by our `builder.js` module and compiled to handlebars. All context within DSS is available on the templates.
|
39
|
+
|
40
|
+
### Method 1
|
41
|
+
|
42
|
+
1. Clone the existing repo.
|
43
|
+
1. Run `bundle install` to install all dependencies.
|
44
|
+
1. Create a new feature branch - do not work off `master`
|
45
|
+
1. Add in the features/fixes
|
46
|
+
1. Test -- this means running the gem locally on several projects. **Not just your own**
|
47
|
+
1. Commit with a *reasonable* commit message.
|
48
|
+
1. Submit a pull request and wait for it to be merged into master
|
49
|
+
|
50
|
+
|
51
|
+
### Method 2
|
52
|
+
|
53
|
+
**Warning: If you are unsure about using the publisher function, please use method 1. If you think you're super awesome and won't screw up uStyle versions, please read on.**
|
54
|
+
|
55
|
+
1. Clone existing repo
|
56
|
+
1. Run a `bundle config --local ustyle /PATH-TO-USTYLE` -- this will allow you to test and work off master on your local copy.
|
57
|
+
1. Work off `master` and add in your awesome features.
|
58
|
+
1. Test some more, ensure you've run this in a few projects.
|
59
|
+
2. Ensure you commit `/dist` into your changes
|
60
|
+
1. Run `grunt publish:version:{patch,minor,major}`
|
61
|
+
1. Voilà! You now have successfully updated and pushed the gem version, updated the stylesheets and built the styleguide. You're now a pro.
|
62
|
+
|
63
|
+
Publishing
|
64
|
+
===
|
65
|
+
|
66
|
+
Versioning gets done automatically by the `grunt:publish` command. However without specifying a type of version, if will just publish `HEAD` without a new release.
|
67
|
+
|
68
|
+
$ grunt publish:version:{patch,minor,major}
|
data/Gemfile
ADDED
data/Gruntfile.js
ADDED
@@ -0,0 +1,234 @@
|
|
1
|
+
var browsersList = require('./package.json')['browserslist']
|
2
|
+
|
3
|
+
module.exports = function (grunt) {
|
4
|
+
grunt.loadNpmTasks('grunt-postcss')
|
5
|
+
require('load-grunt-tasks')(grunt)
|
6
|
+
grunt.loadTasks('grunt/tasks')
|
7
|
+
|
8
|
+
grunt.initConfig({
|
9
|
+
clean: ['dist', 'docs'],
|
10
|
+
shell: {
|
11
|
+
upgrade: {
|
12
|
+
command: 'bundle exec rake ustyle:upgrade'
|
13
|
+
},
|
14
|
+
publish: {
|
15
|
+
command: 'bundle exec rake ustyle:publish'
|
16
|
+
}
|
17
|
+
},
|
18
|
+
version: {
|
19
|
+
project: {
|
20
|
+
src: ['package.json', 'lib/ustyle/version.rb']
|
21
|
+
}
|
22
|
+
},
|
23
|
+
postcss: {
|
24
|
+
options: {
|
25
|
+
map: false,
|
26
|
+
processors: [
|
27
|
+
require('autoprefixer')({
|
28
|
+
browsers: browsersList
|
29
|
+
})
|
30
|
+
]
|
31
|
+
},
|
32
|
+
dist: { src: ['docs/**/*.css', 'dist/**/*.css'] }
|
33
|
+
},
|
34
|
+
watch: {
|
35
|
+
options: {
|
36
|
+
spawn: false
|
37
|
+
},
|
38
|
+
build: {
|
39
|
+
files: ['vendor/assets/**/*', 'styleguide/**/*', 'dist/ustyle.json'],
|
40
|
+
tasks: ['copy', 'sass', 'sassdoc', 'postcss', 'browserSync-inject', 'styleguide', 'builder']
|
41
|
+
},
|
42
|
+
scripts: {
|
43
|
+
files: ['styleguide/**/*.js', 'vendor/**/*.js'],
|
44
|
+
tasks: ['concat']
|
45
|
+
}
|
46
|
+
},
|
47
|
+
svgstore: {
|
48
|
+
options: {
|
49
|
+
prefix: 'icon-'
|
50
|
+
},
|
51
|
+
default: {
|
52
|
+
files: {
|
53
|
+
'vendor/assets/images/icons.svg': ['vendor/assets/images/icons/*.svg'],
|
54
|
+
'dist/icons.svg': ['vendor/assets/images/icons/*.svg'],
|
55
|
+
'styleguide/assets/images/icons.svg': ['vendor/assets/images/icons/*.svg']
|
56
|
+
}
|
57
|
+
}
|
58
|
+
},
|
59
|
+
svgmin: {
|
60
|
+
dist: {
|
61
|
+
files: [{
|
62
|
+
expand: true,
|
63
|
+
cwd: 'vendor/assets/images/icons/',
|
64
|
+
src: '{,*/}*.svg',
|
65
|
+
dest: 'vendor/assets/images/icons/'
|
66
|
+
}]
|
67
|
+
}
|
68
|
+
},
|
69
|
+
styleguide: {
|
70
|
+
dist: {
|
71
|
+
src: 'vendor/assets/stylesheets/ustyle/**/*.scss',
|
72
|
+
dir: 'styleguide',
|
73
|
+
output: 'dist/ustyle.json',
|
74
|
+
statsFor: 'https://assets0.uswitch.com/s3/uswitch-assets-eu/ustyle/{#tag}/ustyle-latest.css',
|
75
|
+
tagPlaceholder: '{#tag}',
|
76
|
+
tagStartVersion: '0.9.9'
|
77
|
+
}
|
78
|
+
},
|
79
|
+
builder: {
|
80
|
+
dist: {
|
81
|
+
files: {
|
82
|
+
'docs/': 'dist/ustyle.json'
|
83
|
+
}
|
84
|
+
}
|
85
|
+
},
|
86
|
+
sass: {
|
87
|
+
dist: {
|
88
|
+
options: {
|
89
|
+
loadPath: ['vendor/assets/stylesheets/ustyle', 'styleguide/assets/sass'],
|
90
|
+
require: './lib/ustyle.rb',
|
91
|
+
style: 'compressed',
|
92
|
+
sourcemap: 'none',
|
93
|
+
bundleExec: true
|
94
|
+
},
|
95
|
+
files: {
|
96
|
+
'dist/ustyle-latest.css': 'vendor/assets/stylesheets/ustyle.scss',
|
97
|
+
'dist/ustyle-content.css': 'vendor/assets/stylesheets/ustyle-content.scss',
|
98
|
+
'docs/css/main.css': 'styleguide/assets/sass/main.scss'
|
99
|
+
}
|
100
|
+
}
|
101
|
+
},
|
102
|
+
concat: {
|
103
|
+
ustyle: {
|
104
|
+
src: [
|
105
|
+
'vendor/assets/javascripts/ustyle/utils.js',
|
106
|
+
'vendor/assets/javascripts/ustyle/anchor.js',
|
107
|
+
'vendor/assets/javascripts/ustyle/backdrop.js',
|
108
|
+
'vendor/assets/javascripts/ustyle/overlay.js',
|
109
|
+
'vendor/assets/javascripts/ustyle/tabs.js',
|
110
|
+
'vendor/assets/javascripts/ustyle/classtoggler.js'
|
111
|
+
],
|
112
|
+
dest: 'dist/ustyle.js'
|
113
|
+
},
|
114
|
+
app: {
|
115
|
+
src: [
|
116
|
+
'styleguide/assets/javascripts/vendor/*.js',
|
117
|
+
'dist/ustyle.js',
|
118
|
+
'styleguide/assets/javascripts/modules/*.js',
|
119
|
+
'styleguide/assets/javascripts/*.js'
|
120
|
+
],
|
121
|
+
dest: 'docs/js/app.js'
|
122
|
+
}
|
123
|
+
},
|
124
|
+
uglify: {
|
125
|
+
ustyle: {
|
126
|
+
files: {
|
127
|
+
'dist/ustyle.min.js': ['dist/ustyle.js'],
|
128
|
+
'docs/js/app.min.js': ['docs/js/app.js']
|
129
|
+
}
|
130
|
+
}
|
131
|
+
},
|
132
|
+
copy: {
|
133
|
+
main: {
|
134
|
+
files: [
|
135
|
+
{expand: true, flatten: true, src: ['dist/*.css'], dest: 'docs/css/'},
|
136
|
+
{expand: true, flatten: true, src: ['styleguide/assets/images/**'], dest: 'docs/images/'},
|
137
|
+
{expand: true, flatten: true, src: ['styleguide/CNAME'], dest: 'docs/'}
|
138
|
+
]
|
139
|
+
}
|
140
|
+
},
|
141
|
+
sassdoc: {
|
142
|
+
default: {
|
143
|
+
src: ['vendor/assets/stylesheets/ustyle/**/*.scss'],
|
144
|
+
options: {
|
145
|
+
dest: './docs/sass',
|
146
|
+
exclude: [
|
147
|
+
'./vendor/assets/stylesheets/ustyle/rebrand/vendor/*'
|
148
|
+
]
|
149
|
+
}
|
150
|
+
}
|
151
|
+
},
|
152
|
+
scsslint: {
|
153
|
+
allFiles: [
|
154
|
+
'./vendor/assets/stylesheets/**/*.scss',
|
155
|
+
'./styleguide/assets/sass/**/*.scss'
|
156
|
+
],
|
157
|
+
options: {
|
158
|
+
bundleExec: true,
|
159
|
+
config: 'config/scss-lint.yml',
|
160
|
+
reporterOutput: null,
|
161
|
+
exclude: [
|
162
|
+
'./vendor/assets/stylesheets/ustyle/vendor/*',
|
163
|
+
'./vendor/assets/stylesheets/ustyle/rebrand/vendor/*',
|
164
|
+
'./styleguide/assets/sass/vendor/*'
|
165
|
+
]
|
166
|
+
}
|
167
|
+
},
|
168
|
+
standard: {
|
169
|
+
options: {
|
170
|
+
fix: true,
|
171
|
+
globals: [
|
172
|
+
'google',
|
173
|
+
'$',
|
174
|
+
'cleanWhiteSpace',
|
175
|
+
'svg4everybody',
|
176
|
+
'hljs',
|
177
|
+
'Overlay',
|
178
|
+
'ClassToggler',
|
179
|
+
'Tabs',
|
180
|
+
'reportData'
|
181
|
+
]
|
182
|
+
},
|
183
|
+
ustyle: {
|
184
|
+
src: [
|
185
|
+
'./grunt/**/*.js',
|
186
|
+
'./styleguide/**/!(vendor)/*.js',
|
187
|
+
'./vendor/**/*.js',
|
188
|
+
'*.js'
|
189
|
+
]
|
190
|
+
}
|
191
|
+
},
|
192
|
+
env: {
|
193
|
+
dev: {
|
194
|
+
NODE_ENV: 'development'
|
195
|
+
},
|
196
|
+
build: {
|
197
|
+
NODE_ENV: 'production'
|
198
|
+
}
|
199
|
+
},
|
200
|
+
buildcontrol: {
|
201
|
+
options: {
|
202
|
+
dir: 'docs/',
|
203
|
+
commit: true,
|
204
|
+
push: true,
|
205
|
+
message: 'Built %sourceName% from commit %sourceCommit% on branch %sourceBranch%'
|
206
|
+
},
|
207
|
+
pages: {
|
208
|
+
options: {
|
209
|
+
remote: 'git@github.com:uswitch/ustyle.git',
|
210
|
+
branch: 'gh-pages'
|
211
|
+
}
|
212
|
+
}
|
213
|
+
}
|
214
|
+
})
|
215
|
+
|
216
|
+
grunt.registerTask('lint', ['scsslint', 'standard'])
|
217
|
+
grunt.registerTask('icons', ['svgstore'])
|
218
|
+
|
219
|
+
grunt.registerTask('build', ['clean', 'sass', 'sassdoc', 'copy', 'concat:ustyle', 'concat:app', 'uglify:ustyle', 'lint', 'postcss', 'styleguide', 'builder', 'icons'])
|
220
|
+
|
221
|
+
grunt.registerTask('publish', ['env:build', 'build'])
|
222
|
+
|
223
|
+
grunt.registerTask('publish:version', 'Build and publish ustyle version', function (version) {
|
224
|
+
if (version === null) {
|
225
|
+
grunt.warn('Version must be specified when publishing ustyle')
|
226
|
+
}
|
227
|
+
|
228
|
+
grunt.task.run('env:build', 'version::' + version, 'build', 'shell:upgrade')
|
229
|
+
})
|
230
|
+
|
231
|
+
grunt.registerTask('deploy', ['shell:publish'])
|
232
|
+
|
233
|
+
grunt.registerTask('default', ['env:dev', 'build', 'browserSync-init', 'watch'])
|
234
|
+
}
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
Copyright 2015 uSwitch Limited
|
2
|
+
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
you may not use this file except in compliance with the License.
|
5
|
+
You may obtain a copy of the License at
|
6
|
+
|
7
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
|
9
|
+
Unless required by applicable law or agreed to in writing, software
|
10
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
See the License for the specific language governing permissions and
|
13
|
+
limitations under the License.
|
data/README.md
ADDED
@@ -0,0 +1,196 @@
|
|
1
|
+
# [ustyle](http://ustyle.guide)
|
2
|
+
|
3
|
+
![ustyle unicorn](https://assets0.uswitch.com/s3/uswitch-assets-eu/ustyle/ustyle-unicorn.png)
|
4
|
+
|
5
|
+
uStyle, aptly named, is the styleguide gem for [uSwitch](http://www.uswitch.com). Include it in your Rails/Sinatra/Anything project as a gem to apply consistent styles according the uSwitch styleguide.
|
6
|
+
|
7
|
+
This project is provided as is and is aimed at building uSwitch specific projects.
|
8
|
+
|
9
|
+
* [Features](#features)
|
10
|
+
* [Infrastructure](#infrastructure)
|
11
|
+
* [Installation](#installation)
|
12
|
+
* [Sinatra](#sinatra)
|
13
|
+
* [Usage](#usage)
|
14
|
+
* [Rails / Sprockets apps](#rails--sprockets-apps)
|
15
|
+
* [Node apps](#node-apps)
|
16
|
+
* [Mixins/Variables](#mixins--variables)
|
17
|
+
* [Development](#development)
|
18
|
+
* [Contributing](#contributing)
|
19
|
+
|
20
|
+
## Features
|
21
|
+
|
22
|
+
uStyle is a fully fledged living styleguide that delivers both CSS and JavaScript components for technical implementations as well as documentation for how these things should be applied across uSwitch.
|
23
|
+
|
24
|
+
* [Pattern library](https://ustyle.guide/pattern-library/index.html)
|
25
|
+
* [Design guidelines](https://ustyle.guide/design/index.html)
|
26
|
+
* [Brand guidelines](https://ustyle.guide/brand/index.html)
|
27
|
+
|
28
|
+
## Infrastructure
|
29
|
+
|
30
|
+
uStyle is compiled and uploaded to S3. Consequently it is served from Cloudfront via our nginx load balancers.
|
31
|
+
|
32
|
+
uStyle within applications is usually served within their asset pipeline on compilation.
|
33
|
+
|
34
|
+
## Installation
|
35
|
+
|
36
|
+
Pre-requisites:
|
37
|
+
|
38
|
+
If you want to use as a gem
|
39
|
+
|
40
|
+
* Ruby (1.9+)
|
41
|
+
* Sinatra / Rails applications with sprockets
|
42
|
+
|
43
|
+
This can also be used as a node package just like you would install any other package.
|
44
|
+
|
45
|
+
uStyle automagically sets itself up in a sprockets context where found. That means both Sinatra and Rails apps get configured correctly. However there are a few gotchas, as we don't want to add gem dependencies that are only required for certain set ups.
|
46
|
+
|
47
|
+
Add this line to your application's Gemfile:
|
48
|
+
|
49
|
+
```ruby
|
50
|
+
gem 'ustyle'
|
51
|
+
```
|
52
|
+
|
53
|
+
And then run in your terminal:
|
54
|
+
|
55
|
+
$ bundle
|
56
|
+
|
57
|
+
### Sinatra
|
58
|
+
|
59
|
+
Add to your Gemfile:
|
60
|
+
``` ruby
|
61
|
+
gem 'sprockets'
|
62
|
+
gem 'sprockets-sass', '~> 1.2.0'
|
63
|
+
gem 'sprockets-helpers'
|
64
|
+
```
|
65
|
+
|
66
|
+
Then in your app file (usually named server.rb/app.rb etc), after declaring your `class App < Sinatra::Base`:
|
67
|
+
|
68
|
+
```ruby
|
69
|
+
register Sinatra::Ustyle
|
70
|
+
```
|
71
|
+
|
72
|
+
**You must use `sprockets-sass` version 1.1.0 or above, as there was a bug where the postprocessor was getting added to the preprocessor which caused autoprefixer to break**
|
73
|
+
|
74
|
+
This is only for the gem, not the styleguide within this project.
|
75
|
+
|
76
|
+
### Icons
|
77
|
+
|
78
|
+
uStyle serves it's icons via `<use xlink:href></use>` tags within an SVG. We have decided to not embed our SVGs, but rather serve them from a URL. See here for a better explanation: https://css-tricks.com/svg-use-with-external-reference-take-2/
|
79
|
+
|
80
|
+
Due to this, you need to have the `icons.svg` symbol map on the same domain, protocol and port as your application. To facilite this without serving a sprockets asset, ustyle comes with some `Rack Middleware`
|
81
|
+
|
82
|
+
For Rails apps, in your `development.rb` file (you do not want this in production)
|
83
|
+
```ruby
|
84
|
+
config.middleware.use Ustyle::IconMiddleware
|
85
|
+
```
|
86
|
+
|
87
|
+
For Rack apps (including Sinatra)
|
88
|
+
```ruby
|
89
|
+
configure :development do
|
90
|
+
use Ustyle::IconMiddleware
|
91
|
+
end
|
92
|
+
```
|
93
|
+
|
94
|
+
Currently there is no middleware to support node apps, but can be written easily.
|
95
|
+
|
96
|
+
Alternatively, you can serve your application in a docker container with nginx (or another supporting proxy server) that has a route to /icons.svg so you can proxy pass to our icons for the app. Ports, domains and protocols **must** match when testing the icons.
|
97
|
+
|
98
|
+
An example nginx configuration:
|
99
|
+
```nginx
|
100
|
+
location = /icons.svg {
|
101
|
+
set $upstream "https://assets0.uswitch.com/s3/uswitch-assets-eu/ustyle";
|
102
|
+
proxy_pass $upstream$request_uri;
|
103
|
+
}
|
104
|
+
```
|
105
|
+
|
106
|
+
You can then successfully reference your icon like so:
|
107
|
+
|
108
|
+
```html
|
109
|
+
<svg role="img" class="us-icon--medium us-icon--custom us-icon--{$NAME}">
|
110
|
+
<use xlink:href="/images/icons.svg#icon-{$NAME}"></use>
|
111
|
+
</svg>
|
112
|
+
```
|
113
|
+
|
114
|
+
#### Adding a new Icon
|
115
|
+
|
116
|
+
To add a new Icon, add the SVG file to `/vendor/assets/images/icons`,
|
117
|
+
then add your new icon name as `@state icon` to [this
|
118
|
+
file](https://github.com/uswitch/ustyle/blob/new-shield-icon/vendor/assets/stylesheets/ustyle/icons/_base.scss#L19-L112).
|
119
|
+
|
120
|
+
Finally, build the optimised icons using
|
121
|
+
|
122
|
+
```sh
|
123
|
+
grunt icons
|
124
|
+
```
|
125
|
+
|
126
|
+
## Usage
|
127
|
+
|
128
|
+
### Rails / Sprockets apps
|
129
|
+
|
130
|
+
If using Rails and Sass, just import the base uSwitch styles at the start of your file
|
131
|
+
|
132
|
+
```scss
|
133
|
+
@import "ustyle";
|
134
|
+
```
|
135
|
+
|
136
|
+
This will import the main components. If you want more granular control of what to import, please look at the source code or the styleguide.
|
137
|
+
|
138
|
+
### Node apps
|
139
|
+
|
140
|
+
uStyle comes with JavaScript implementations of the custom Sass Ruby functions used by Sprockets. To use uStyle's mixins and variables within your own Sass, you'll need to add these functions to the compiler you're using. For example, using [node-sass](https://github.com/sass/node-sass) in a project that also has [Webpack](https://webpack.js.org/), you can do the following:
|
141
|
+
|
142
|
+
```javascript
|
143
|
+
// In your webpack.config.js
|
144
|
+
|
145
|
+
import { SassHelpers } from 'ustyle';
|
146
|
+
|
147
|
+
module.exports = {
|
148
|
+
// ...
|
149
|
+
module: {
|
150
|
+
rules: [
|
151
|
+
// ...
|
152
|
+
{
|
153
|
+
test: /.scss$/,
|
154
|
+
use: [{
|
155
|
+
loader: 'sass-loader',
|
156
|
+
options: {
|
157
|
+
functions: SassHelpers
|
158
|
+
}
|
159
|
+
}]
|
160
|
+
}
|
161
|
+
// ...
|
162
|
+
]
|
163
|
+
}
|
164
|
+
// ...
|
165
|
+
};
|
166
|
+
```
|
167
|
+
|
168
|
+
### Mixins / Variables
|
169
|
+
|
170
|
+
uStyle comes bundled with a good set of Sass variables and mixins to use in your project.
|
171
|
+
|
172
|
+
For Sass documentation on mixins/variables available to you, please see: https://ustyle.guide/sass/
|
173
|
+
|
174
|
+
## Development
|
175
|
+
|
176
|
+
To preview changes that you make to uStyle's components and documentation, install dependencies with
|
177
|
+
|
178
|
+
$ npm install
|
179
|
+
|
180
|
+
$ bundle install
|
181
|
+
|
182
|
+
then run:
|
183
|
+
|
184
|
+
$ npm start
|
185
|
+
|
186
|
+
This will run the [Grunt](http://gruntjs.com/) default task that builds uStyle, then starts a [Browsersync](https://www.browsersync.io/) server at http://localhost:3000. Changes that you make are live-reloaded in your browser.
|
187
|
+
|
188
|
+
## Contributing
|
189
|
+
|
190
|
+
See [CONTRIBUTING.md](https://github.com/uswitch/ustyle/blob/master/CONTRIBUTING.md)
|
191
|
+
|
192
|
+
## Licences
|
193
|
+
|
194
|
+
- Source code is licensed under the Apache v2.0 licence
|
195
|
+
- All icons, except the uSwitch icon are licensed under [CC - Attribution - No Derivatives 4.0](http://creativecommons.org/licenses/by-nd/4.0/)
|
196
|
+
- uSwitch icon is licensed under [CC - Attribution - NonCommercial - NoDerivates 4.0](http://creativecommons.org/licenses/by-nc-nd/4.0/)
|
data/Rakefile
ADDED
data/bower.json
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
{
|
2
|
+
"name": "ustyle",
|
3
|
+
"description": "A living styleguide and pattern library by uSwitch.",
|
4
|
+
"main": [
|
5
|
+
"dist/ustyle-latest.css",
|
6
|
+
"dist/ustyle-icons.css",
|
7
|
+
"dist/ustyle.js"
|
8
|
+
],
|
9
|
+
"dependencies": {
|
10
|
+
"jquery": ">= 1.9.1"
|
11
|
+
},
|
12
|
+
"moduleType": "globals",
|
13
|
+
"keywords": [
|
14
|
+
"css",
|
15
|
+
"sass",
|
16
|
+
"scss",
|
17
|
+
"js",
|
18
|
+
"javascript",
|
19
|
+
"front-end",
|
20
|
+
"styleguide",
|
21
|
+
"uswitch",
|
22
|
+
"ustyle"
|
23
|
+
],
|
24
|
+
"authors": [
|
25
|
+
"uSwitch Limited <developers@uswitch.com>",
|
26
|
+
"Joe Green <joe.green@uswitch.com>",
|
27
|
+
"David Annez <david.annez@uswitch.com>",
|
28
|
+
"Thomas Britton <thomas.britton@uswitch.com>",
|
29
|
+
"Ricardo Cerqueira <ricardo.cerqueira@uswitch.com>",
|
30
|
+
"Ivo Reis <ivo.reis@uswitch.com>"
|
31
|
+
],
|
32
|
+
"homepage": "http://ustyle.guide",
|
33
|
+
"repository": {
|
34
|
+
"type": "git",
|
35
|
+
"url": "git://github.com/uswitch/ustyle.git"
|
36
|
+
},
|
37
|
+
"license": "Apache-2.0",
|
38
|
+
"ignore": [
|
39
|
+
"/*.",
|
40
|
+
"config",
|
41
|
+
"docs",
|
42
|
+
"grunt",
|
43
|
+
"styleguide",
|
44
|
+
"tasks",
|
45
|
+
"CONTRIBUTING.md",
|
46
|
+
"Gemfile*",
|
47
|
+
"Gruntfile.js",
|
48
|
+
"JAVASCRIPT_STANDARDS.md",
|
49
|
+
"package.json",
|
50
|
+
"Rakefile",
|
51
|
+
"README.md",
|
52
|
+
"ustyle.gemspec"
|
53
|
+
]
|
54
|
+
}
|