shoestrap-rails 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +4 -0
  3. data/Gemfile +3 -0
  4. data/LICENSE.md +22 -0
  5. data/README.md +3 -0
  6. data/Rakefile +80 -0
  7. data/assets/stylesheets/_shoestrap.scss +23 -0
  8. data/assets/stylesheets/shoestrap/_grid.scss +84 -0
  9. data/assets/stylesheets/shoestrap/_mixins.scss +18 -0
  10. data/assets/stylesheets/shoestrap/_normalize.scss +427 -0
  11. data/assets/stylesheets/shoestrap/_print.scss +90 -0
  12. data/assets/stylesheets/shoestrap/_scaffolding.scss +161 -0
  13. data/assets/stylesheets/shoestrap/_type.scss +299 -0
  14. data/assets/stylesheets/shoestrap/_utilities.scss +21 -0
  15. data/assets/stylesheets/shoestrap/_variables.scss +240 -0
  16. data/assets/stylesheets/shoestrap/mixins/_background-variant.scss +12 -0
  17. data/assets/stylesheets/shoestrap/mixins/_clearfix.scss +22 -0
  18. data/assets/stylesheets/shoestrap/mixins/_grid-framework.scss +81 -0
  19. data/assets/stylesheets/shoestrap/mixins/_grid.scss +122 -0
  20. data/assets/stylesheets/shoestrap/mixins/_image.scss +33 -0
  21. data/assets/stylesheets/shoestrap/mixins/_reset-text.scss +18 -0
  22. data/assets/stylesheets/shoestrap/mixins/_tab-focus.scss +9 -0
  23. data/assets/stylesheets/shoestrap/mixins/_text-emphasis.scss +12 -0
  24. data/assets/stylesheets/shoestrap/mixins/_text-overflow.scss +8 -0
  25. data/assets/stylesheets/shoestrap/mixins/_vendor-prefixes.scss +222 -0
  26. data/lib/shoestrap-rails.rb +57 -0
  27. data/lib/shoestrap-rails/engine.rb +9 -0
  28. data/lib/shoestrap-rails/version.rb +3 -0
  29. data/shoestrap-rails.gemspec +35 -0
  30. data/test/compilation_test.rb +18 -0
  31. data/test/dummy_rails/README.rdoc +3 -0
  32. data/test/dummy_rails/Rakefile +6 -0
  33. data/test/dummy_rails/app/assets/images/.keep +0 -0
  34. data/test/dummy_rails/app/assets/javascripts/application.js +1 -0
  35. data/test/dummy_rails/app/assets/stylesheets/application.sass +1 -0
  36. data/test/dummy_rails/app/controllers/application_controller.rb +5 -0
  37. data/test/dummy_rails/app/controllers/pages_controller.rb +4 -0
  38. data/test/dummy_rails/app/helpers/application_helper.rb +2 -0
  39. data/test/dummy_rails/app/views/layouts/application.html.erb +14 -0
  40. data/test/dummy_rails/app/views/pages/root.html.slim +84 -0
  41. data/test/dummy_rails/config.ru +4 -0
  42. data/test/dummy_rails/config/application.rb +30 -0
  43. data/test/dummy_rails/config/boot.rb +5 -0
  44. data/test/dummy_rails/config/environment.rb +5 -0
  45. data/test/dummy_rails/config/environments/development.rb +23 -0
  46. data/test/dummy_rails/config/environments/production.rb +82 -0
  47. data/test/dummy_rails/config/environments/test.rb +38 -0
  48. data/test/dummy_rails/config/initializers/backtrace_silencers.rb +7 -0
  49. data/test/dummy_rails/config/initializers/filter_parameter_logging.rb +4 -0
  50. data/test/dummy_rails/config/initializers/inflections.rb +16 -0
  51. data/test/dummy_rails/config/initializers/mime_types.rb +5 -0
  52. data/test/dummy_rails/config/initializers/secret_token.rb +18 -0
  53. data/test/dummy_rails/config/initializers/session_store.rb +3 -0
  54. data/test/dummy_rails/config/initializers/wrap_parameters.rb +14 -0
  55. data/test/dummy_rails/config/locales/en.yml +3 -0
  56. data/test/dummy_rails/config/locales/es.yml +3 -0
  57. data/test/dummy_rails/config/routes.rb +3 -0
  58. data/test/dummy_rails/log/.keep +0 -0
  59. data/test/dummy_rails/log/production.log +0 -0
  60. data/test/dummy_rails/log/test.log +264 -0
  61. data/test/dummy_sass_only/Gemfile +4 -0
  62. data/test/dummy_sass_only/compile.rb +13 -0
  63. data/test/dummy_sass_only/import_all.sass +1 -0
  64. data/test/gemfiles/rails_head.gemfile +17 -0
  65. data/test/gemfiles/rails_head.gemfile.lock +214 -0
  66. data/test/gemfiles/sass_3_3.gemfile +6 -0
  67. data/test/gemfiles/sass_3_3.gemfile.lock +171 -0
  68. data/test/gemfiles/sass_3_4.gemfile +7 -0
  69. data/test/gemfiles/sass_3_4.gemfile.lock +171 -0
  70. data/test/gemfiles/sass_head.gemfile +6 -0
  71. data/test/gemfiles/sass_head.gemfile.lock +183 -0
  72. data/test/pages_test.rb +15 -0
  73. data/test/sass_test.rb +22 -0
  74. data/test/sprockets_rails_test.rb +27 -0
  75. data/test/support/dummy_rails_integration.rb +22 -0
  76. data/test/support/reporting.rb +27 -0
  77. data/test/test_helper.rb +36 -0
  78. data/test/test_helper_rails.rb +6 -0
  79. metadata +352 -0
@@ -0,0 +1,33 @@
1
+ // Image Mixins
2
+ // - Responsive image
3
+ // - Retina image
4
+
5
+
6
+ // Responsive image
7
+ //
8
+ // Keep images from scaling beyond the width of their parents.
9
+ @mixin img-responsive($display: block) {
10
+ display: $display;
11
+ max-width: 100%; // Part 1: Set a maximum relative to the parent
12
+ height: auto; // Part 2: Scale the height according to the width, otherwise you get stretching
13
+ }
14
+
15
+
16
+ // Retina image
17
+ //
18
+ // Short retina mixin for setting background-image and -size. Note that the
19
+ // spelling of `min--moz-device-pixel-ratio` is intentional.
20
+ @mixin img-retina($file-1x, $file-2x, $width-1x, $height-1x) {
21
+ background-image: url(if($bootstrap-sass-asset-helper, twbs-image-path("#{$file-1x}"), "#{$file-1x}"));
22
+
23
+ @media
24
+ only screen and (-webkit-min-device-pixel-ratio: 2),
25
+ only screen and ( min--moz-device-pixel-ratio: 2),
26
+ only screen and ( -o-min-device-pixel-ratio: 2/1),
27
+ only screen and ( min-device-pixel-ratio: 2),
28
+ only screen and ( min-resolution: 192dpi),
29
+ only screen and ( min-resolution: 2dppx) {
30
+ background-image: url(if($bootstrap-sass-asset-helper, twbs-image-path("#{$file-2x}"), "#{$file-2x}"));
31
+ background-size: $width-1x $height-1x;
32
+ }
33
+ }
@@ -0,0 +1,18 @@
1
+ @mixin reset-text() {
2
+ font-family: $font-family-base;
3
+ // We deliberately do NOT reset font-size.
4
+ font-style: normal;
5
+ font-weight: normal;
6
+ letter-spacing: normal;
7
+ line-break: auto;
8
+ line-height: $line-height-base;
9
+ text-align: left; // Fallback for where `start` is not supported
10
+ text-align: start;
11
+ text-decoration: none;
12
+ text-shadow: none;
13
+ text-transform: none;
14
+ white-space: normal;
15
+ word-break: normal;
16
+ word-spacing: normal;
17
+ word-wrap: normal;
18
+ }
@@ -0,0 +1,9 @@
1
+ // WebKit-style focus
2
+
3
+ @mixin tab-focus() {
4
+ // Default
5
+ outline: thin dotted;
6
+ // WebKit
7
+ outline: 5px auto -webkit-focus-ring-color;
8
+ outline-offset: -2px;
9
+ }
@@ -0,0 +1,12 @@
1
+ // Typography
2
+
3
+ // [converter] $parent hack
4
+ @mixin text-emphasis-variant($parent, $color) {
5
+ #{$parent} {
6
+ color: $color;
7
+ }
8
+ a#{$parent}:hover,
9
+ a#{$parent}:focus {
10
+ color: darken($color, 10%);
11
+ }
12
+ }
@@ -0,0 +1,8 @@
1
+ // Text overflow
2
+ // Requires inline-block or block for proper styling
3
+
4
+ @mixin text-overflow() {
5
+ overflow: hidden;
6
+ text-overflow: ellipsis;
7
+ white-space: nowrap;
8
+ }
@@ -0,0 +1,222 @@
1
+ // Vendor Prefixes
2
+ //
3
+ // All vendor mixins are deprecated as of v3.2.0 due to the introduction of
4
+ // Autoprefixer in our Gruntfile. They have been removed in v4.
5
+
6
+ // - Animations
7
+ // - Backface visibility
8
+ // - Box shadow
9
+ // - Box sizing
10
+ // - Content columns
11
+ // - Hyphens
12
+ // - Placeholder text
13
+ // - Transformations
14
+ // - Transitions
15
+ // - User Select
16
+
17
+
18
+ // Animations
19
+ @mixin animation($animation) {
20
+ -webkit-animation: $animation;
21
+ -o-animation: $animation;
22
+ animation: $animation;
23
+ }
24
+ @mixin animation-name($name) {
25
+ -webkit-animation-name: $name;
26
+ animation-name: $name;
27
+ }
28
+ @mixin animation-duration($duration) {
29
+ -webkit-animation-duration: $duration;
30
+ animation-duration: $duration;
31
+ }
32
+ @mixin animation-timing-function($timing-function) {
33
+ -webkit-animation-timing-function: $timing-function;
34
+ animation-timing-function: $timing-function;
35
+ }
36
+ @mixin animation-delay($delay) {
37
+ -webkit-animation-delay: $delay;
38
+ animation-delay: $delay;
39
+ }
40
+ @mixin animation-iteration-count($iteration-count) {
41
+ -webkit-animation-iteration-count: $iteration-count;
42
+ animation-iteration-count: $iteration-count;
43
+ }
44
+ @mixin animation-direction($direction) {
45
+ -webkit-animation-direction: $direction;
46
+ animation-direction: $direction;
47
+ }
48
+ @mixin animation-fill-mode($fill-mode) {
49
+ -webkit-animation-fill-mode: $fill-mode;
50
+ animation-fill-mode: $fill-mode;
51
+ }
52
+
53
+ // Backface visibility
54
+ // Prevent browsers from flickering when using CSS 3D transforms.
55
+ // Default value is `visible`, but can be changed to `hidden`
56
+
57
+ @mixin backface-visibility($visibility) {
58
+ -webkit-backface-visibility: $visibility;
59
+ -moz-backface-visibility: $visibility;
60
+ backface-visibility: $visibility;
61
+ }
62
+
63
+ // Drop shadows
64
+ //
65
+ // Note: Deprecated `.box-shadow()` as of v3.1.0 since all of Bootstrap's
66
+ // supported browsers that have box shadow capabilities now support it.
67
+
68
+ @mixin box-shadow($shadow...) {
69
+ -webkit-box-shadow: $shadow; // iOS <4.3 & Android <4.1
70
+ box-shadow: $shadow;
71
+ }
72
+
73
+ // Box sizing
74
+ @mixin box-sizing($boxmodel) {
75
+ -webkit-box-sizing: $boxmodel;
76
+ -moz-box-sizing: $boxmodel;
77
+ box-sizing: $boxmodel;
78
+ }
79
+
80
+ // CSS3 Content Columns
81
+ @mixin content-columns($column-count, $column-gap: $grid-gutter-width) {
82
+ -webkit-column-count: $column-count;
83
+ -moz-column-count: $column-count;
84
+ column-count: $column-count;
85
+ -webkit-column-gap: $column-gap;
86
+ -moz-column-gap: $column-gap;
87
+ column-gap: $column-gap;
88
+ }
89
+
90
+ // Optional hyphenation
91
+ @mixin hyphens($mode: auto) {
92
+ word-wrap: break-word;
93
+ -webkit-hyphens: $mode;
94
+ -moz-hyphens: $mode;
95
+ -ms-hyphens: $mode; // IE10+
96
+ -o-hyphens: $mode;
97
+ hyphens: $mode;
98
+ }
99
+
100
+ // Placeholder text
101
+ @mixin placeholder($color: $input-color-placeholder) {
102
+ // Firefox
103
+ &::-moz-placeholder {
104
+ color: $color;
105
+ opacity: 1; // Override Firefox's unusual default opacity; see https://github.com/twbs/bootstrap/pull/11526
106
+ }
107
+ &:-ms-input-placeholder { color: $color; } // Internet Explorer 10+
108
+ &::-webkit-input-placeholder { color: $color; } // Safari and Chrome
109
+ }
110
+
111
+ // Transformations
112
+ @mixin scale($ratio...) {
113
+ -webkit-transform: scale($ratio);
114
+ -ms-transform: scale($ratio); // IE9 only
115
+ -o-transform: scale($ratio);
116
+ transform: scale($ratio);
117
+ }
118
+
119
+ @mixin scaleX($ratio) {
120
+ -webkit-transform: scaleX($ratio);
121
+ -ms-transform: scaleX($ratio); // IE9 only
122
+ -o-transform: scaleX($ratio);
123
+ transform: scaleX($ratio);
124
+ }
125
+ @mixin scaleY($ratio) {
126
+ -webkit-transform: scaleY($ratio);
127
+ -ms-transform: scaleY($ratio); // IE9 only
128
+ -o-transform: scaleY($ratio);
129
+ transform: scaleY($ratio);
130
+ }
131
+ @mixin skew($x, $y) {
132
+ -webkit-transform: skewX($x) skewY($y);
133
+ -ms-transform: skewX($x) skewY($y); // See https://github.com/twbs/bootstrap/issues/4885; IE9+
134
+ -o-transform: skewX($x) skewY($y);
135
+ transform: skewX($x) skewY($y);
136
+ }
137
+ @mixin translate($x, $y) {
138
+ -webkit-transform: translate($x, $y);
139
+ -ms-transform: translate($x, $y); // IE9 only
140
+ -o-transform: translate($x, $y);
141
+ transform: translate($x, $y);
142
+ }
143
+ @mixin translate3d($x, $y, $z) {
144
+ -webkit-transform: translate3d($x, $y, $z);
145
+ transform: translate3d($x, $y, $z);
146
+ }
147
+ @mixin rotate($degrees) {
148
+ -webkit-transform: rotate($degrees);
149
+ -ms-transform: rotate($degrees); // IE9 only
150
+ -o-transform: rotate($degrees);
151
+ transform: rotate($degrees);
152
+ }
153
+ @mixin rotateX($degrees) {
154
+ -webkit-transform: rotateX($degrees);
155
+ -ms-transform: rotateX($degrees); // IE9 only
156
+ -o-transform: rotateX($degrees);
157
+ transform: rotateX($degrees);
158
+ }
159
+ @mixin rotateY($degrees) {
160
+ -webkit-transform: rotateY($degrees);
161
+ -ms-transform: rotateY($degrees); // IE9 only
162
+ -o-transform: rotateY($degrees);
163
+ transform: rotateY($degrees);
164
+ }
165
+ @mixin perspective($perspective) {
166
+ -webkit-perspective: $perspective;
167
+ -moz-perspective: $perspective;
168
+ perspective: $perspective;
169
+ }
170
+ @mixin perspective-origin($perspective) {
171
+ -webkit-perspective-origin: $perspective;
172
+ -moz-perspective-origin: $perspective;
173
+ perspective-origin: $perspective;
174
+ }
175
+ @mixin transform-origin($origin) {
176
+ -webkit-transform-origin: $origin;
177
+ -moz-transform-origin: $origin;
178
+ -ms-transform-origin: $origin; // IE9 only
179
+ transform-origin: $origin;
180
+ }
181
+
182
+
183
+ // Transitions
184
+
185
+ @mixin transition($transition...) {
186
+ -webkit-transition: $transition;
187
+ -o-transition: $transition;
188
+ transition: $transition;
189
+ }
190
+ @mixin transition-property($transition-property...) {
191
+ -webkit-transition-property: $transition-property;
192
+ transition-property: $transition-property;
193
+ }
194
+ @mixin transition-delay($transition-delay) {
195
+ -webkit-transition-delay: $transition-delay;
196
+ transition-delay: $transition-delay;
197
+ }
198
+ @mixin transition-duration($transition-duration...) {
199
+ -webkit-transition-duration: $transition-duration;
200
+ transition-duration: $transition-duration;
201
+ }
202
+ @mixin transition-timing-function($timing-function) {
203
+ -webkit-transition-timing-function: $timing-function;
204
+ transition-timing-function: $timing-function;
205
+ }
206
+ @mixin transition-transform($transition...) {
207
+ -webkit-transition: -webkit-transform $transition;
208
+ -moz-transition: -moz-transform $transition;
209
+ -o-transition: -o-transform $transition;
210
+ transition: transform $transition;
211
+ }
212
+
213
+
214
+ // User select
215
+ // For selecting text on the page
216
+
217
+ @mixin user-select($select) {
218
+ -webkit-user-select: $select;
219
+ -moz-user-select: $select;
220
+ -ms-user-select: $select; // IE10+
221
+ user-select: $select;
222
+ }
@@ -0,0 +1,57 @@
1
+ module Shoestrap
2
+ class << self
3
+ # Inspired by Kaminari
4
+ def load!
5
+ if rails?
6
+ register_rails_engine
7
+ elsif sprockets?
8
+ register_sprockets
9
+ end
10
+
11
+ configure_sass
12
+ end
13
+
14
+ # Paths
15
+ def gem_path
16
+ @gem_path ||= File.expand_path '..', File.dirname(__FILE__)
17
+ end
18
+
19
+ def stylesheets_path
20
+ File.join assets_path, 'stylesheets'
21
+ end
22
+
23
+ def assets_path
24
+ @assets_path ||= File.join gem_path, 'assets'
25
+ end
26
+
27
+ # Environment detection helpers
28
+ def sprockets?
29
+ defined?(::Sprockets)
30
+ end
31
+
32
+ def rails?
33
+ defined?(::Rails)
34
+ end
35
+
36
+ private
37
+
38
+ def configure_sass
39
+ require 'sass'
40
+
41
+ ::Sass.load_paths << stylesheets_path
42
+
43
+ # bootstrap requires minimum precision of 8, see https://github.com/twbs/bootstrap-sass/issues/409
44
+ ::Sass::Script::Number.precision = [8, ::Sass::Script::Number.precision].max
45
+ end
46
+
47
+ def register_rails_engine
48
+ require 'shoestrap-rails/engine'
49
+ end
50
+
51
+ def register_sprockets
52
+ Sprockets.append_path(stylesheets_path)
53
+ end
54
+ end
55
+ end
56
+
57
+ Shoestrap.load!
@@ -0,0 +1,9 @@
1
+ module Shoestrap
2
+ module Rails
3
+ class Engine < ::Rails::Engine
4
+ initializer 'shoestrap-rails.assets.precompile' do |app|
5
+ app.config.assets.paths << root.join('assets', 'stylesheets').to_s
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,3 @@
1
+ module Shoestrap
2
+ VERSION = '0.0.1'
3
+ end
@@ -0,0 +1,35 @@
1
+ lib = File.expand_path('../lib', __FILE__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+ require 'shoestrap-rails/version'
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = 'shoestrap-rails'
7
+ s.version = Shoestrap::VERSION
8
+ s.authors = ['Jonathan Pike']
9
+ s.email = 'jonathan.d.s.pike@gmail.com'
10
+ s.summary = 'Shoestrap: Bootstrap 3, but just a subset.'
11
+ s.description = 'Shoestrap is a small subset of Bootstrap 3 with only core grid system, typography and layout components.'
12
+ s.homepage = 'https://github.com/jonathanpike/shoestrap'
13
+ s.license = 'MIT'
14
+
15
+ s.add_runtime_dependency 'sass', '~> 3.3'
16
+ s.add_runtime_dependency 'autoprefixer-rails', '~> 5.2'
17
+
18
+ # Testing dependencies
19
+ s.add_development_dependency 'minitest', '~> 5.8'
20
+ s.add_development_dependency 'minitest-reporters', '~> 1.1'
21
+ # Integration testing
22
+ s.add_development_dependency 'capybara', '~> 2.5'
23
+ s.add_development_dependency 'poltergeist', '~> 1.8'
24
+ # Dummy Rails app dependencies
25
+ s.add_development_dependency 'actionpack', '~> 4.1'
26
+ s.add_development_dependency 'activesupport', '~> 4.1'
27
+ s.add_development_dependency 'json', '~> 1.8'
28
+ s.add_development_dependency 'sprockets-rails', '~> 2.1'
29
+ s.add_development_dependency 'jquery-rails', '~> 3.1'
30
+ s.add_development_dependency 'slim-rails', '~> 3.0'
31
+ s.add_development_dependency 'uglifier', '~> 2.7'
32
+
33
+ s.files = `git ls-files`.split("\n")
34
+ s.test_files = `git ls-files -- test/*`.split("\n")
35
+ end
@@ -0,0 +1,18 @@
1
+ require 'test_helper'
2
+ require 'fileutils'
3
+ require 'sass'
4
+
5
+ class CompilationTest < Minitest::Test
6
+ def test_compilation
7
+ path = 'assets/stylesheets'
8
+ %w(_shoestrap).each do |file|
9
+ FileUtils.rm_rf('.sass-cache', secure: true)
10
+ engine = Sass::Engine.for_file("#{path}/#{file}.scss", syntax: :scss, load_paths: [path])
11
+ FileUtils.mkdir_p("tmp/#{File.dirname(file)}")
12
+ File.open("tmp/#{file}.css", 'w') { |f|
13
+ f.write engine.render
14
+ }
15
+ assert true # nothing was raised
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,3 @@
1
+ == README
2
+
3
+ This is a minimal Rails app for testing
@@ -0,0 +1,6 @@
1
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
2
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
+
4
+ require File.expand_path('../config/application', __FILE__)
5
+
6
+ Dummy::Application.load_tasks