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.
- checksums.yaml +5 -5
- data/.circleci/config.yml +34 -0
- data/.github/ISSUE_TEMPLATE.md +22 -0
- data/.github/PULL_REQUEST_TEMPLATE.md +8 -0
- data/.gitignore +4 -2
- data/.hound.yml +5 -0
- data/.npmignore +20 -0
- data/.scss-lint.yml +239 -0
- data/.tool-versions +2 -0
- data/CHANGELOG.md +388 -0
- data/CODE_OF_CONDUCT.md +6 -0
- data/CONTRIBUTING.md +16 -1
- data/Gemfile +1 -2
- data/Gulpfile.js +42 -0
- data/{LICENSE → LICENSE.md} +8 -10
- data/README.md +138 -214
- data/RELEASING.md +27 -0
- data/Rakefile +3 -17
- data/bin/neat +2 -2
- data/contrib/base/_variables.scss +8 -0
- data/contrib/index.html +90 -0
- data/contrib/patterns/_box.scss +11 -0
- data/contrib/patterns/_global.scss +32 -0
- data/contrib/patterns/_grid-collapse.scss +3 -0
- data/contrib/patterns/_grid-media.scss +36 -0
- data/contrib/patterns/_grid-nested.scss +12 -0
- data/contrib/patterns/_grid-push.scss +7 -0
- data/contrib/patterns/_grid-shift.scss +7 -0
- data/contrib/patterns/_grid-visual.scss +3 -0
- data/contrib/patterns/_grid.scss +39 -0
- data/contrib/styles.scss +13 -0
- data/core/_neat.scss +26 -0
- data/core/neat/functions/_neat-append-grid-visual.scss +21 -0
- data/core/neat/functions/_neat-column-default.scss +23 -0
- data/core/neat/functions/_neat-column-ratio.scss +24 -0
- data/core/neat/functions/_neat-column-width.scss +25 -0
- data/core/neat/functions/_neat-float-direction.scss +22 -0
- data/core/neat/functions/_neat-merge-defaults.scss +23 -0
- data/core/neat/functions/_neat-opposite-direction.scss +22 -0
- data/core/neat/functions/_neat-parse-columns.scss +22 -0
- data/core/neat/functions/_neat-parse-media.scss +20 -0
- data/core/neat/functions/_retrieve-neat-settings.scss +19 -0
- data/core/neat/mixins/_grid-collapse.scss +35 -0
- data/core/neat/mixins/_grid-column.scss +39 -0
- data/core/neat/mixins/_grid-container.scss +31 -0
- data/core/neat/mixins/_grid-media.scss +88 -0
- data/core/neat/mixins/_grid-push.scss +37 -0
- data/core/neat/mixins/_grid-shift.scss +36 -0
- data/core/neat/mixins/_grid-visual.scss +41 -0
- data/core/neat/settings/_settings.scss +74 -0
- data/eyeglass-exports.js +7 -0
- data/index.js +7 -0
- data/lib/neat/generator.rb +43 -26
- data/lib/neat/version.rb +1 -1
- data/lib/neat.rb +6 -11
- data/neat.gemspec +26 -31
- data/package-lock.json +5960 -0
- data/package.json +47 -0
- data/spec/.keep +0 -0
- data/spec/fixtures/_setup.scss +1 -0
- data/spec/fixtures/functions/neat-column-default.scss +22 -0
- data/spec/fixtures/functions/neat-column-width.scss +30 -0
- data/spec/fixtures/functions/neat-float-direction.scss +17 -0
- data/spec/fixtures/functions/neat-opposite-direction.scss +17 -0
- data/spec/fixtures/functions/neat-parse-media.scss +9 -0
- data/spec/fixtures/functions/retrieve-neat-settings.scss +22 -0
- data/spec/fixtures/mixins/grid-collapse.scss +14 -0
- data/spec/fixtures/mixins/grid-column.scss +57 -0
- data/spec/fixtures/mixins/grid-container.scss +5 -0
- data/spec/fixtures/mixins/grid-media.scss +45 -0
- data/spec/fixtures/mixins/grid-push.scss +38 -0
- data/spec/fixtures/mixins/grid-shift.scss +38 -0
- data/spec/neat/functions/neat_column_default_spec.rb +35 -0
- data/spec/neat/functions/neat_column_width_spec.rb +47 -0
- data/spec/neat/functions/neat_float_direction_spec.rb +23 -0
- data/spec/neat/functions/neat_opposite_direction_spec.rb +23 -0
- data/spec/neat/functions/neat_parse_media_spec.rb +23 -0
- data/spec/neat/functions/retrieve_neat_settings_spec.rb +35 -0
- data/spec/neat/mixins/grid_collapse_spec.rb +26 -0
- data/spec/neat/mixins/grid_column_spec.rb +101 -0
- data/spec/neat/mixins/grid_container_spec.rb +17 -0
- data/spec/neat/mixins/grid_media_spec.rb +39 -0
- data/spec/neat/mixins/grid_push_spec.rb +59 -0
- data/spec/neat/mixins/grid_shift_spec.rb +59 -0
- data/spec/spec_helper.rb +5 -8
- data/spec/support/matchers/be_contained_in.rb +1 -1
- data/spec/support/matchers/have_rule.rb +8 -6
- data/spec/support/matchers/have_ruleset.rb +20 -0
- data/spec/support/matchers/have_value.rb +9 -7
- data/spec/support/parser_support.rb +8 -1
- data/spec/support/sass_support.rb +3 -3
- metadata +98 -148
- data/.rspec +0 -2
- data/.travis.yml +0 -5
- data/NEWS.md +0 -47
- data/app/assets/stylesheets/_neat-helpers.scss +0 -8
- data/app/assets/stylesheets/_neat.scss +0 -23
- data/app/assets/stylesheets/functions/_new-breakpoint.scss +0 -49
- data/app/assets/stylesheets/functions/_private.scss +0 -108
- data/app/assets/stylesheets/grid/_box-sizing.scss +0 -11
- data/app/assets/stylesheets/grid/_direction-context.scss +0 -31
- data/app/assets/stylesheets/grid/_display-context.scss +0 -26
- data/app/assets/stylesheets/grid/_fill-parent.scss +0 -22
- data/app/assets/stylesheets/grid/_media.scss +0 -92
- data/app/assets/stylesheets/grid/_omega.scss +0 -91
- data/app/assets/stylesheets/grid/_outer-container.scss +0 -36
- data/app/assets/stylesheets/grid/_pad.scss +0 -23
- data/app/assets/stylesheets/grid/_private.scss +0 -35
- data/app/assets/stylesheets/grid/_row.scss +0 -53
- data/app/assets/stylesheets/grid/_shift.scss +0 -48
- data/app/assets/stylesheets/grid/_span-columns.scss +0 -90
- data/app/assets/stylesheets/grid/_to-deprecate.scss +0 -105
- data/app/assets/stylesheets/grid/_visual-grid.scss +0 -40
- data/app/assets/stylesheets/settings/_disable-warnings.scss +0 -11
- data/app/assets/stylesheets/settings/_grid.scss +0 -53
- data/app/assets/stylesheets/settings/_visual-grid.scss +0 -25
- data/bower.json +0 -22
- data/lib/neat/engine.rb +0 -5
- data/lib/tasks/install.rake +0 -21
- data/sache.json +0 -5
- data/spec/neat/columns_spec.rb +0 -73
- data/spec/neat/container_spec.rb +0 -21
- data/spec/neat/default_spec.rb +0 -15
- data/spec/neat/direction_spec.rb +0 -19
- data/spec/neat/display_spec.rb +0 -19
- data/spec/neat/media_spec.rb +0 -55
- data/spec/neat/new_breakpoint_spec.rb +0 -17
- data/spec/neat/omega_spec.rb +0 -43
- data/spec/neat/pad_spec.rb +0 -32
- data/spec/neat/row_spec.rb +0 -39
- data/spec/neat/shift_spec.rb +0 -41
- data/spec/support/bourbon_support.rb +0 -9
- data/test/_setup.scss +0 -3
- data/test/default.scss +0 -1
- data/test/direction-context.scss +0 -13
- data/test/display-context.scss +0 -15
- data/test/media.scss +0 -39
- data/test/new-breakpoint.scss +0 -13
- data/test/omega.scss +0 -25
- data/test/outer-container.scss +0 -11
- data/test/pad.scss +0 -17
- data/test/row.scss +0 -26
- data/test/shift.scss +0 -36
- 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;
|
data/eyeglass-exports.js
ADDED
data/index.js
ADDED
data/lib/neat/generator.rb
CHANGED
@@ -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
|
-
|
6
|
-
@subcommand = arguments.first
|
7
|
-
end
|
6
|
+
class Generator < Thor
|
7
|
+
map ["-v", "--version"] => :version
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
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
|
-
|
30
|
-
|
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
|
-
|
51
|
+
install_path.exist?
|
51
52
|
end
|
52
53
|
|
53
|
-
def
|
54
|
-
|
55
|
-
|
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(
|
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, "
|
84
|
+
File.join(top_level_directory, "core")
|
68
85
|
end
|
69
86
|
|
70
87
|
def top_level_directory
|
data/lib/neat/version.rb
CHANGED
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
|
-
|
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
|
-
|
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
|
-
|
2
|
-
|
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.
|
7
|
-
s.
|
8
|
-
s.
|
9
|
-
s.
|
10
|
-
s.
|
11
|
-
s.
|
12
|
-
s.
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
s.
|
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.
|
24
|
-
|
25
|
-
s.
|
26
|
-
s.
|
27
|
-
|
28
|
-
s.
|
29
|
-
s.
|
30
|
-
s.
|
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
|