colorgy_style 0.0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (151) hide show
  1. checksums.yaml +7 -0
  2. data/.editorconfig +41 -0
  3. data/.gitignore +13 -0
  4. data/.rspec +2 -0
  5. data/.travis.yml +4 -0
  6. data/Gemfile +10 -0
  7. data/README.md +36 -0
  8. data/Rakefile +11 -0
  9. data/assets/fonts/colorgy/.keep +0 -0
  10. data/assets/images/colorgy/.keep +0 -0
  11. data/assets/javascripts/colorgy.js +1 -0
  12. data/assets/javascripts/colorgy/main.js +7 -0
  13. data/assets/javascripts/colorgy/modernizr.js +7 -0
  14. data/assets/javascripts/colorgy/modernizr/classifier.coffee +14 -0
  15. data/assets/javascripts/vendor/es5-shim.js +1432 -0
  16. data/assets/javascripts/vendor/modernizr.js +1406 -0
  17. data/assets/javascripts/vendor/modernizr/feature-detects/a-download.js +8 -0
  18. data/assets/javascripts/vendor/modernizr/feature-detects/audio-audiodata-api.js +4 -0
  19. data/assets/javascripts/vendor/modernizr/feature-detects/audio-webaudio-api.js +4 -0
  20. data/assets/javascripts/vendor/modernizr/feature-detects/battery-api.js +8 -0
  21. data/assets/javascripts/vendor/modernizr/feature-detects/battery-level.js +11 -0
  22. data/assets/javascripts/vendor/modernizr/feature-detects/blob-constructor.js +10 -0
  23. data/assets/javascripts/vendor/modernizr/feature-detects/canvas-todataurl-type.js +28 -0
  24. data/assets/javascripts/vendor/modernizr/feature-detects/contenteditable.js +9 -0
  25. data/assets/javascripts/vendor/modernizr/feature-detects/contentsecuritypolicy.js +10 -0
  26. data/assets/javascripts/vendor/modernizr/feature-detects/contextmenu.js +11 -0
  27. data/assets/javascripts/vendor/modernizr/feature-detects/cookies.js +15 -0
  28. data/assets/javascripts/vendor/modernizr/feature-detects/cors.js +3 -0
  29. data/assets/javascripts/vendor/modernizr/feature-detects/css-backgroundposition-shorthand.js +19 -0
  30. data/assets/javascripts/vendor/modernizr/feature-detects/css-backgroundposition-xy.js +15 -0
  31. data/assets/javascripts/vendor/modernizr/feature-detects/css-backgroundrepeat.js +31 -0
  32. data/assets/javascripts/vendor/modernizr/feature-detects/css-backgroundsizecover.js +10 -0
  33. data/assets/javascripts/vendor/modernizr/feature-detects/css-boxsizing.js +9 -0
  34. data/assets/javascripts/vendor/modernizr/feature-detects/css-calc.js +12 -0
  35. data/assets/javascripts/vendor/modernizr/feature-detects/css-cubicbezierrange.js +8 -0
  36. data/assets/javascripts/vendor/modernizr/feature-detects/css-displayrunin.js +18 -0
  37. data/assets/javascripts/vendor/modernizr/feature-detects/css-displaytable.js +27 -0
  38. data/assets/javascripts/vendor/modernizr/feature-detects/css-filters.js +7 -0
  39. data/assets/javascripts/vendor/modernizr/feature-detects/css-hyphens.js +205 -0
  40. data/assets/javascripts/vendor/modernizr/feature-detects/css-lastchild.js +11 -0
  41. data/assets/javascripts/vendor/modernizr/feature-detects/css-mask.js +12 -0
  42. data/assets/javascripts/vendor/modernizr/feature-detects/css-mediaqueries.js +3 -0
  43. data/assets/javascripts/vendor/modernizr/feature-detects/css-objectfit.js +6 -0
  44. data/assets/javascripts/vendor/modernizr/feature-detects/css-overflow-scrolling.js +9 -0
  45. data/assets/javascripts/vendor/modernizr/feature-detects/css-pointerevents.js +25 -0
  46. data/assets/javascripts/vendor/modernizr/feature-detects/css-positionsticky.js +13 -0
  47. data/assets/javascripts/vendor/modernizr/feature-detects/css-regions.js +55 -0
  48. data/assets/javascripts/vendor/modernizr/feature-detects/css-remunit.js +19 -0
  49. data/assets/javascripts/vendor/modernizr/feature-detects/css-resize.js +8 -0
  50. data/assets/javascripts/vendor/modernizr/feature-detects/css-scrollbars.js +19 -0
  51. data/assets/javascripts/vendor/modernizr/feature-detects/css-shapes.js +4 -0
  52. data/assets/javascripts/vendor/modernizr/feature-detects/css-subpixelfont.js +23 -0
  53. data/assets/javascripts/vendor/modernizr/feature-detects/css-supports.js +6 -0
  54. data/assets/javascripts/vendor/modernizr/feature-detects/css-userselect.js +10 -0
  55. data/assets/javascripts/vendor/modernizr/feature-detects/css-vhunit.js +14 -0
  56. data/assets/javascripts/vendor/modernizr/feature-detects/css-vmaxunit.js +14 -0
  57. data/assets/javascripts/vendor/modernizr/feature-detects/css-vminunit.js +14 -0
  58. data/assets/javascripts/vendor/modernizr/feature-detects/css-vwunit.js +14 -0
  59. data/assets/javascripts/vendor/modernizr/feature-detects/custom-protocol-handler.js +10 -0
  60. data/assets/javascripts/vendor/modernizr/feature-detects/dart.js +6 -0
  61. data/assets/javascripts/vendor/modernizr/feature-detects/dataview-api.js +4 -0
  62. data/assets/javascripts/vendor/modernizr/feature-detects/dom-classlist.js +4 -0
  63. data/assets/javascripts/vendor/modernizr/feature-detects/dom-createElement-attrs.js +11 -0
  64. data/assets/javascripts/vendor/modernizr/feature-detects/dom-dataset.js +9 -0
  65. data/assets/javascripts/vendor/modernizr/feature-detects/dom-microdata.js +4 -0
  66. data/assets/javascripts/vendor/modernizr/feature-detects/elem-datalist.js +12 -0
  67. data/assets/javascripts/vendor/modernizr/feature-detects/elem-details.js +25 -0
  68. data/assets/javascripts/vendor/modernizr/feature-detects/elem-output.js +4 -0
  69. data/assets/javascripts/vendor/modernizr/feature-detects/elem-progress-meter.js +11 -0
  70. data/assets/javascripts/vendor/modernizr/feature-detects/elem-ruby.js +53 -0
  71. data/assets/javascripts/vendor/modernizr/feature-detects/elem-time.js +4 -0
  72. data/assets/javascripts/vendor/modernizr/feature-detects/elem-track.js +11 -0
  73. data/assets/javascripts/vendor/modernizr/feature-detects/emoji.js +11 -0
  74. data/assets/javascripts/vendor/modernizr/feature-detects/es5-strictmode.js +7 -0
  75. data/assets/javascripts/vendor/modernizr/feature-detects/event-deviceorientation-motion.js +11 -0
  76. data/assets/javascripts/vendor/modernizr/feature-detects/exif-orientation.js +32 -0
  77. data/assets/javascripts/vendor/modernizr/feature-detects/file-api.js +12 -0
  78. data/assets/javascripts/vendor/modernizr/feature-detects/file-filesystem.js +9 -0
  79. data/assets/javascripts/vendor/modernizr/feature-detects/forms-fileinput.js +13 -0
  80. data/assets/javascripts/vendor/modernizr/feature-detects/forms-formattribute.js +29 -0
  81. data/assets/javascripts/vendor/modernizr/feature-detects/forms-inputnumber-l10n.js +32 -0
  82. data/assets/javascripts/vendor/modernizr/feature-detects/forms-placeholder.js +10 -0
  83. data/assets/javascripts/vendor/modernizr/feature-detects/forms-speechinput.js +19 -0
  84. data/assets/javascripts/vendor/modernizr/feature-detects/forms-validation.js +62 -0
  85. data/assets/javascripts/vendor/modernizr/feature-detects/fullscreen-api.js +10 -0
  86. data/assets/javascripts/vendor/modernizr/feature-detects/gamepad.js +12 -0
  87. data/assets/javascripts/vendor/modernizr/feature-detects/getusermedia.js +5 -0
  88. data/assets/javascripts/vendor/modernizr/feature-detects/ie8compat.js +12 -0
  89. data/assets/javascripts/vendor/modernizr/feature-detects/iframe-sandbox.js +5 -0
  90. data/assets/javascripts/vendor/modernizr/feature-detects/iframe-seamless.js +5 -0
  91. data/assets/javascripts/vendor/modernizr/feature-detects/iframe-srcdoc.js +5 -0
  92. data/assets/javascripts/vendor/modernizr/feature-detects/img-apng.js +26 -0
  93. data/assets/javascripts/vendor/modernizr/feature-detects/img-webp.js +20 -0
  94. data/assets/javascripts/vendor/modernizr/feature-detects/json.js +7 -0
  95. data/assets/javascripts/vendor/modernizr/feature-detects/lists-reversed.js +6 -0
  96. data/assets/javascripts/vendor/modernizr/feature-detects/mathml.js +23 -0
  97. data/assets/javascripts/vendor/modernizr/feature-detects/network-connection.js +22 -0
  98. data/assets/javascripts/vendor/modernizr/feature-detects/network-eventsource.js +5 -0
  99. data/assets/javascripts/vendor/modernizr/feature-detects/network-xhr2.js +13 -0
  100. data/assets/javascripts/vendor/modernizr/feature-detects/notification.js +10 -0
  101. data/assets/javascripts/vendor/modernizr/feature-detects/performance.js +5 -0
  102. data/assets/javascripts/vendor/modernizr/feature-detects/pointerlock-api.js +4 -0
  103. data/assets/javascripts/vendor/modernizr/feature-detects/quota-management-api.js +11 -0
  104. data/assets/javascripts/vendor/modernizr/feature-detects/requestanimationframe.js +7 -0
  105. data/assets/javascripts/vendor/modernizr/feature-detects/script-async.js +3 -0
  106. data/assets/javascripts/vendor/modernizr/feature-detects/script-defer.js +3 -0
  107. data/assets/javascripts/vendor/modernizr/feature-detects/style-scoped.js +6 -0
  108. data/assets/javascripts/vendor/modernizr/feature-detects/svg-filters.js +13 -0
  109. data/assets/javascripts/vendor/modernizr/feature-detects/unicode.js +32 -0
  110. data/assets/javascripts/vendor/modernizr/feature-detects/url-data-uri.js +26 -0
  111. data/assets/javascripts/vendor/modernizr/feature-detects/userdata.js +7 -0
  112. data/assets/javascripts/vendor/modernizr/feature-detects/vibration.js +4 -0
  113. data/assets/javascripts/vendor/modernizr/feature-detects/web-intents.js +6 -0
  114. data/assets/javascripts/vendor/modernizr/feature-detects/webgl-extensions.js +42 -0
  115. data/assets/javascripts/vendor/modernizr/feature-detects/websockets-binary.js +20 -0
  116. data/assets/javascripts/vendor/modernizr/feature-detects/window-framed.js +8 -0
  117. data/assets/javascripts/vendor/modernizr/feature-detects/workers-blobworkers.js +66 -0
  118. data/assets/javascripts/vendor/modernizr/feature-detects/workers-dataworkers.js +34 -0
  119. data/assets/javascripts/vendor/modernizr/feature-detects/workers-sharedworkers.js +3 -0
  120. data/assets/stylesheets/colorgy.scss +1 -0
  121. data/assets/stylesheets/colorgy/components/.keep +0 -0
  122. data/assets/stylesheets/colorgy/components/_button.scss +18 -0
  123. data/assets/stylesheets/colorgy/core/_base.scss +12 -0
  124. data/assets/stylesheets/colorgy/core/_config.scss +8 -0
  125. data/assets/stylesheets/colorgy/core/_fonts.scss +8 -0
  126. data/assets/stylesheets/colorgy/core/_grid.scss +8 -0
  127. data/assets/stylesheets/colorgy/core/_helpers.scss +44 -0
  128. data/assets/stylesheets/colorgy/layouts/.keep +0 -0
  129. data/assets/stylesheets/colorgy/main.scss +63 -0
  130. data/assets/stylesheets/colorgy/structures/.keep +0 -0
  131. data/bin/console +14 -0
  132. data/bin/server +3 -0
  133. data/bin/setup +7 -0
  134. data/colorgy_style.gemspec +52 -0
  135. data/config.rb +63 -0
  136. data/lib/colorgy_style.rb +74 -0
  137. data/lib/colorgy_style/rails.rb +13 -0
  138. data/lib/colorgy_style/version.rb +3 -0
  139. data/styleguide/index.html.haml +7 -0
  140. data/styleguide/javascripts/body.js +5 -0
  141. data/styleguide/javascripts/head.js +2 -0
  142. data/styleguide/javascripts/styleguide/kss.js +40 -0
  143. data/styleguide/javascripts/styleguide/prism.js +6 -0
  144. data/styleguide/layouts/default.erb +5 -0
  145. data/styleguide/layouts/layout.erb +20 -0
  146. data/styleguide/styleblocks/.keep +0 -0
  147. data/styleguide/styleblocks/_button.html.erb +23 -0
  148. data/styleguide/stylesheets/all.css +4 -0
  149. data/styleguide/stylesheets/styleguide/_prism.css +107 -0
  150. data/styleguide/stylesheets/styleguide/styles.scss +97 -0
  151. metadata +402 -0
@@ -0,0 +1,63 @@
1
+ // *************************************
2
+ //
3
+ // Colorgy
4
+ // -> Main Manifest
5
+ //
6
+ // *************************************
7
+
8
+ // -------------------------------------
9
+ // Reset
10
+ // -------------------------------------
11
+
12
+ @import "bootstrap/normalize";
13
+ @import "bootstrap/print";
14
+
15
+ // -------------------------------------
16
+ // Core
17
+ // -------------------------------------
18
+
19
+ // ----- Config ----- //
20
+
21
+ @import "core/config";
22
+
23
+ // ----- Helpers ----- //
24
+
25
+ @import "core/helpers";
26
+
27
+ // ----- Fonts ----- //
28
+
29
+ @import "core/fonts";
30
+
31
+ // ----- Grid ----- //
32
+
33
+ @import "core/grid";
34
+
35
+ // ----- Base ----- //
36
+
37
+ @import "core/base";
38
+
39
+ // -------------------------------------
40
+ // Layouts
41
+ // -------------------------------------
42
+
43
+ @import "layouts/**/*";
44
+
45
+ // -------------------------------------
46
+ // Structures
47
+ // -------------------------------------
48
+
49
+ @import "structures/**/*";
50
+
51
+ // -------------------------------------
52
+ // Components
53
+ // -------------------------------------
54
+
55
+ @import "components/**/*";
56
+
57
+ // -------------------------------------
58
+ // Vendor
59
+ // -------------------------------------
60
+
61
+ // -------------------------------------
62
+ // Inbox
63
+ // -------------------------------------
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "colorgy_style"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ system "bundle exec middleman server #{ARGV.join(' ')}"
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,52 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'colorgy_style/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "colorgy_style"
8
+ spec.version = ColorgyStyle::VERSION
9
+ spec.authors = ["Neson"]
10
+ spec.email = ["neson@dex.tw"]
11
+
12
+ spec.summary = %q{The front-end bundle and style guide for Colorgy.}
13
+ spec.description = %q{The front-end bundle and style guide for Colorgy.}
14
+ spec.homepage = "https://github.com/colorgy/Style"
15
+
16
+ # Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
17
+ # delete this section to allow pushing this gem to any host.
18
+ # if spec.respond_to?(:metadata)
19
+ # spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
20
+ # else
21
+ # raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
22
+ # end
23
+
24
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
25
+ spec.bindir = "exe"
26
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
27
+ spec.require_paths = ["lib"]
28
+
29
+ spec.add_development_dependency "bundler"
30
+ spec.add_development_dependency "rake"
31
+ spec.add_development_dependency "rspec"
32
+
33
+ # Use Middleman to construct living style guides
34
+ spec.add_development_dependency "middleman", ">= 3"
35
+ spec.add_development_dependency "middleman-kss", "~>0.3.1"
36
+ spec.add_development_dependency "middleman-livereload", "~> 3.1.0"
37
+ spec.add_development_dependency "middleman-deploy", "~> 1.0"
38
+
39
+ # SASS and Compass
40
+ spec.add_dependency "sass", ">= 3.4"
41
+ spec.add_dependency "sass-globbing"
42
+ spec.add_dependency "compass", "~> 1.0.0"
43
+
44
+ # Sprockets
45
+ spec.add_dependency "sprockets", "~> 2.0"
46
+
47
+ # Assets
48
+ spec.add_dependency "jquery-rails"
49
+ spec.add_dependency "bootstrap-sass", "~> 3.3.4.1"
50
+ spec.add_dependency "materialize-sass"
51
+ spec.add_dependency "turbolinks", "~> 2.5.3"
52
+ end
@@ -0,0 +1,63 @@
1
+ ##############################################################
2
+ # Configurations for Middleman and KSS - #
3
+ # asset builder, development server and living style guides. #
4
+ ##############################################################
5
+
6
+ ##
7
+ # Middleman
8
+ ##
9
+
10
+ set :source, 'styleguide'
11
+ set :css_dir, 'stylesheets'
12
+ set :js_dir, 'javascripts'
13
+ set :images_dir, 'images'
14
+
15
+ activate :directory_indexes
16
+ activate :livereload, port: "35728"
17
+ set :file_watcher_ignore, [/^bin(\/|$)/,
18
+ /^\.bundle(\/|$)/,
19
+ /^node_modules(\/|$)/,
20
+ /^\.sass-cache(\/|$)/,
21
+ /^\.cache(\/|$)/,
22
+ /^\.git(\/|$)/,
23
+ /^\.gitignore$/,
24
+ /\.DS_Store/,
25
+ /^\.rbenv-.*$/,
26
+ /^Gemfile$/,
27
+ /^Gemfile\.lock$/,
28
+ /~$/,
29
+ /(^|\/)\.?#/,
30
+ /^tmp\//,
31
+ /^build(\/|$)/]
32
+
33
+ ##
34
+ # KSS
35
+ ##
36
+
37
+ set :markdown_engine, :redcarpet
38
+ activate :kss,
39
+ kss_dir: "../assets/stylesheets"
40
+
41
+ ##
42
+ # Build-specific configuration
43
+ ##
44
+
45
+ configure :build do
46
+ # Change the Compass output style to minify on build
47
+ activate :minify_css
48
+
49
+ # Minify Javascript on build
50
+ activate :minify_javascript
51
+
52
+ # Use relative URLs
53
+ activate :relative_assets
54
+ end
55
+
56
+ ##
57
+ # Automatic deploy configuration
58
+ ##
59
+
60
+ activate :deploy do |deploy|
61
+ deploy.method = :git
62
+ deploy.build_before = true
63
+ end
@@ -0,0 +1,74 @@
1
+ require "colorgy_style/version"
2
+
3
+ module ColorgyStyle
4
+ # Give credit to bootstrap-sass
5
+ class << self
6
+ # Inspired by Kaminari
7
+ def load!
8
+ if rails?
9
+ register_rails_engine
10
+ elsif sprockets?
11
+ register_sprockets
12
+ end
13
+
14
+ configure_sass
15
+ end
16
+
17
+ # Paths
18
+
19
+ def gem_path
20
+ @gem_path ||= File.expand_path '..', File.dirname(__FILE__)
21
+ end
22
+
23
+ def assets_path
24
+ @assets_path ||= File.join gem_path, 'assets'
25
+ end
26
+
27
+ def stylesheets_path
28
+ File.join assets_path, 'stylesheets'
29
+ end
30
+
31
+ def fonts_path
32
+ File.join assets_path, 'fonts'
33
+ end
34
+
35
+ def javascripts_path
36
+ File.join assets_path, 'javascripts'
37
+ end
38
+
39
+ # Environment detection helpers
40
+
41
+ def sprockets?
42
+ defined?(::Sprockets)
43
+ end
44
+
45
+ def rails?
46
+ defined?(::Rails)
47
+ end
48
+
49
+ private
50
+
51
+ def configure_sass
52
+ require 'sass'
53
+
54
+ ::Sass.load_paths << stylesheets_path
55
+ end
56
+
57
+ def register_rails_engine
58
+ require 'colorgy_style/rails'
59
+ end
60
+
61
+ def register_sprockets
62
+ Sprockets.append_path(stylesheets_path)
63
+ Sprockets.append_path(fonts_path)
64
+ Sprockets.append_path(javascripts_path)
65
+ end
66
+ end
67
+ end
68
+
69
+ ColorgyStyle.load!
70
+
71
+ require 'bootstrap-sass'
72
+ require 'materialize-sass'
73
+ require 'sass-globbing' unless defined?(Rails::VERSION::STRING) &&
74
+ Rails::VERSION::STRING.to_f >= 3.1
@@ -0,0 +1,13 @@
1
+ # register_rails_engine
2
+ module ColorgyStyle
3
+ module Rails
4
+ class Engine < ::Rails::Engine
5
+ initializer 'colorgy_style.assets.precompile' do |app|
6
+ %w(stylesheets javascripts fonts images).each do |sub|
7
+ app.config.assets.paths << root.join('assets', sub).to_s
8
+ end
9
+ app.config.assets.precompile << %r(colorgy/.+\.(?:png|gif|jpg|eot|svg|ttf|woff)$)
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,3 @@
1
+ module ColorgyStyle
2
+ VERSION = "0.0.0.1"
3
+ end
@@ -0,0 +1,7 @@
1
+ ---
2
+ title: Colorgy Styleguide
3
+ layout: default
4
+ ---
5
+
6
+ %h1 Styleguide
7
+ = styleblock 'button', section: '2.1'
@@ -0,0 +1,5 @@
1
+ //= require colorgy
2
+ //= require ./styleguide/kss
3
+ //= require ./styleguide/prism
4
+
5
+ $(document).on('ready page:load', Prism.highlightAll);
@@ -0,0 +1,2 @@
1
+ //= require colorgy/modernizr
2
+ //= require turbolinks
@@ -0,0 +1,40 @@
1
+ (function() {
2
+ var KssStateGenerator;
3
+ KssStateGenerator = (function() {
4
+ function KssStateGenerator() {
5
+ var idx, idxs, pseudos, replaceRule, rule, stylesheet, _i, _len, _len2, _ref, _ref2;
6
+ pseudos = /(\:hover|\:disabled|\:active|\:visited)/g;
7
+ try {
8
+ _ref = document.styleSheets;
9
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
10
+ stylesheet = _ref[_i];
11
+ idxs = [];
12
+ _ref2 = stylesheet.cssRules;
13
+ for (idx = 0, _len2 = _ref2.length; idx < _len2; idx++) {
14
+ rule = _ref2[idx];
15
+ if ((rule.type === CSSRule.STYLE_RULE) && pseudos.test(rule.selectorText)) {
16
+ replaceRule = function(matched, stuff) {
17
+ return ".pseudo-class-" + matched.replace(':', '');
18
+ };
19
+ this.insertRule(rule.cssText.replace(pseudos, replaceRule));
20
+ }
21
+ }
22
+ }
23
+ } catch (_e) {}
24
+ }
25
+ KssStateGenerator.prototype.insertRule = function(rule) {
26
+ var headEl, styleEl;
27
+ headEl = document.getElementsByTagName('head')[0];
28
+ styleEl = document.createElement('style');
29
+ styleEl.type = 'text/css';
30
+ if (styleEl.styleSheet) {
31
+ styleEl.styleSheet.cssText = rule;
32
+ } else {
33
+ styleEl.appendChild(document.createTextNode(rule));
34
+ }
35
+ return headEl.appendChild(styleEl);
36
+ };
37
+ return KssStateGenerator;
38
+ })();
39
+ new KssStateGenerator;
40
+ }).call(this);
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Prism: Lightweight, robust, elegant syntax highlighting
3
+ * MIT license http://www.opensource.org/licenses/mit-license.php/
4
+ * @author Lea Verou http://lea.verou.me
5
+ */(function(){var e=/\blang(?:uage)?-(?!\*)(\w+)\b/i,t=self.Prism={util:{type:function(e){return Object.prototype.toString.call(e).match(/\[object (\w+)\]/)[1]},clone:function(e){var n=t.util.type(e);switch(n){case"Object":var r={};for(var i in e)e.hasOwnProperty(i)&&(r[i]=t.util.clone(e[i]));return r;case"Array":return e.slice()}return e}},languages:{extend:function(e,n){var r=t.util.clone(t.languages[e]);for(var i in n)r[i]=n[i];return r},insertBefore:function(e,n,r,i){i=i||t.languages;var s=i[e],o={};for(var u in s)if(s.hasOwnProperty(u)){if(u==n)for(var a in r)r.hasOwnProperty(a)&&(o[a]=r[a]);o[u]=s[u]}return i[e]=o},DFS:function(e,n){for(var r in e){n.call(e,r,e[r]);t.util.type(e)==="Object"&&t.languages.DFS(e[r],n)}}},highlightAll:function(e,n){var r=document.querySelectorAll('code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code');for(var i=0,s;s=r[i++];)t.highlightElement(s,e===!0,n)},highlightElement:function(r,i,s){var o,u,a=r;while(a&&!e.test(a.className))a=a.parentNode;if(a){o=(a.className.match(e)||[,""])[1];u=t.languages[o]}if(!u)return;r.className=r.className.replace(e,"").replace(/\s+/g," ")+" language-"+o;a=r.parentNode;/pre/i.test(a.nodeName)&&(a.className=a.className.replace(e,"").replace(/\s+/g," ")+" language-"+o);var f=r.textContent;if(!f)return;f=f.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\u00a0/g," ");var l={element:r,language:o,grammar:u,code:f};t.hooks.run("before-highlight",l);if(i&&self.Worker){var c=new Worker(t.filename);c.onmessage=function(e){l.highlightedCode=n.stringify(JSON.parse(e.data));l.element.innerHTML=l.highlightedCode;s&&s.call(l.element);t.hooks.run("after-highlight",l)};c.postMessage(JSON.stringify({language:l.language,code:l.code}))}else{l.highlightedCode=t.highlight(l.code,l.grammar);l.element.innerHTML=l.highlightedCode;s&&s.call(r);t.hooks.run("after-highlight",l)}},highlight:function(e,r){return n.stringify(t.tokenize(e,r))},tokenize:function(e,n){var r=t.Token,i=[e],s=n.rest;if(s){for(var o in s)n[o]=s[o];delete n.rest}e:for(var o in n){if(!n.hasOwnProperty(o)||!n[o])continue;var u=n[o],a=u.inside,f=!!u.lookbehind||0;u=u.pattern||u;for(var l=0;l<i.length;l++){var c=i[l];if(i.length>e.length)break e;if(c instanceof r)continue;u.lastIndex=0;var h=u.exec(c);if(h){f&&(f=h[1].length);var p=h.index-1+f,h=h[0].slice(f),d=h.length,v=p+d,m=c.slice(0,p+1),g=c.slice(v+1),y=[l,1];m&&y.push(m);var b=new r(o,a?t.tokenize(h,a):h);y.push(b);g&&y.push(g);Array.prototype.splice.apply(i,y)}}}return i},hooks:{all:{},add:function(e,n){var r=t.hooks.all;r[e]=r[e]||[];r[e].push(n)},run:function(e,n){var r=t.hooks.all[e];if(!r||!r.length)return;for(var i=0,s;s=r[i++];)s(n)}}},n=t.Token=function(e,t){this.type=e;this.content=t};n.stringify=function(e){if(typeof e=="string")return e;if(Object.prototype.toString.call(e)=="[object Array]")return e.map(n.stringify).join("");var r={type:e.type,content:n.stringify(e.content),tag:"span",classes:["token",e.type],attributes:{}};r.type=="comment"&&(r.attributes.spellcheck="true");t.hooks.run("wrap",r);var i="";for(var s in r.attributes)i+=s+'="'+(r.attributes[s]||"")+'"';return"<"+r.tag+' class="'+r.classes.join(" ")+'" '+i+">"+r.content+"</"+r.tag+">"};if(!self.document){self.addEventListener("message",function(e){var n=JSON.parse(e.data),r=n.language,i=n.code;self.postMessage(JSON.stringify(t.tokenize(i,t.languages[r])));self.close()},!1);return}var r=document.getElementsByTagName("script");r=r[r.length-1];if(r){t.filename=r.src;document.addEventListener&&!r.hasAttribute("data-manual")&&document.addEventListener("DOMContentLoaded",t.highlightAll)}})();;
6
+ Prism.languages.markup={comment:/&lt;!--[\w\W]*?--(&gt;|&gt;)/g,prolog:/&lt;\?.+?\?&gt;/,doctype:/&lt;!DOCTYPE.+?&gt;/,cdata:/&lt;!\[CDATA\[[\w\W]+?]]&gt;/i,tag:{pattern:/&lt;\/?[\w:-]+\s*(?:\s+[\w:-]+(?:=(?:("|')(\\?[\w\W])*?\1|\w+))?\s*)*\/?&gt;/gi,inside:{tag:{pattern:/^&lt;\/?[\w:-]+/i,inside:{punctuation:/^&lt;\/?/,namespace:/^[\w-]+?:/}},"attr-value":{pattern:/=(?:('|")[\w\W]*?(\1)|[^\s>]+)/gi,inside:{punctuation:/=|&gt;|"/g}},punctuation:/\/?&gt;/g,"attr-name":{pattern:/[\w:-]+/g,inside:{namespace:/^[\w-]+?:/}}}},entity:/&amp;#?[\da-z]{1,8};/gi};Prism.hooks.add("wrap",function(e){e.type==="entity"&&(e.attributes.title=e.content.replace(/&amp;/,"&"))});;
@@ -0,0 +1,5 @@
1
+ <% wrap_layout :layout do %>
2
+ <div class="container">
3
+ <%= yield %>
4
+ </div>
5
+ <% end %>
@@ -0,0 +1,20 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <title><%= data.page.title || "Styleguide" %></title>
6
+
7
+ <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0 minimum-scale=1.0, user-scalable=no">
8
+
9
+ <%= stylesheet_link_tag :all %>
10
+ <%= javascript_include_tag :head %>
11
+ </head>
12
+ <body class="<%= page_classes %>">
13
+ <div class="wrapper <%= current_page.data.page_classes %>" id="wrapper">
14
+
15
+ <%= yield %>
16
+
17
+ </div>
18
+ <%= javascript_include_tag :body %>
19
+ </body>
20
+ </html>
File without changes
@@ -0,0 +1,23 @@
1
+ <!-- Different types of button elements -->
2
+ <a class="btn$modifier_class" href="#" role="button">Link</a>
3
+ <button class="btn$modifier_class" type="submit">Button</button>
4
+ <input class="btn$modifier_class" type="button" value="Input">
5
+ <input class="btn$modifier_class" type="submit" value="Submit">
6
+
7
+ <!-- Provides extra visual weight and identifies the primary action in a set of buttons -->
8
+ <button type="button" class="btn btn-primary$modifier_class">Primary</button>
9
+
10
+ <!-- Indicates a successful or positive action -->
11
+ <button type="button" class="btn btn-success$modifier_class">Success</button>
12
+
13
+ <!-- Contextual button for informational alert messages -->
14
+ <button type="button" class="btn btn-info$modifier_class">Info</button>
15
+
16
+ <!-- Indicates caution should be taken with this action -->
17
+ <button type="button" class="btn btn-warning$modifier_class">Warning</button>
18
+
19
+ <!-- Indicates a dangerous or potentially negative action -->
20
+ <button type="button" class="btn btn-danger$modifier_class">Danger</button>
21
+
22
+ <!-- Deemphasize a button by making it look like a link while maintaining button behavior -->
23
+ <button type="button" class="btn btn-link$modifier_class">Link</button>
@@ -0,0 +1,4 @@
1
+ /*
2
+ *= require colorgy
3
+ *= require styleguide/styles
4
+ */
@@ -0,0 +1,107 @@
1
+ /**
2
+ * prism.js default theme for JavaScript, CSS and HTML
3
+ * Based on dabblet (http://dabblet.com)
4
+ * @author Lea Verou
5
+ */
6
+
7
+ code[class*="language-"],
8
+ pre[class*="language-"] {
9
+ color: black;
10
+ text-shadow: 0 1px white;
11
+ font-family: Consolas, Monaco, 'Andale Mono', monospace;
12
+ direction: ltr;
13
+ text-align: left;
14
+ white-space: pre;
15
+ word-spacing: normal;
16
+
17
+ -moz-tab-size: 4;
18
+ -o-tab-size: 4;
19
+ tab-size: 4;
20
+
21
+ -webkit-hyphens: none;
22
+ -moz-hyphens: none;
23
+ -ms-hyphens: none;
24
+ hyphens: none;
25
+ }
26
+
27
+ @media print {
28
+ code[class*="language-"],
29
+ pre[class*="language-"] {
30
+ text-shadow: none;
31
+ }
32
+ }
33
+
34
+ /* Code blocks */
35
+ pre[class*="language-"] {
36
+ padding: 1em;
37
+ margin: .5em 0;
38
+ overflow: auto;
39
+ }
40
+
41
+ :not(pre) > code[class*="language-"],
42
+ pre[class*="language-"] {
43
+ background: #f5f2f0;
44
+ }
45
+
46
+ /* Inline code */
47
+ :not(pre) > code[class*="language-"] {
48
+ padding: .1em;
49
+ border-radius: .3em;
50
+ }
51
+
52
+ .token.comment,
53
+ .token.prolog,
54
+ .token.doctype,
55
+ .token.cdata {
56
+ color: slategray;
57
+ }
58
+
59
+ .token.punctuation {
60
+ color: #999;
61
+ }
62
+
63
+ .namespace {
64
+ opacity: .7;
65
+ }
66
+
67
+ .token.property,
68
+ .token.tag,
69
+ .token.boolean,
70
+ .token.number {
71
+ color: #905;
72
+ }
73
+
74
+ .token.selector,
75
+ .token.attr-name,
76
+ .token.string {
77
+ color: #690;
78
+ }
79
+
80
+ .token.operator,
81
+ .token.entity,
82
+ .token.url,
83
+ .language-css .token.string,
84
+ .style .token.string {
85
+ color: #a67f59;
86
+ background: hsla(0,0%,100%,.5);
87
+ }
88
+
89
+ .token.atrule,
90
+ .token.attr-value,
91
+ .token.keyword {
92
+ color: #07a;
93
+ }
94
+
95
+
96
+ .token.regex,
97
+ .token.important {
98
+ color: #e90;
99
+ }
100
+
101
+ .token.important {
102
+ font-weight: bold;
103
+ }
104
+
105
+ .token.entity {
106
+ cursor: help;
107
+ }