neat 1.7.0 → 4.0.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 (144) hide show
  1. checksums.yaml +5 -5
  2. data/.circleci/config.yml +34 -0
  3. data/.github/ISSUE_TEMPLATE.md +22 -0
  4. data/.github/PULL_REQUEST_TEMPLATE.md +8 -0
  5. data/.gitignore +4 -2
  6. data/.hound.yml +5 -0
  7. data/.npmignore +20 -0
  8. data/.scss-lint.yml +239 -0
  9. data/.tool-versions +2 -0
  10. data/CHANGELOG.md +388 -0
  11. data/CODE_OF_CONDUCT.md +6 -0
  12. data/CONTRIBUTING.md +16 -1
  13. data/Gemfile +1 -2
  14. data/Gulpfile.js +42 -0
  15. data/{LICENSE → LICENSE.md} +8 -10
  16. data/README.md +138 -214
  17. data/RELEASING.md +27 -0
  18. data/Rakefile +3 -17
  19. data/bin/neat +2 -2
  20. data/contrib/base/_variables.scss +8 -0
  21. data/contrib/index.html +90 -0
  22. data/contrib/patterns/_box.scss +11 -0
  23. data/contrib/patterns/_global.scss +32 -0
  24. data/contrib/patterns/_grid-collapse.scss +3 -0
  25. data/contrib/patterns/_grid-media.scss +36 -0
  26. data/contrib/patterns/_grid-nested.scss +12 -0
  27. data/contrib/patterns/_grid-push.scss +7 -0
  28. data/contrib/patterns/_grid-shift.scss +7 -0
  29. data/contrib/patterns/_grid-visual.scss +3 -0
  30. data/contrib/patterns/_grid.scss +39 -0
  31. data/contrib/styles.scss +13 -0
  32. data/core/_neat.scss +26 -0
  33. data/core/neat/functions/_neat-append-grid-visual.scss +21 -0
  34. data/core/neat/functions/_neat-column-default.scss +23 -0
  35. data/core/neat/functions/_neat-column-ratio.scss +24 -0
  36. data/core/neat/functions/_neat-column-width.scss +25 -0
  37. data/core/neat/functions/_neat-float-direction.scss +22 -0
  38. data/core/neat/functions/_neat-merge-defaults.scss +23 -0
  39. data/core/neat/functions/_neat-opposite-direction.scss +22 -0
  40. data/core/neat/functions/_neat-parse-columns.scss +22 -0
  41. data/core/neat/functions/_neat-parse-media.scss +20 -0
  42. data/core/neat/functions/_retrieve-neat-settings.scss +19 -0
  43. data/core/neat/mixins/_grid-collapse.scss +35 -0
  44. data/core/neat/mixins/_grid-column.scss +39 -0
  45. data/core/neat/mixins/_grid-container.scss +31 -0
  46. data/core/neat/mixins/_grid-media.scss +88 -0
  47. data/core/neat/mixins/_grid-push.scss +37 -0
  48. data/core/neat/mixins/_grid-shift.scss +36 -0
  49. data/core/neat/mixins/_grid-visual.scss +41 -0
  50. data/core/neat/settings/_settings.scss +74 -0
  51. data/eyeglass-exports.js +7 -0
  52. data/index.js +7 -0
  53. data/lib/neat/generator.rb +43 -26
  54. data/lib/neat/version.rb +1 -1
  55. data/lib/neat.rb +6 -11
  56. data/neat.gemspec +26 -31
  57. data/package-lock.json +5960 -0
  58. data/package.json +47 -0
  59. data/spec/.keep +0 -0
  60. data/spec/fixtures/_setup.scss +1 -0
  61. data/spec/fixtures/functions/neat-column-default.scss +22 -0
  62. data/spec/fixtures/functions/neat-column-width.scss +30 -0
  63. data/spec/fixtures/functions/neat-float-direction.scss +17 -0
  64. data/spec/fixtures/functions/neat-opposite-direction.scss +17 -0
  65. data/spec/fixtures/functions/neat-parse-media.scss +9 -0
  66. data/spec/fixtures/functions/retrieve-neat-settings.scss +22 -0
  67. data/spec/fixtures/mixins/grid-collapse.scss +14 -0
  68. data/spec/fixtures/mixins/grid-column.scss +57 -0
  69. data/spec/fixtures/mixins/grid-container.scss +5 -0
  70. data/spec/fixtures/mixins/grid-media.scss +45 -0
  71. data/spec/fixtures/mixins/grid-push.scss +38 -0
  72. data/spec/fixtures/mixins/grid-shift.scss +38 -0
  73. data/spec/neat/functions/neat_column_default_spec.rb +35 -0
  74. data/spec/neat/functions/neat_column_width_spec.rb +47 -0
  75. data/spec/neat/functions/neat_float_direction_spec.rb +23 -0
  76. data/spec/neat/functions/neat_opposite_direction_spec.rb +23 -0
  77. data/spec/neat/functions/neat_parse_media_spec.rb +23 -0
  78. data/spec/neat/functions/retrieve_neat_settings_spec.rb +35 -0
  79. data/spec/neat/mixins/grid_collapse_spec.rb +26 -0
  80. data/spec/neat/mixins/grid_column_spec.rb +101 -0
  81. data/spec/neat/mixins/grid_container_spec.rb +17 -0
  82. data/spec/neat/mixins/grid_media_spec.rb +39 -0
  83. data/spec/neat/mixins/grid_push_spec.rb +59 -0
  84. data/spec/neat/mixins/grid_shift_spec.rb +59 -0
  85. data/spec/spec_helper.rb +5 -8
  86. data/spec/support/matchers/be_contained_in.rb +1 -1
  87. data/spec/support/matchers/have_rule.rb +8 -6
  88. data/spec/support/matchers/have_ruleset.rb +20 -0
  89. data/spec/support/matchers/have_value.rb +9 -7
  90. data/spec/support/parser_support.rb +8 -1
  91. data/spec/support/sass_support.rb +3 -3
  92. metadata +98 -148
  93. data/.rspec +0 -2
  94. data/.travis.yml +0 -5
  95. data/NEWS.md +0 -47
  96. data/app/assets/stylesheets/_neat-helpers.scss +0 -8
  97. data/app/assets/stylesheets/_neat.scss +0 -23
  98. data/app/assets/stylesheets/functions/_new-breakpoint.scss +0 -49
  99. data/app/assets/stylesheets/functions/_private.scss +0 -108
  100. data/app/assets/stylesheets/grid/_box-sizing.scss +0 -11
  101. data/app/assets/stylesheets/grid/_direction-context.scss +0 -31
  102. data/app/assets/stylesheets/grid/_display-context.scss +0 -26
  103. data/app/assets/stylesheets/grid/_fill-parent.scss +0 -22
  104. data/app/assets/stylesheets/grid/_media.scss +0 -92
  105. data/app/assets/stylesheets/grid/_omega.scss +0 -91
  106. data/app/assets/stylesheets/grid/_outer-container.scss +0 -36
  107. data/app/assets/stylesheets/grid/_pad.scss +0 -23
  108. data/app/assets/stylesheets/grid/_private.scss +0 -35
  109. data/app/assets/stylesheets/grid/_row.scss +0 -53
  110. data/app/assets/stylesheets/grid/_shift.scss +0 -48
  111. data/app/assets/stylesheets/grid/_span-columns.scss +0 -90
  112. data/app/assets/stylesheets/grid/_to-deprecate.scss +0 -105
  113. data/app/assets/stylesheets/grid/_visual-grid.scss +0 -40
  114. data/app/assets/stylesheets/settings/_disable-warnings.scss +0 -11
  115. data/app/assets/stylesheets/settings/_grid.scss +0 -53
  116. data/app/assets/stylesheets/settings/_visual-grid.scss +0 -25
  117. data/bower.json +0 -22
  118. data/lib/neat/engine.rb +0 -5
  119. data/lib/tasks/install.rake +0 -21
  120. data/sache.json +0 -5
  121. data/spec/neat/columns_spec.rb +0 -73
  122. data/spec/neat/container_spec.rb +0 -21
  123. data/spec/neat/default_spec.rb +0 -15
  124. data/spec/neat/direction_spec.rb +0 -19
  125. data/spec/neat/display_spec.rb +0 -19
  126. data/spec/neat/media_spec.rb +0 -55
  127. data/spec/neat/new_breakpoint_spec.rb +0 -17
  128. data/spec/neat/omega_spec.rb +0 -43
  129. data/spec/neat/pad_spec.rb +0 -32
  130. data/spec/neat/row_spec.rb +0 -39
  131. data/spec/neat/shift_spec.rb +0 -41
  132. data/spec/support/bourbon_support.rb +0 -9
  133. data/test/_setup.scss +0 -3
  134. data/test/default.scss +0 -1
  135. data/test/direction-context.scss +0 -13
  136. data/test/display-context.scss +0 -15
  137. data/test/media.scss +0 -39
  138. data/test/new-breakpoint.scss +0 -13
  139. data/test/omega.scss +0 -25
  140. data/test/outer-container.scss +0 -11
  141. data/test/pad.scss +0 -17
  142. data/test/row.scss +0 -26
  143. data/test/shift.scss +0 -36
  144. data/test/span-columns.scss +0 -21
@@ -0,0 +1,41 @@
1
+ @charset "UTF-8";
2
+ /// Creates a series of guide lines using the `background-image` property on a
3
+ /// grid container to visualise the columns and gutters of the grid.
4
+ ///
5
+ /// @group features
6
+ ///
7
+ /// @name Grid visual
8
+ ///
9
+ /// @argument {color} $color
10
+ /// The color of the guide lines created.
11
+ ///
12
+ /// @argument {map} $grid [$neat-grid]
13
+ /// The grid used to determine the guides
14
+ ///
15
+ /// @example scss
16
+ /// .element {
17
+ /// @include grid-visual;
18
+ /// }
19
+ ///
20
+ /// @example css
21
+ /// .element {
22
+ /// background-image: repeating-linear-gradient( … ) ;
23
+ /// }
24
+
25
+ @mixin grid-visual($color: null, $grid: $neat-grid) {
26
+ @if not $color {
27
+ $color: _retrieve-neat-setting($grid, color);
28
+ }
29
+
30
+ $_grid-columns: _retrieve-neat-setting($grid, columns);
31
+ $_grid-gutter: _retrieve-neat-setting($grid, gutter);
32
+ $_grid-visual-column: "#{_neat-column-width($grid, 1)} + #{$_grid-gutter}";
33
+ $_grid-visual:
34
+ transparent,
35
+ transparent $_grid-gutter,
36
+ $color $_grid-gutter,
37
+ $color calc(#{$_grid-visual-column}),
38
+ ;
39
+
40
+ background-image: repeating-linear-gradient(to right, $_grid-visual);
41
+ }
@@ -0,0 +1,74 @@
1
+ @charset "UTF-8";
2
+ /// This variable is a sass map that overrides Neat's default grid settings.
3
+ /// Use this to define your project's grid properties including gutters and
4
+ /// total column count.
5
+ ///
6
+ /// @type map
7
+ ///
8
+ /// @group settings
9
+ ///
10
+ /// @name Neat grid
11
+ ///
12
+ /// @property {number (unitless)} columns [12]
13
+ /// Default number of the total grid columns.
14
+ ///
15
+ /// @property {number (with unit)} gutter [20px]
16
+ /// Default grid gutter width between columns.
17
+ ///
18
+ /// @example scss
19
+ /// $neat-grid: (
20
+ /// columns: 12,
21
+ /// gutter: 20px,
22
+ /// );
23
+
24
+ $neat-grid: () !default;
25
+
26
+ /// If you need multiple grids in a single project, you can do
27
+ /// this by defining a new map stored within a variable of your choosing. This
28
+ /// variable can then be passed directly in to any of Neat's mixins like
29
+ /// [`grid-column(12, $my-custom-grid)`](#grid-column).
30
+ ///
31
+ /// Custom grids are especially useful with [`grid-media`](#grid-media). By
32
+ /// defining a `media` attribute within your custom grid, you are able to easily
33
+ /// define gutter width and total column count as well the breakpoint at which
34
+ /// they should activate.
35
+ ///
36
+ /// @type map
37
+ ///
38
+ /// @group settings
39
+ ///
40
+ /// @name Custom grids
41
+ ///
42
+ /// @property {number (unitless)} columns [12]
43
+ /// Number of the total grid columns.
44
+ ///
45
+ /// @property {number (with unit)} gutter [20px]
46
+ /// Grid gutter width between columns.
47
+ ///
48
+ /// @property {number (with unit) | string | null} media [null]
49
+ /// The `@media` definition that is used by the [`grid-media`](#grid-media)
50
+ /// mixin to determine the media properties.
51
+ ///
52
+ /// @property {color} color [null]
53
+ /// The color used by [`grid-visual`](#grid-visual) to create the guides.
54
+ ///
55
+ /// @property {string} direction [ltr]
56
+ /// The float direction used throughout the grid.
57
+ ///
58
+ /// @example scss
59
+ /// $my-custom-grid: (
60
+ /// columns: 12,
61
+ /// gutter: 20px,
62
+ /// media: 1200px,
63
+ /// color: rgba(#00d4ff, 0.25),
64
+ /// direction: ltr,
65
+ /// );
66
+ ///
67
+ /// $other-custom-grid-for-print: (
68
+ /// columns: 14,
69
+ /// gutter: 1.5rem,
70
+ /// media: print,
71
+ /// );
72
+ ///
73
+
74
+ $neat-custom-grid: () !default;
@@ -0,0 +1,7 @@
1
+ var neat = require("./index");
2
+
3
+ module.exports = function(eyeglass, sass) {
4
+ return {
5
+ sassDir: neat.includePaths[0]
6
+ };
7
+ };
data/index.js ADDED
@@ -0,0 +1,7 @@
1
+ var path = require("path");
2
+
3
+ module.exports = {
4
+ includePaths: [
5
+ path.join(__dirname, "core")
6
+ ]
7
+ };
@@ -1,21 +1,24 @@
1
+ require "neat/version"
1
2
  require "fileutils"
3
+ require "thor"
2
4
 
3
5
  module Neat
4
- class Generator
5
- def initialize(arguments)
6
- @subcommand = arguments.first
7
- end
6
+ class Generator < Thor
7
+ map ["-v", "--version"] => :version
8
8
 
9
- def run
10
- if @subcommand == "install"
11
- install
12
- elsif @subcommand == "update"
13
- update
14
- elsif @subcommand == "remove"
15
- remove
9
+ desc "install", "Install Neat into your project"
10
+ method_options path: :string, force: :boolean
11
+ def install
12
+ if neat_files_already_exist? && !options[:force]
13
+ puts "Neat files already installed, doing nothing."
14
+ else
15
+ install_files
16
+ puts "Neat files installed to #{install_path}/"
16
17
  end
17
18
  end
18
19
 
20
+ desc "update", "Update Neat"
21
+ method_options path: :string
19
22
  def update
20
23
  if neat_files_already_exist?
21
24
  remove_neat_directory
@@ -26,15 +29,8 @@ module Neat
26
29
  end
27
30
  end
28
31
 
29
- def install
30
- if neat_files_already_exist?
31
- puts "Neat files already installed, doing nothing."
32
- else
33
- install_files
34
- puts "Neat files installed to neat/"
35
- end
36
- end
37
-
32
+ desc "remove", "Remove Neat"
33
+ method_options path: :string
38
34
  def remove
39
35
  if neat_files_already_exist?
40
36
  remove_neat_directory
@@ -44,19 +40,40 @@ module Neat
44
40
  end
45
41
  end
46
42
 
43
+ desc "version", "Show Neat version"
44
+ def version
45
+ say "Neat #{Neat::VERSION}"
46
+ end
47
+
47
48
  private
48
49
 
49
50
  def neat_files_already_exist?
50
- File.directory?("neat")
51
+ install_path.exist?
51
52
  end
52
53
 
53
- def install_files
54
- FileUtils.mkdir_p("neat")
55
- FileUtils.cp_r(all_stylesheets, "neat/")
54
+ def install_path
55
+ @install_path ||= if options[:path]
56
+ Pathname.new(File.join(options[:path], "neat"))
57
+ else
58
+ Pathname.new("neat")
59
+ end
56
60
  end
57
61
 
58
62
  def remove_neat_directory
59
- FileUtils.rm_rf("neat")
63
+ FileUtils.rm_rf(install_path)
64
+ end
65
+
66
+ def install_files
67
+ make_install_directory
68
+ copy_in_scss_files
69
+ end
70
+
71
+ def make_install_directory
72
+ FileUtils.mkdir_p(install_path)
73
+ end
74
+
75
+ def copy_in_scss_files
76
+ FileUtils.cp_r(all_stylesheets, install_path)
60
77
  end
61
78
 
62
79
  def all_stylesheets
@@ -64,7 +81,7 @@ module Neat
64
81
  end
65
82
 
66
83
  def stylesheets_directory
67
- File.join(top_level_directory, "app", "assets", "stylesheets")
84
+ File.join(top_level_directory, "core")
68
85
  end
69
86
 
70
87
  def top_level_directory
data/lib/neat/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Neat
2
- VERSION = '1.7.0'
2
+ VERSION = "4.0.0"
3
3
  end
data/lib/neat.rb CHANGED
@@ -1,20 +1,15 @@
1
- require "bourbon"
2
1
  require "neat/generator"
3
2
 
4
3
  module Neat
5
4
  if defined?(Rails) && defined?(Rails::Engine)
6
5
  class Engine < ::Rails::Engine
7
- require 'neat/engine'
8
- end
9
-
10
- module Rails
11
- class Railtie < ::Rails::Railtie
12
- rake_tasks do
13
- load "tasks/install.rake"
14
- end
15
- end
6
+ config.assets.paths << File.expand_path("../core", __dir__)
16
7
  end
17
8
  else
18
- Sass.load_paths << File.expand_path("../../app/assets/stylesheets", __FILE__)
9
+ begin
10
+ require "sass"
11
+ Sass.load_paths << File.expand_path("../core", __dir__)
12
+ rescue LoadError
13
+ end
19
14
  end
20
15
  end
data/neat.gemspec CHANGED
@@ -1,35 +1,30 @@
1
- # -*- encoding: utf-8 -*-
2
- $:.push File.expand_path('../lib', __FILE__)
3
- require 'neat/version'
1
+ $:.push File.expand_path("../lib", __FILE__)
2
+ require "neat/version"
4
3
 
5
4
  Gem::Specification.new do |s|
6
- s.name = 'neat'
7
- s.version = Neat::VERSION
8
- s.platform = Gem::Platform::RUBY
9
- s.authors = ['Kyle Fiedler', 'Reda Lemeden', 'Joel Oliveira']
10
- s.email = ['support@thoughtbot.com']
11
- s.homepage = 'https://github.com/thoughtbot/neat'
12
- s.summary = 'A fluid grid framework on top of Bourbon'
13
- s.license = 'MIT'
14
- s.description = <<-DESC
15
- Neat is an open source grid framework built on top of Bourbon with the aim of being easy enough to use out of the box and flexible enough to customize down the road.
16
- DESC
17
-
18
- s.rubyforge_project = 'neat'
19
-
20
- s.files = `git ls-files`.split("\n")
21
- s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
5
+ s.add_development_dependency "aruba", "~> 0.5.0"
6
+ s.add_development_dependency "css_parser"
7
+ s.add_development_dependency "rake"
8
+ s.add_development_dependency "rspec"
9
+ s.add_development_dependency "scss_lint", "~> 0.44"
10
+ s.add_runtime_dependency "thor", "~> 0.19"
11
+ s.authors = [
12
+ "Joel Oliveira",
13
+ "Joshua Ogle",
14
+ "Kyle Fiedler",
15
+ "Reda Lemeden",
16
+ "Tyson Gach",
17
+ "Ward Penney",
18
+ "Will McMahan"
19
+ ]
20
+ s.email = "design+neat@thoughtbot.com"
22
21
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
23
- s.require_paths = ['lib']
24
-
25
- s.add_dependency('sass', '>= 3.3')
26
- s.add_dependency('bourbon', '>= 4.0')
27
-
28
- s.add_development_dependency('aruba', '~> 0.5.0')
29
- s.add_development_dependency('rake')
30
- s.add_development_dependency('css_parser')
31
- s.add_development_dependency('rspec')
32
- s.add_development_dependency('rdoc')
33
- s.add_development_dependency('bundler')
34
- s.add_development_dependency('rb-fsevent', '~> 0.9.1')
22
+ s.files = `git ls-files`.split("\n")
23
+ s.homepage = "http://neat.bourbon.io"
24
+ s.license = "MIT"
25
+ s.name = "neat"
26
+ s.platform = Gem::Platform::RUBY
27
+ s.require_paths = ["lib"]
28
+ s.summary = "A lightweight Sass grid framework"
29
+ s.version = Neat::VERSION
35
30
  end