staple 0.1.7 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +24 -58
  3. data/lib/staple/amputate_generator.rb +46 -0
  4. data/lib/staple/append_generator.rb +46 -0
  5. data/lib/staple/import_generator.rb +40 -44
  6. data/lib/staple/install_generator.rb +5 -2
  7. data/lib/staple/remove_generator.rb +47 -0
  8. data/lib/staple.rb +3 -1
  9. data/source/styles/buttons/border.scss +1 -0
  10. data/source/styles/buttons/gradient-hover.scss +6 -0
  11. data/source/styles/buttons/gradient.scss +5 -0
  12. data/source/styles/buttons/inverse-transparent.scss +5 -0
  13. data/source/styles/buttons/inverse.scss +3 -0
  14. data/source/styles/buttons/plastic.scss +5 -0
  15. data/source/styles/buttons/radius.scss +1 -0
  16. data/source/styles/buttons/round.scss +1 -0
  17. data/source/styles/buttons/shadow.scss +1 -0
  18. data/source/styles/buttons/text-shadow-inner.scss +1 -0
  19. data/source/styles/buttons/text-shadow.scss +1 -0
  20. data/source/styles/buttons/transparent.scss +5 -0
  21. data/source/styles/staple/builders/build_buttons.scss +20 -0
  22. data/source/{stylesheets → styles}/staple/builders/build_colors.scss +2 -2
  23. data/source/{stylesheets → styles}/staple/buttons.scss +5 -6
  24. data/staple.gemspec +3 -3
  25. metadata +35 -22
  26. data/lib/snippet_helpers.rb +0 -69
  27. data/lib/staple/list_generator.rb +0 -22
  28. data/source/stylesheets/staple/builders/build_buttons.scss +0 -23
  29. data/source/{stylesheets → styles}/foundation_and_overrides.scss +0 -0
  30. data/source/{stylesheets → styles}/staple/builders/build_sizes.scss +0 -0
  31. data/source/{stylesheets → styles}/staple/builders/build_typography.scss +0 -0
  32. data/source/{stylesheets → styles}/staple/colors.scss +0 -0
  33. data/source/{stylesheets → styles}/staple/forms.scss +0 -0
  34. data/source/{stylesheets → styles}/staple/helpers/color_functions.scss +0 -0
  35. data/source/{stylesheets → styles}/staple/init/after.scss +0 -0
  36. data/source/{stylesheets → styles}/staple/init/before.scss +0 -0
  37. data/source/{stylesheets → styles}/staple/init/overrides.scss +0 -0
  38. data/source/{stylesheets → styles}/staple/sizes.scss +0 -0
  39. data/source/{stylesheets → styles}/staple/tables.scss +0 -0
  40. data/source/{stylesheets → styles}/staple/typography.scss +9 -9
  41. /data/source/{stylesheets → styles}/staple/utilities.scss +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5c3ed784b29090f4c4f3e2669163749782cc72f6
4
- data.tar.gz: 87caa3ec5a5dc22e2308655dfdb226deec4e0da7
3
+ metadata.gz: 2ccfafe3e428a38c7ea38cc0e81a154e6eaae559
4
+ data.tar.gz: bd67004350b0f962371fb028aa24e0888642adf2
5
5
  SHA512:
6
- metadata.gz: 39a6e783bae4df39e6b4e86aa6bb2667238648c557b0306e7341b0cfa6cbc39e504031eb146140f43f63d41e007e53631eacc6ef3281a05609a97d5eabb387d8
7
- data.tar.gz: 3b3dac53c72d36b3eb1da7f8dacdde1a943b82923965f251a1aec2b917c432595dc61a6cff94901aadace21e3fe13dc899cceef83f8b2068717f982421be2e2b
6
+ metadata.gz: c783c7d61b810992998b6f68d64f5df95f18e97b561062a8d6bcbc7f0e4088f773fa71f42aa59d73fca719378fcaeb17bd3e811514938971c9cb151ed0bd9e27
7
+ data.tar.gz: 5d3c4572db6c257fb45a9f070407406b55914bc50e791c825ff9bbb54a9db44909ba859e28f2c038027ee0aada8579c204d3a0d2f06e22cee1d5bc2e68d77c6d
data/README.md CHANGED
@@ -1,32 +1,26 @@
1
- #Staple - COMING SOON
1
+ #staple
2
2
 
3
- High level UI framework. Built on top of foundation.
3
+ Modular UI framework for rails built on top of foundation and sass.
4
4
 
5
- #STRATEGY
5
+ ##todo
6
6
 
7
- ##Main
8
- * Overrides
9
- * Default Styles
10
- * Additional Styles
11
- * Generate
7
+ * plastic should be theme/template: seperate generator? yes.
8
+ * theme folder in buttons? begin with underscore for theme?
9
+ * seperate generator? Yes. will call lower level generators in order specified
10
+ * theme generator will call each component generator
12
11
 
13
- ##Import
14
- * Override defaults
15
- * Add additional
16
- * Styles
17
- * Type of generators
18
- * Components - inherit default styles
19
-
20
- ##TODO
21
-
22
- * Generators
23
- * Remove app.erb? when?
24
-
25
- ##LOW PRIORITY
26
- * declaring as dependency does not load it?
12
+ ##lower priority todo
13
+ * declaring as dependency does not load it? vs don't require other gems
27
14
  * integration with existing projects
28
- * don't require other gems
29
- * reinstall places foundation again then does replace, seperate generator for update?
15
+ * reinstall places foundation again then does replace, separate generator for update?
16
+ * bring repeated generator code into mixin
17
+ * Set variables with generator: default
18
+ * radius
19
+ * font
20
+ * primary-color
21
+ * border-size
22
+ * change ammount (color dif, hover dif)
23
+ * create executables
30
24
 
31
25
  ##Install
32
26
 
@@ -45,39 +39,11 @@ spring stop
45
39
  rails g staple:install
46
40
  ```
47
41
 
48
- ##Simple, Universal Markup
49
- ```slim
50
- section.row
51
- nav.columns.small-3
52
- ul.side-nav
53
- li
54
- a href="#" Link 1
55
- li
56
- a href="#" Link 2
57
- article.columns.small-9
58
- h1 Article title
59
- h5.subheader Subheader
60
- p Lorem ipsum dolor sit amet, consectetur adipisicing elit.
61
- ```
62
-
63
- ##Modify Overall, Modular Style With Commands
64
- ```console
65
- staple theme:flat
66
- ```
67
-
68
- ```console
69
- staple type-face-primary:HelveticaNeau
70
- ```
71
-
72
- ```console
73
- staple type-face-secondary:ComicSans
74
- ```
75
-
76
- ```console
77
- staple color-scheme:Flatland
78
- ```
42
+ #how to use
79
43
 
80
- ##Build
44
+ rails g staple:{import|remove||append|amputate} buttons round
81
45
 
82
- gem build staple.gemspec
83
- gem push staple-0.0.1.gem
46
+ #staple command
47
+ staple {button-style|button-theme} {pattern} (append)
48
+ staple buttons round
49
+ staple buttons-theme plastic
@@ -0,0 +1,46 @@
1
+ require 'rails/generators'
2
+
3
+ module Staple
4
+ class AmputateGenerator < Rails::Generators::Base
5
+ desc 'remove styles from default'
6
+ source_root File.join(File.dirname(__FILE__), '..', '..')
7
+ argument :actions, :type => :array, :default => []
8
+
9
+ def amputate_styles
10
+ gsub_file "app/assets/stylesheets/staple/#{component}.scss", "\n.#{component.singularize}.#{pattern}{\n\t#{contents}\n}", "" if contents
11
+ gsub_file "app/assets/stylesheets/staple/builders/build_#{component}.scss", "\n.#{component.singularize}.\#{$class}.#{pattern}{\n\t#{contents}\n}", "" if contents
12
+ gsub_file "app/assets/stylesheets/staple/#{component}.scss", "\n.#{component.singularize}.#{pattern}:hover{\n\t#{hover}\n}", "" if hover
13
+ gsub_file "app/assets/stylesheets/staple/builders/build_#{component}.scss", "\n.#{component.singularize}.\#{$class}.#{pattern}:hover{\n\t#{hover}\n}", "" if hover
14
+ puts "invalid operation. for available actions: rails g staple:list [option]" if !contents
15
+ end
16
+
17
+ private
18
+
19
+ def contents
20
+ file = File.join(self.class.source_root, 'source', 'styles', "#{component}", "#{pattern.dasherize}.scss")
21
+ get_file(file)
22
+ end
23
+
24
+ def hover
25
+ file = File.join(self.class.source_root, 'source', 'styles', "#{component}", "#{pattern.dasherize}-hover.scss")
26
+ get_file(file)
27
+ end
28
+
29
+ def get_file(file)
30
+ if File.file?(file)
31
+ return File.read(file)
32
+ else
33
+ return false
34
+ end
35
+ end
36
+
37
+ def component
38
+ actions[0]
39
+ end
40
+
41
+ def pattern
42
+ actions[1]
43
+ end
44
+
45
+ end
46
+ end
@@ -0,0 +1,46 @@
1
+ require 'rails/generators'
2
+
3
+ module Staple
4
+ class AppendGenerator < Rails::Generators::Base
5
+ desc 'append the staple'
6
+ source_root File.join(File.dirname(__FILE__), '..', '..')
7
+ argument :actions, :type => :array, :default => []
8
+
9
+ def append_styles
10
+ gsub_file "app/assets/stylesheets/staple/#{component}.scss", "//&*append", "\n.#{component.singularize}.#{pattern}{\n\t#{contents}\n}//&*append" if contents
11
+ gsub_file "app/assets/stylesheets/staple/builders/build_#{component}.scss", "//&*append", "\n.#{component.singularize}.\#{$class}.#{pattern}{\n\t#{contents}\n}//&*append" if contents
12
+ gsub_file "app/assets/stylesheets/staple/#{component}.scss", "//&*append", "\n.#{component.singularize}.#{pattern}:hover{\n\t#{hover}\n}//&*append" if hover
13
+ gsub_file "app/assets/stylesheets/staple/builders/build_#{component}.scss", "//&*append", "\n.#{component.singularize}.\#{$class}.#{pattern}:hover{\n\t#{hover}\n}//&*append" if hover
14
+ puts "invalid operation. for available actions: rails g staple:list [option]" if !contents
15
+ end
16
+
17
+ private
18
+
19
+ def contents
20
+ file = File.join(self.class.source_root, 'source', 'styles', "#{component}", "#{pattern.dasherize}.scss")
21
+ get_file(file)
22
+ end
23
+
24
+ def hover
25
+ file = File.join(self.class.source_root, 'source', 'styles', "#{component}", "#{pattern.dasherize}-hover.scss")
26
+ get_file(file)
27
+ end
28
+
29
+ def get_file(file)
30
+ if File.file?(file)
31
+ return File.read(file)
32
+ else
33
+ return false
34
+ end
35
+ end
36
+
37
+ def component
38
+ actions[0]
39
+ end
40
+
41
+ def pattern
42
+ actions[1]
43
+ end
44
+
45
+ end
46
+ end
@@ -2,49 +2,45 @@ require 'rails/generators'
2
2
 
3
3
  module Staple
4
4
  class ImportGenerator < Rails::Generators::Base
5
- desc 'Copy refills'
6
- # source_root File.expand_path("../../../source", __FILE__)
7
- # argument :snippet, type: :string, required: true
8
-
9
- # def copy_html
10
- # copy_file_if_exists(
11
- # partial_name,
12
- # File.join('app', 'views', 'refills', partial_name),
13
- # )
14
- # end
15
-
16
- # def copy_styles
17
- # copy_file_if_exists(
18
- # File.join('stylesheets', 'refills', stylesheet_name),
19
- # File.join('app', 'assets', 'stylesheets', 'refills', stylesheet_name),
20
- # )
21
- # end
22
-
23
- # def copy_javascripts
24
- # copy_file_if_exists(
25
- # File.join('javascripts', 'refills', javascript_name),
26
- # File.join('app', 'assets', 'javascripts', 'refills', javascript_name),
27
- # )
28
- # end
29
-
30
- # private
31
-
32
- # def copy_file_if_exists(source, destination)
33
- # if File.exists?(File.join(self.class.source_root, source))
34
- # copy_file source, destination
35
- # end
36
- # end
37
-
38
- # def partial_name
39
- # "_#{snippet.underscore}.html.erb"
40
- # end
41
-
42
- # def stylesheet_name
43
- # "_#{snippet.dasherize}.scss"
44
- # end
45
-
46
- # def javascript_name
47
- # "#{snippet.underscore}.js"
48
- # end
5
+ desc 'bring in the staple'
6
+ source_root File.join(File.dirname(__FILE__), '..', '..')
7
+ argument :actions, :type => :array, :default => []
8
+
9
+ def import_styles
10
+ gsub_file "app/assets/stylesheets/staple/#{component}.scss", "//&*default", "\n\t#{contents}//&*default" if contents
11
+ gsub_file "app/assets/stylesheets/staple/builders/build_#{component}.scss", "//&*default", "\n\t\t#{contents}//&*default" if contents
12
+ gsub_file "app/assets/stylesheets/staple/#{component}.scss", "//&*hover", "\n\t#{hover}//&*hover" if hover
13
+ gsub_file "app/assets/stylesheets/staple/builders/build_#{component}.scss", "//&*hover", "\n\t\t#{hover}//&*hover" if hover
14
+ puts "invalid operation. for available actions: rails g staple:list [option]" if !contents
15
+ end
16
+
17
+ private
18
+
19
+ def contents
20
+ file = File.join(self.class.source_root, 'source', 'styles', "#{component}", "#{pattern.dasherize}.scss")
21
+ get_file(file)
22
+ end
23
+
24
+ def hover
25
+ file = File.join(self.class.source_root, 'source', 'styles', "#{component}", "#{pattern.dasherize}-hover.scss")
26
+ get_file(file)
27
+ end
28
+
29
+ def get_file(file)
30
+ if File.file?(file)
31
+ return File.read(file)
32
+ else
33
+ return false
34
+ end
35
+ end
36
+
37
+ def component
38
+ actions[0]
39
+ end
40
+
41
+ def pattern
42
+ actions[1]
43
+ end
44
+
49
45
  end
50
46
  end
@@ -7,7 +7,8 @@ module Staple
7
7
  def foundation_install
8
8
  generate "foundation:install", "--slim" #rails g foundation:install --slim
9
9
  # trim fat
10
- copy_file "source/stylesheets/foundation_and_overrides.scss", "app/assets/stylesheets/foundation_and_overrides.scss", :force => true
10
+ remove_file 'app/views/layout/application.html.erb'
11
+ copy_file "source/styles/foundation_and_overrides.scss", "app/assets/stylesheets/foundation_and_overrides.scss", :force => true
11
12
  gsub_file "app/assets/javascripts/application.js", "$(function(){ $(document).foundation(); });", "var ready = function() {\n\t$(document).foundation();\n\t$(document).foundation('abide', {\n\t\tinit: false,\n\t});\n}\n\n$(ready);\n$(document).on('page:load', ready);"
12
13
  end
13
14
 
@@ -49,9 +50,11 @@ module Staple
49
50
 
50
51
  #import base style
51
52
  def staple_install
52
- directory "source/stylesheets/staple", "app/assets/stylesheets/staple"
53
+ directory "source/styles/staple", "app/assets/stylesheets/staple"
53
54
  end
54
55
 
56
+ private
57
+
55
58
  def detect_css_format
56
59
  return ['.css', ' *='] if File.exist?('app/assets/stylesheets/application.css')
57
60
  return ['.css.sass', ' //='] if File.exist?('app/assets/stylesheets/application.css.sass')
@@ -0,0 +1,47 @@
1
+ require 'rails/generators'
2
+
3
+ module Staple
4
+ class RemoveGenerator < Rails::Generators::Base
5
+ desc 'remove styles from default'
6
+ source_root File.join(File.dirname(__FILE__), '..', '..')
7
+ argument :actions, :type => :array, :default => []
8
+
9
+ def remove_styles
10
+ puts "remove from default"
11
+ gsub_file "app/assets/stylesheets/staple/#{component}.scss", "\n\t#{contents}", "" if contents
12
+ gsub_file "app/assets/stylesheets/staple/builders/build_#{component}.scss", "\n\t\t#{contents}", "" if contents
13
+ gsub_file "app/assets/stylesheets/staple/#{component}.scss", "\n\t#{hover}", "" if hover
14
+ gsub_file "app/assets/stylesheets/staple/builders/build_#{component}.scss", "\n\t\t#{hover}", "" if hover
15
+ puts "invalid operation. for available actions: rails g staple:list [option]" if !contents
16
+ end
17
+
18
+ private
19
+
20
+ def contents
21
+ file = File.join(self.class.source_root, 'source', 'styles', "#{component}", "#{pattern.dasherize}.scss")
22
+ get_file(file)
23
+ end
24
+
25
+ def hover
26
+ file = File.join(self.class.source_root, 'source', 'styles', "#{component}", "#{pattern.dasherize}-hover.scss")
27
+ get_file(file)
28
+ end
29
+
30
+ def get_file(file)
31
+ if File.file?(file)
32
+ return File.read(file)
33
+ else
34
+ return false
35
+ end
36
+ end
37
+
38
+ def component
39
+ actions[0]
40
+ end
41
+
42
+ def pattern
43
+ actions[1]
44
+ end
45
+
46
+ end
47
+ end
data/lib/staple.rb CHANGED
@@ -1,3 +1,5 @@
1
1
  require 'staple/import_generator'
2
- require 'staple/list_generator'
2
+ require 'staple/append_generator'
3
+ require 'staple/remove_generator'
4
+ require 'staple/amputate_generator'
3
5
  require 'staple/install_generator'
@@ -0,0 +1 @@
1
+ border: 1px solid darken($primary-color, 6%);
@@ -0,0 +1,6 @@
1
+ $base_color: lighten($primary-color, 8%);
2
+ border-top: 1px solid adjust-hue(lighten($base_color, 12%), -3% );
3
+ background: -webkit-linear-gradient(adjust-hue(lighten($base_color, 5),-1%), $base_color); /* For Safari 5.1 to 6.0 */
4
+ background: -o-linear-gradient(adjust-hue(lighten($base_color, 5),-1%), $base_color); /* For Opera 11.1 to 12.0 */
5
+ background: -moz-linear-gradient(adjust-hue(lighten($base_color, 5),-1%), $base_color); /* For Firefox 3.6 to 15 */
6
+ background: linear-gradient(adjust-hue(lighten($base_color, 5),-1%), $base_color); /* Standard syntax */
@@ -0,0 +1,5 @@
1
+ border-top: 1px solid adjust-hue(lighten($primary_color, 12%), -3% );
2
+ background: -webkit-linear-gradient(adjust-hue(lighten($primary_color, 6),-1%), $primary_color); /* For Safari 5.1 to 6.0 */
3
+ background: -o-linear-gradient(adjust-hue(lighten($primary_color, 6),-1%), $primary_color); /* For Opera 11.1 to 12.0 */
4
+ background: -moz-linear-gradient(adjust-hue(lighten($primary_color, 6),-1%), $primary_color); /* For Firefox 3.6 to 15 */
5
+ background: linear-gradient(adjust-hue(lighten($primary_color, 6),-1%), $primary_color); /* Standard syntax */
@@ -0,0 +1,5 @@
1
+ background-color: transparent;
2
+ color: white;
3
+ border: 1px solid white;
4
+ // background-color: white;//hover
5
+ // color: $primary-color;//hover
@@ -0,0 +1,3 @@
1
+ background-color: white;
2
+ color: $primary-color;
3
+ //background-color: lighten($primary-color, 40%);//hover
@@ -0,0 +1,5 @@
1
+ border: 1px solid darken($primary-color, 6%);//border
2
+ border-bottom: 4px solid darken($primary-color, 6%);//big border bottom
3
+ box-shadow: 0 -1px 0 rgba(255,255,255,0.05) inset;//shiny
4
+ -moz-box-shadow: 0 -1px 0 rgba(255,255,255,0.05) inset;//shiny
5
+ -webkit-box-shadow: 0 -1px 0 rgba(255,255,255,0.05) inset;//shiny
@@ -0,0 +1 @@
1
+ border-radius: $global-radius;
@@ -0,0 +1 @@
1
+ border-radius: $global-rounded;
@@ -0,0 +1 @@
1
+ box-shadow: 1px 1px 1px rgba(0,0,0,0.4);
@@ -0,0 +1 @@
1
+ text-shadow: 1px 1px 0px rgba(255,255,255,0.3);
@@ -0,0 +1 @@
1
+ text-shadow: 1px 1px 0px rgba(0,0,0,0.3);
@@ -0,0 +1,5 @@
1
+ background-color: transparent;
2
+ color: $primary-color;
3
+ border: 1px solid $primary-color;
4
+ // background-color: $primary-color;//hover
5
+ // color: set-text-color($primary-color);//hover
@@ -0,0 +1,20 @@
1
+ //move to helpers
2
+ @function set-text-color($color) {
3
+ @if (lightness($color) > 60%) {
4
+ @return rgba($black, $transparent-weak); // Lighter backgorund, return dark color
5
+ } @else {
6
+ @return rgba($white, $transparent-strong); // Darker background, return light color
7
+ }
8
+ }
9
+ //BUTTON GENERATOR FOR EACH COLOR
10
+ @each $class in $button-classes {
11
+ $i: index($button-classes, $class);
12
+ $primary-color: nth($button-define, $i);
13
+ .button.#{$class}{
14
+ background-color: $primary-color;
15
+ color: set-text-color($primary-color);//&*default
16
+ }
17
+ .button.#{$class}:hover{
18
+ background-color: lighten($primary-color, $transition-brighten);//&*hover
19
+ }//&*append
20
+ }
@@ -18,13 +18,13 @@
18
18
  $i: index($accent-classes, $class);
19
19
  $color: nth($accent-define, $i);
20
20
  .#{$class}-border{
21
- border: $border-size solid $color;
21
+ border: $default-border-size solid $color;
22
22
  }
23
23
  @each $value in $opacity-values {
24
24
  $j: index($opacity-values, $value);
25
25
  $opacity: nth($opacity-define, $j);
26
26
  .#{$class}-border-#{$value}{
27
- border: $border-size solid rgba($color, $opacity);
27
+ border: $default-border-size solid rgba($color, $opacity);
28
28
  }
29
29
  }
30
30
  }
@@ -1,16 +1,15 @@
1
- //SET DEFAULT BUTTON STYLE with variables. Modify variables with thor/generators
2
1
  //DEFAULT
3
- .button{
2
+ .button, input[type="submit"]{
4
3
  background-color: $primary-color;
5
4
  color: set-text-color($primary-color);
6
5
  font-weight: 200;
7
6
  letter-spacing: 1px;
8
- transition: background-color 150ms ease-out;
7
+ transition: background-color 150ms ease-out;//&*default
9
8
  }
10
9
  .button:hover{
11
- background-color: lighten($primary-color, $transition-brighten);
12
- }
13
- //Variables determine what to generate to css
10
+ background-color: lighten($primary-color, $transition-brighten);//&*hover
11
+ }//&*append
12
+
14
13
  //BUTTON CLASSES TO GENERATE: (look in colors)
15
14
  $button-classes: primary compliment secondary tertiary;
16
15
  $button-define: $primary-color $complement-color $secondary-color $tertiary-color;
data/staple.gemspec CHANGED
@@ -4,9 +4,9 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "staple"
7
- spec.version = "0.1.7"
8
- spec.summary = "A high level ui generator."
9
- spec.description = "Built on top of foundation. See github readme for details."
7
+ spec.version = "0.2.0"
8
+ spec.summary = "Modular UI framework for rails built on top of foundation and sass."
9
+ spec.description = "See github readme for details."
10
10
  spec.authors = ["Ryan Helsing"]
11
11
  spec.email = ["ryan.helsing@centerian.com"]
12
12
  spec.homepage = "https://github.com/rhelsing/staple"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: staple
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Helsing
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-15 00:00:00.000000000 Z
11
+ date: 2014-11-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: foundation-rails
@@ -66,7 +66,7 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '2.1'
69
- description: Built on top of foundation. See github readme for details.
69
+ description: See github readme for details.
70
70
  email:
71
71
  - ryan.helsing@centerian.com
72
72
  executables: []
@@ -78,28 +78,41 @@ files:
78
78
  - LICENSE.md
79
79
  - README.md
80
80
  - Rakefile
81
- - lib/snippet_helpers.rb
82
81
  - lib/staple.rb
82
+ - lib/staple/amputate_generator.rb
83
+ - lib/staple/append_generator.rb
83
84
  - lib/staple/import_generator.rb
84
85
  - lib/staple/install_generator.rb
85
- - lib/staple/list_generator.rb
86
+ - lib/staple/remove_generator.rb
86
87
  - source/simple_form/_form.html.slim
87
- - source/stylesheets/foundation_and_overrides.scss
88
- - source/stylesheets/staple/builders/build_buttons.scss
89
- - source/stylesheets/staple/builders/build_colors.scss
90
- - source/stylesheets/staple/builders/build_sizes.scss
91
- - source/stylesheets/staple/builders/build_typography.scss
92
- - source/stylesheets/staple/buttons.scss
93
- - source/stylesheets/staple/colors.scss
94
- - source/stylesheets/staple/forms.scss
95
- - source/stylesheets/staple/helpers/color_functions.scss
96
- - source/stylesheets/staple/init/after.scss
97
- - source/stylesheets/staple/init/before.scss
98
- - source/stylesheets/staple/init/overrides.scss
99
- - source/stylesheets/staple/sizes.scss
100
- - source/stylesheets/staple/tables.scss
101
- - source/stylesheets/staple/typography.scss
102
- - source/stylesheets/staple/utilities.scss
88
+ - source/styles/buttons/border.scss
89
+ - source/styles/buttons/gradient-hover.scss
90
+ - source/styles/buttons/gradient.scss
91
+ - source/styles/buttons/inverse-transparent.scss
92
+ - source/styles/buttons/inverse.scss
93
+ - source/styles/buttons/plastic.scss
94
+ - source/styles/buttons/radius.scss
95
+ - source/styles/buttons/round.scss
96
+ - source/styles/buttons/shadow.scss
97
+ - source/styles/buttons/text-shadow-inner.scss
98
+ - source/styles/buttons/text-shadow.scss
99
+ - source/styles/buttons/transparent.scss
100
+ - source/styles/foundation_and_overrides.scss
101
+ - source/styles/staple/builders/build_buttons.scss
102
+ - source/styles/staple/builders/build_colors.scss
103
+ - source/styles/staple/builders/build_sizes.scss
104
+ - source/styles/staple/builders/build_typography.scss
105
+ - source/styles/staple/buttons.scss
106
+ - source/styles/staple/colors.scss
107
+ - source/styles/staple/forms.scss
108
+ - source/styles/staple/helpers/color_functions.scss
109
+ - source/styles/staple/init/after.scss
110
+ - source/styles/staple/init/before.scss
111
+ - source/styles/staple/init/overrides.scss
112
+ - source/styles/staple/sizes.scss
113
+ - source/styles/staple/tables.scss
114
+ - source/styles/staple/typography.scss
115
+ - source/styles/staple/utilities.scss
103
116
  - staple.gemspec
104
117
  homepage: https://github.com/rhelsing/staple
105
118
  licenses:
@@ -124,5 +137,5 @@ rubyforge_project:
124
137
  rubygems_version: 2.4.2
125
138
  signing_key:
126
139
  specification_version: 4
127
- summary: A high level ui generator.
140
+ summary: Modular UI framework for rails built on top of foundation and sass.
128
141
  test_files: []
@@ -1,69 +0,0 @@
1
- module SnippetHelpers
2
- SOURCE_DIR = File.expand_path('../../source', __FILE__)
3
-
4
- class Snippet
5
- def initialize(name)
6
- @name = name
7
- end
8
-
9
- def path
10
- File.join(*path_segments)
11
- end
12
-
13
- private
14
-
15
- attr_reader :name
16
- end
17
-
18
- class HtmlSnippet < Snippet
19
- def path_segments
20
- [SOURCE_DIR, "_#{name.underscore}.html.erb"]
21
- end
22
-
23
- def language
24
- :markup
25
- end
26
- end
27
-
28
- class ScssSnippet < Snippet
29
- def path_segments
30
- [SOURCE_DIR, 'stylesheets', 'staple', "_#{name.dasherize}.scss"]
31
- end
32
-
33
- def language
34
- :scss
35
- end
36
- end
37
-
38
- class JavaScriptSnippet < Snippet
39
- def path_segments
40
- [SOURCE_DIR, 'javascripts', 'staple', "#{name.underscore}.js"]
41
- end
42
-
43
- def language
44
- :javascript
45
- end
46
- end
47
-
48
- def code_for(snippet_name)
49
- partial 'code', locals: { snippets: snippets_for(snippet_name) }
50
- end
51
-
52
- private
53
-
54
- def snippets_for(name)
55
- [HtmlSnippet, ScssSnippet, JavaScriptSnippet].map do |snippet_factory|
56
- snippet = snippet_factory.new(name)
57
- render_snippet snippet.path, snippet.language
58
- end.join("\n")
59
- end
60
-
61
- def render_snippet(path, language)
62
- if File.exists?(path)
63
- partial 'snippet', locals: {
64
- snippet: File.read(path),
65
- language: language,
66
- }
67
- end
68
- end
69
- end
@@ -1,22 +0,0 @@
1
- require 'rails/generators'
2
-
3
- module Staple
4
- class ListGenerator < Rails::Generators::Base
5
- desc 'List Available Staples'
6
-
7
- def list
8
- puts 'Available Staples'
9
- puts '================='
10
- # stylesheets.each do |file_name|
11
- # puts '- ' + file_name.gsub(/_|\.scss/, '')
12
- # end
13
- end
14
-
15
- # private
16
- # def stylesheets
17
- # refills_dir = File.expand_path('../../../source/stylesheets/staple', __FILE__)
18
- # stylesheets = Dir.entries(refills_dir)
19
- # stylesheets.reject {|f| f == '.' || f == '..' }
20
- # end
21
- end
22
- end
@@ -1,23 +0,0 @@
1
- //load functions before calling them. put in helpers
2
- @function set-text-color($color) {
3
- @if (lightness($color) > 60%) {
4
- @return rgba($black, $transparent-weak); // Lighter backgorund, return dark color
5
- } @else {
6
- @return rgba($white, $transparent-strong); // Darker background, return light color
7
- }
8
- }
9
- //BUTTON GENERATOR FOR EACH COLOR
10
- @each $color in $button-classes {
11
- $i: index($button-classes, $color);
12
- $temp-color: nth($button-define, $i);
13
- .button.#{$color}{
14
- background-color: $temp-color;
15
- color: set-text-color($temp-color);
16
- }
17
- .button.#{$color}:hover{
18
- background-color: lighten($temp-color, $transition-brighten);
19
- }
20
- }
21
-
22
- //MODIFY DEFAULT STYLE
23
- //APPEND ADDITIONAL GENERATORS WITH COMMANDS AS NEEDED
File without changes
File without changes
File without changes
File without changes
@@ -11,6 +11,15 @@ $normal-font-weight: 400;
11
11
  $header-font-weight: 300;
12
12
  $subheader-font-weight: 400;
13
13
 
14
+ //FOUNDATION STYLES: CAN BE OVERRIDDEN BUT NEEDED
15
+ $font-family-sans-serif: $typeface-primary;
16
+ $font-family-serif: $typeface-secondary;
17
+ $font-family-monospace: $typeface-tertiary;
18
+ $body-bg: $white;//can use any from colors
19
+ $body-font-color: rgba($black, $transparent-strong);
20
+ $body-font-family: $font-family-sans-serif;
21
+ $body-font-weight: $normal-font-weight;
22
+
14
23
  //FONT CLASSES TO GENERATE
15
24
  $typeface-classes: primary secondary tertiary;
16
25
  $typeface-define: $typeface-primary $typeface-secondary $typeface-tertiary;
@@ -30,12 +39,3 @@ $spacing-define: 0.2rem 1rem;
30
39
  @import "builders/build_typography"
31
40
 
32
41
  //TODO: COOL FONT SHADOW EFFECT ON http://fittextjs.com
33
-
34
- //FOUNDATION STYLES: CAN BE OVERRIDDEN BUT NEEDED
35
- $font-family-sans-serif: $typeface-primary;
36
- $font-family-serif: $typeface-secondary;
37
- $font-family-monospace: $typeface-tertiary;
38
- $body-bg: $white;//can use any from colors
39
- $body-font-color: rgba($black, $transparent-strong);
40
- $body-font-family: $font-family-sans-serif;
41
- $body-font-weight: $normal-font-weight;