cactu 0.1.2 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +10 -15
  3. data/.travis.yml +7 -0
  4. data/CODE_OF_CONDUCT.md +74 -0
  5. data/Gemfile +1 -1
  6. data/{LICENSE.txt → LICENSE} +1 -1
  7. data/README.md +46 -16
  8. data/Rakefile +9 -0
  9. data/assets/stylesheets/base/_blocks.scss +24 -0
  10. data/assets/stylesheets/base/_global-variables.scss +62 -0
  11. data/assets/stylesheets/base/_reboot.scss +309 -0
  12. data/assets/stylesheets/cactu.scss +46 -0
  13. data/assets/stylesheets/components/_alerts.scss +48 -0
  14. data/assets/stylesheets/components/_buttons.scss +82 -0
  15. data/assets/stylesheets/components/_collapse.scss +84 -0
  16. data/assets/stylesheets/components/_dropdowns.scss +172 -0
  17. data/assets/stylesheets/components/_forms.scss +158 -0
  18. data/assets/stylesheets/components/_grids.scss +95 -0
  19. data/assets/stylesheets/components/_lists.scss +75 -0
  20. data/assets/stylesheets/components/_modals.scss +124 -0
  21. data/assets/stylesheets/components/_navbars.scss +190 -0
  22. data/assets/stylesheets/components/_navs.scss +52 -0
  23. data/assets/stylesheets/components/_paginations.scss +76 -0
  24. data/assets/stylesheets/components/_tables.scss +49 -0
  25. data/assets/stylesheets/components/_tooltips.scss +138 -0
  26. data/assets/stylesheets/elements/_button.scss +94 -0
  27. data/assets/stylesheets/elements/_code.scss +75 -0
  28. data/assets/stylesheets/elements/_icon.scss +66 -0
  29. data/assets/stylesheets/elements/_image.scss +33 -0
  30. data/assets/stylesheets/elements/_typography.scss +130 -0
  31. data/assets/stylesheets/functions/_colors.scss +40 -0
  32. data/assets/stylesheets/functions/_strings.scss +14 -0
  33. data/assets/stylesheets/mixins/_alerts.scss +18 -0
  34. data/assets/stylesheets/mixins/_breakpoints.scss +93 -0
  35. data/assets/stylesheets/mixins/_buttons.scss +96 -0
  36. data/assets/stylesheets/mixins/_forms.scss +44 -0
  37. data/assets/stylesheets/mixins/_grid.scss +18 -0
  38. data/assets/stylesheets/mixins/_hover.scss +27 -0
  39. data/assets/stylesheets/mixins/_icons.scss +22 -0
  40. data/assets/stylesheets/mixins/_navbar.scss +60 -0
  41. data/assets/stylesheets/mixins/_positions.scss +12 -0
  42. data/assets/stylesheets/mixins/_transition.scss +16 -0
  43. data/assets/stylesheets/utilities/_classes.scss +69 -0
  44. data/assets/stylesheets/utilities/_syntax.scss +81 -0
  45. data/cactu.gemspec +15 -15
  46. data/lib/cactu.rb +40 -12
  47. data/lib/cactu/engine.rb +11 -3
  48. data/lib/cactu/version.rb +1 -1
  49. metadata +123 -110
  50. data/app/assets/stylesheets/_cactu.scss +0 -15
  51. data/app/assets/stylesheets/config/_variables.scss +0 -27
  52. data/app/assets/stylesheets/functions/_grid.scss +0 -32
  53. data/app/assets/stylesheets/mixins/_fonts.scss +0 -13
  54. data/app/assets/stylesheets/mixins/_grid.scss +0 -81
  55. data/app/assets/stylesheets/mixins/_menu.scss +0 -47
  56. data/app/assets/stylesheets/ui/_base.scss +0 -53
  57. data/app/assets/stylesheets/ui/_buttons.scss +0 -13
  58. data/app/assets/stylesheets/ui/_forms.scss +0 -3
  59. data/app/assets/stylesheets/ui/_images.scss +0 -3
  60. data/app/assets/stylesheets/ui/_menus.scss +0 -4
  61. data/app/assets/stylesheets/ui/_tables.scss +0 -3
  62. data/app/assets/stylesheets/ui/_text.scss +0 -71
  63. data/bin/cactu +0 -6
  64. data/lib/cactu/generator.rb +0 -80
  65. data/test/cactu_app/.gitignore +0 -16
  66. data/test/cactu_app/Gemfile +0 -49
  67. data/test/cactu_app/README.rdoc +0 -28
  68. data/test/cactu_app/Rakefile +0 -6
  69. data/test/cactu_app/app/assets/images/.keep +0 -0
  70. data/test/cactu_app/app/assets/javascripts/application.js +0 -16
  71. data/test/cactu_app/app/assets/stylesheets/application.css.scss +0 -16
  72. data/test/cactu_app/app/assets/stylesheets/test/_test.css.scss +0 -10
  73. data/test/cactu_app/app/assets/stylesheets/test/config/_responsive_large.css.scss +0 -7
  74. data/test/cactu_app/app/assets/stylesheets/test/config/_responsive_medium.css.scss +0 -7
  75. data/test/cactu_app/app/assets/stylesheets/test/config/_responsive_short.css.scss +0 -3
  76. data/test/cactu_app/app/assets/stylesheets/test/config/_variables.css.scss +0 -7
  77. data/test/cactu_app/app/assets/stylesheets/test/pages/_home.css.scss +0 -2
  78. data/test/cactu_app/app/assets/stylesheets/test/ui/_anchors.css.scss +0 -0
  79. data/test/cactu_app/app/assets/stylesheets/test/ui/_base.css.scss +0 -0
  80. data/test/cactu_app/app/assets/stylesheets/test/ui/_navigations.css.scss +0 -3
  81. data/test/cactu_app/app/assets/stylesheets/test/ui/_text.css.scss +0 -1
  82. data/test/cactu_app/app/controllers/application_controller.rb +0 -5
  83. data/test/cactu_app/app/controllers/concerns/.keep +0 -0
  84. data/test/cactu_app/app/controllers/home_controller.rb +0 -5
  85. data/test/cactu_app/app/controllers/usage_controller.rb +0 -13
  86. data/test/cactu_app/app/helpers/application_helper.rb +0 -2
  87. data/test/cactu_app/app/mailers/.keep +0 -0
  88. data/test/cactu_app/app/models/.keep +0 -0
  89. data/test/cactu_app/app/models/concerns/.keep +0 -0
  90. data/test/cactu_app/app/views/home/index.html.haml +0 -7
  91. data/test/cactu_app/app/views/layouts/application.html.haml +0 -20
  92. data/test/cactu_app/app/views/usage/base.html.haml +0 -19
  93. data/test/cactu_app/app/views/usage/components.html.haml +0 -4
  94. data/test/cactu_app/app/views/usage/started.html.haml +0 -4
  95. data/test/cactu_app/bin/bundle +0 -3
  96. data/test/cactu_app/bin/rails +0 -4
  97. data/test/cactu_app/bin/rake +0 -4
  98. data/test/cactu_app/config.ru +0 -4
  99. data/test/cactu_app/config/application.rb +0 -23
  100. data/test/cactu_app/config/boot.rb +0 -4
  101. data/test/cactu_app/config/database.yml +0 -25
  102. data/test/cactu_app/config/environment.rb +0 -5
  103. data/test/cactu_app/config/environments/development.rb +0 -29
  104. data/test/cactu_app/config/environments/production.rb +0 -80
  105. data/test/cactu_app/config/environments/test.rb +0 -36
  106. data/test/cactu_app/config/initializers/backtrace_silencers.rb +0 -7
  107. data/test/cactu_app/config/initializers/filter_parameter_logging.rb +0 -4
  108. data/test/cactu_app/config/initializers/inflections.rb +0 -16
  109. data/test/cactu_app/config/initializers/mime_types.rb +0 -5
  110. data/test/cactu_app/config/initializers/secret_token.rb +0 -12
  111. data/test/cactu_app/config/initializers/session_store.rb +0 -3
  112. data/test/cactu_app/config/initializers/wrap_parameters.rb +0 -14
  113. data/test/cactu_app/config/locales/en.yml +0 -23
  114. data/test/cactu_app/config/routes.rb +0 -6
  115. data/test/cactu_app/db/seeds.rb +0 -7
  116. data/test/cactu_app/lib/assets/.keep +0 -0
  117. data/test/cactu_app/lib/tasks/.keep +0 -0
  118. data/test/cactu_app/log/.keep +0 -0
  119. data/test/cactu_app/public/404.html +0 -58
  120. data/test/cactu_app/public/422.html +0 -58
  121. data/test/cactu_app/public/500.html +0 -57
  122. data/test/cactu_app/public/favicon.ico +0 -0
  123. data/test/cactu_app/public/robots.txt +0 -5
  124. data/test/cactu_app/test/controllers/.keep +0 -0
  125. data/test/cactu_app/test/fixtures/.keep +0 -0
  126. data/test/cactu_app/test/helpers/.keep +0 -0
  127. data/test/cactu_app/test/integration/.keep +0 -0
  128. data/test/cactu_app/test/mailers/.keep +0 -0
  129. data/test/cactu_app/test/models/.keep +0 -0
  130. data/test/cactu_app/test/test_helper.rb +0 -15
  131. data/test/cactu_app/vendor/assets/javascripts/.keep +0 -0
  132. data/test/cactu_app/vendor/assets/stylesheets/.keep +0 -0
@@ -0,0 +1,44 @@
1
+ //
2
+ // Forms mixin
3
+ // --------------------------------------------------
4
+
5
+
6
+ @mixin input-focus($color: $blue) {
7
+ $input-box-shadow: inset 0 0 2px rgba($black, .075);
8
+ $input-focus-color: rgba($color, .25);
9
+ $input-focus-box-shadow: 0 0 0 $outline-width $input-focus-color;
10
+
11
+ border-color: $color;
12
+ box-shadow: $input-box-shadow, $input-focus-box-shadow;
13
+ }
14
+
15
+ @mixin input-validation-state($state, $color) {
16
+ input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
17
+ select,
18
+ textarea {
19
+ &.#{$state} {
20
+ border: $border-width solid $color;
21
+
22
+ &:focus {
23
+ @include input-focus($color);
24
+ }
25
+ }
26
+ }
27
+ }
28
+
29
+ @mixin validation-states($state, $color) {
30
+ @include input-validation-state($state, $color);
31
+
32
+ .form-group {
33
+ .#{$state}-feedback {
34
+ color: $color;
35
+ }
36
+
37
+ .checkbox,
38
+ .radio {
39
+ &.#{$state} {
40
+ color: $color;
41
+ }
42
+ }
43
+ }
44
+ }
@@ -0,0 +1,18 @@
1
+ //
2
+ // Grid mixins
3
+ // --------------------------------------------------
4
+
5
+
6
+ // Columns generator
7
+ //
8
+ @mixin make-specific-columns($name: '', $total-columns: $maximum-columns) {
9
+ @if $name != '' {
10
+ $name: $name + '-';
11
+ }
12
+
13
+ @for $i from 1 through $total-columns {
14
+ .#{$name}column-of-#{$i} {
15
+ width: percentage($i / $total-columns);
16
+ }
17
+ }
18
+ }
@@ -0,0 +1,27 @@
1
+ //
2
+ // Hover mixins
3
+ // --------------------------------------------------
4
+
5
+
6
+ @mixin hover-focus {
7
+ &:hover,
8
+ &:focus {
9
+ @content;
10
+ }
11
+ }
12
+
13
+ @mixin plain-hover-focus {
14
+ &,
15
+ &:hover,
16
+ &:focus {
17
+ @content;
18
+ }
19
+ }
20
+
21
+ @mixin hover-focus-active {
22
+ &:hover,
23
+ &:focus,
24
+ &:active {
25
+ @content;
26
+ }
27
+ }
@@ -0,0 +1,22 @@
1
+ //
2
+ // Icons mixin
3
+ // --------------------------------------------------
4
+
5
+
6
+ // The direction corresponds to where the arrow is
7
+ @mixin triangle-icon($size: 5px, $direction: 'down') {
8
+ @if $direction == 'up' or $direction == 'down' {
9
+ $side: if($direction == 'up', 'bottom', 'top');
10
+
11
+ border-left: $size solid transparent;
12
+ border-right: $size solid transparent;
13
+ border-#{$side}: $size solid;
14
+ }
15
+ @else {
16
+ $side: if($direction == 'left', 'right', 'left');
17
+
18
+ border-top: $size solid transparent;
19
+ border-bottom: $size solid transparent;
20
+ border-#{$side}: $size solid;
21
+ }
22
+ }
@@ -0,0 +1,60 @@
1
+ //
2
+ // Navbar mixins
3
+ // --------------------------------------------------
4
+
5
+
6
+ @mixin navbar-theme($base-color: null, $theme: 'light') {
7
+ $text: if($theme == 'light', rgba(0,0,0,.5), rgba(255,255,255,.5));
8
+ $text-hover: if($theme == 'light', rgba(0,0,0,.7), rgba(255,255,255,.7));
9
+ $text-active: if($theme == 'light', $black, $white);
10
+ $text-disabled: if($theme == 'light', rgba(0,0,0,.3), rgba(255,255,255,.3));
11
+
12
+ @if $base-color == null {
13
+ // Set default colors
14
+ border-bottom: $border-base;
15
+ background-color: $white-smoke;
16
+
17
+ * {
18
+ color: $text;
19
+
20
+ &:hover,
21
+ &:focus {
22
+ color: $text-hover;
23
+ }
24
+
25
+ &.active { color: $text-active; }
26
+ }
27
+
28
+ .navbar-brand { color: $text-active; }
29
+
30
+ .disabled {
31
+ color: $text-disabled;
32
+ &:hover,
33
+ &:focus { color: $text-disabled; }
34
+ }
35
+
36
+ // Set selected
37
+ } @else {
38
+ border-bottom: $border-width solid theme-color-level($base-color, 1);
39
+ background: $base-color;
40
+
41
+ * {
42
+ color: $text;
43
+
44
+ &:hover,
45
+ &:focus {
46
+ color: $text-hover;
47
+ }
48
+
49
+ &.active { color: $text-active; }
50
+ }
51
+
52
+ .navbar-brand { color: $text-active; }
53
+
54
+ .disabled {
55
+ color: $text-disabled;
56
+ &:hover,
57
+ &:focus { color: $text-disabled; }
58
+ }
59
+ }
60
+ }
@@ -0,0 +1,12 @@
1
+ //
2
+ // Position mixins
3
+ // --------------------------------------------------
4
+
5
+
6
+ // Set an element with position sticky and top but you decide
7
+ //the overpositioned
8
+ @mixin sticky-top($zindex: 100) {
9
+ position: sticky;
10
+ top: 0;
11
+ z-index: $zindex;
12
+ }
@@ -0,0 +1,16 @@
1
+ //
2
+ // Transition mixins
3
+ // --------------------------------------------------
4
+
5
+
6
+ @mixin transition($transition...) {
7
+ @if length($transition) == 0 {
8
+ transition: $transition-all;
9
+ } @else {
10
+ transition: $transition;
11
+ }
12
+
13
+ @media screen and (prefers-reduced-motion: reduce) {
14
+ transition: none;
15
+ }
16
+ }
@@ -0,0 +1,69 @@
1
+ //
2
+ // Clases utility
3
+ // --------------------------------------------------
4
+
5
+
6
+ $example-code-color: $white-smoke !default;
7
+ $disabled-class-color: $disabled-color !default;
8
+
9
+ // Class with -expanded to the end
10
+ //
11
+ [class*="-expanded"] {
12
+ width: 100%;
13
+ max-width: 100%;
14
+ }
15
+
16
+ .highlight-example {
17
+ border: 3px solid $example-code-color;
18
+ padding: 1.5rem 1rem;
19
+ margin-top: 1rem;
20
+ }
21
+
22
+ .disabled {
23
+ color: $disabled-class-color;
24
+ pointer-events: none;
25
+
26
+ @include hover-focus {
27
+ color: $disabled-class-color;
28
+ }
29
+ }
30
+
31
+ // Alignment classes to the end
32
+ //
33
+ // Not used for display flex
34
+ [class*="-centered"] {
35
+ text-align: center;
36
+ }
37
+ [class*="-right"] {
38
+ text-align: right;
39
+ }
40
+
41
+ // For flex alignment
42
+ [class*="-start"] {
43
+ justify-content: start;
44
+ }
45
+ [class*="-center"] {
46
+ justify-content: center;
47
+ }
48
+ [class*="-end"] {
49
+ justify-content: end;
50
+ }
51
+ [class*="-around"] {
52
+ justify-content: space-around;
53
+ }
54
+ [class*="-between"] {
55
+ justify-content: space-between;
56
+ }
57
+ [class*="-evenly"] {
58
+ justify-content: space-evenly;
59
+ }
60
+
61
+
62
+ // Dispay classes
63
+ //
64
+ .show { display: block !important; }
65
+ .hidden { display: none !important; }
66
+
67
+ .clipped {
68
+ overflow: hidden;
69
+ }
@@ -0,0 +1,81 @@
1
+ //
2
+ // Syntax
3
+ // For highlight styles
4
+ // --------------------------------------------------
5
+
6
+ .hll { background-color: #ffc; }
7
+ .c { color: #999; }
8
+ .k { color: #069; }
9
+ .o { color: #555; }
10
+ .cm { color: #999; }
11
+ .cp { color: #099; }
12
+ .c1 { color: #999; }
13
+ .cs { color: #999; }
14
+ .gd { background-color: #fcc; border: 1px solid #c00; }
15
+ .ge { font-style: italic; }
16
+ .gr { color: #f00; }
17
+ .gh { color: #030; }
18
+ .gi { background-color: #cfc; border: 1px solid #0c0; }
19
+ .go { color: #aaa; }
20
+ .gp { color: #009; }
21
+ .gu { color: #030; }
22
+ .gt { color: #9c6; }
23
+ .kc { color: #069; }
24
+ .kd { color: #069; }
25
+ .kn { color: #069; }
26
+ .kp { color: #069; }
27
+ .kr { color: #069; }
28
+ .kt { color: #078; }
29
+ .m { color: #f60; }
30
+ .s { color: #d44950; }
31
+ .na { color: #4f9fcf; }
32
+ .nb { color: #366; }
33
+ .nc { color: #0a8; }
34
+ .no { color: #360; }
35
+ .nd { color: #99f; }
36
+ .ni { color: #999; }
37
+ .ne { color: #c00; }
38
+ .nf { color: #c0f; }
39
+ .nl { color: #99f; }
40
+ .nn { color: #0cf; }
41
+ .nt { color: #2f6f9f; }
42
+ .nv { color: #033; }
43
+ .ow { color: #000; }
44
+ .w { color: #bbb; }
45
+ .mf { color: #f60; }
46
+ .mh { color: #f60; }
47
+ .mi { color: #f60; }
48
+ .mo { color: #f60; }
49
+ .sb { color: #c30; }
50
+ .sc { color: #c30; }
51
+ .sd { font-style: italic; color: #c30; }
52
+ .s2 { color: #c30; }
53
+ .se { color: #c30; }
54
+ .sh { color: #c30; }
55
+ .si { color: #a00; }
56
+ .sx { color: #c30; }
57
+ .sr { color: #3aa; }
58
+ .s1 { color: #c30; }
59
+ .ss { color: #fc3; }
60
+ .bp { color: #366; }
61
+ .vc { color: #033; }
62
+ .vg { color: #033; }
63
+ .vi { color: #033; }
64
+ .il { color: #f60; }
65
+
66
+ .css .o,
67
+ .css .o + .nt,
68
+ .css .nt + .nt { color: #999; }
69
+
70
+ .language-bash::before,
71
+ .language-sh::before {
72
+ color: #009;
73
+ content: "$ ";
74
+ user-select: none;
75
+ }
76
+
77
+ .language-powershell::before {
78
+ color: #009;
79
+ content: "PM> ";
80
+ user-select: none;
81
+ }
@@ -1,26 +1,26 @@
1
- # coding: utf-8
2
- $:.push File.expand_path("../lib", __FILE__)
3
- require 'cactu/version'
1
+
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "cactu/version"
4
5
 
5
6
  Gem::Specification.new do |spec|
6
7
  spec.name = "cactu"
7
8
  spec.version = Cactu::VERSION
8
- spec.platform = Gem::Platform::RUBY
9
9
  spec.authors = ["Giovanni Mendoza"]
10
10
  spec.email = ["mendozagioo@gmail.com"]
11
- spec.summary = "Cactu is a CSS library to help us to create webs easily"
12
- spec.description = "Cactu is a CSS library created to help any developer to create web pages very quickly and an easy way"
13
- spec.homepage = "https://github.com/mendozagioo/cactu"
11
+ spec.summary = %q{A Sass framework to create webs easily, created to be simple, semantic, fast to learn, customizable, and scalable.}
12
+ spec.homepage = "http://cactu.site"
14
13
  spec.license = "MIT"
15
14
 
16
- spec.rubyforge_project = "cactu"
17
-
18
- spec.files = `git ls-files`.split("\n")
19
- spec.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
20
- spec.require_paths = ["lib"]
15
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
16
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
17
+ end
21
18
 
22
- spec.add_dependency('sass', '>= 3.2.0')
23
- spec.add_dependency('thor')
19
+ spec.add_runtime_dependency 'sassc', '~> 1.12', '>= 1.12.1'
20
+ spec.add_runtime_dependency 'autoprefixer-rails', '~> 9.1', '>= 9.1.0'
24
21
 
25
- spec.add_development_dependency "rake"
22
+ spec.add_development_dependency "minitest", "~> 5.0"
23
+ spec.add_development_dependency 'term-ansicolor', '~> 0'
24
+ spec.add_development_dependency 'sprockets-rails', '~> 2.3', '>= 2.3.2'
25
+ spec.add_development_dependency 'uglifier', '~> 0'
26
26
  end
@@ -1,20 +1,48 @@
1
- # CodeKit needs relative paths
2
- dir = File.dirname(__FILE__)
3
- $LOAD_PATH.unshift dir unless $LOAD_PATH.include?(dir)
1
+ require 'cactu/version'
4
2
 
5
- require "cactu/generator"
3
+ module Cactu
4
+ class << self
5
+ def load!
6
+ if rails?
7
+ register_rails_engine
8
+ elsif sprockets?
9
+ register_sprockets
10
+ elsif defined?(::Sass) && ::Sass.respond_to?(:load_paths)
11
+ ::Sass.load_paths << stylesheets_path
12
+ end
13
+ end
6
14
 
7
- unless defined?(Sass)
8
- require 'sass'
9
- end
15
+ # Paths
16
+ def gem_path
17
+ @gem_path ||= File.expand_path '..', File.dirname(__FILE__)
18
+ end
10
19
 
11
- module Cactu
12
- if defined?(Rails) && defined?(Rails::Engine)
13
- class Engine < ::Rails::Engine
20
+ def stylesheets_path
21
+ File.join assets_path, 'stylesheets'
22
+ end
23
+
24
+ def assets_path
25
+ @assets_path ||= File.join gem_path, 'assets'
26
+ end
27
+
28
+ def sprockets?
29
+ defined?(::Sprockets)
30
+ end
31
+
32
+ def rails?
33
+ defined?(::Rails)
34
+ end
35
+
36
+ private
37
+
38
+ def register_rails_engine
14
39
  require 'cactu/engine'
15
40
  end
16
41
 
17
- else
18
- Sass.load_paths << File.expand_path("../../app/assets/stylesheets", __FILE__)
42
+ def register_sprockets
43
+ Sprockets.append_path(stylesheets_path)
44
+ end
19
45
  end
20
46
  end
47
+
48
+ Cactu.load!