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
@@ -1,25 +0,0 @@
|
|
1
|
-
/// Displays the visual grid when set to true. The overlaid grid may be few pixels off depending on the browser's rendering engine and pixel rounding algorithm. Set with the `!global` flag.
|
2
|
-
///
|
3
|
-
/// @type Bool
|
4
|
-
|
5
|
-
$visual-grid: false !default;
|
6
|
-
|
7
|
-
/// Sets the visual grid color. Set with `!global` flag.
|
8
|
-
///
|
9
|
-
/// @type Color
|
10
|
-
|
11
|
-
$visual-grid-color: #EEE !default;
|
12
|
-
|
13
|
-
/// Sets the `z-index` property of the visual grid. Can be `back` (behind content) or `front` (in front of content). Set with `!global` flag.
|
14
|
-
///
|
15
|
-
/// @type String
|
16
|
-
|
17
|
-
$visual-grid-index: back !default;
|
18
|
-
|
19
|
-
/// Sets the opacity property of the visual grid. Set with `!global` flag.
|
20
|
-
///
|
21
|
-
/// @type Number (unitless)
|
22
|
-
|
23
|
-
$visual-grid-opacity: 0.4 !default;
|
24
|
-
|
25
|
-
$visual-grid-breakpoints: () !default;
|
data/bower.json
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"name": "neat",
|
3
|
-
"version": "1.7.0",
|
4
|
-
"homepage": "http://neat.bourbon.io/",
|
5
|
-
"main": "app/assets/stylesheets/_neat.scss",
|
6
|
-
"ignore": [
|
7
|
-
"bin",
|
8
|
-
"lib",
|
9
|
-
".gitignore",
|
10
|
-
"Gemfile",
|
11
|
-
"Gemfile.lock",
|
12
|
-
"Rakefile",
|
13
|
-
"neat.gemspec",
|
14
|
-
"CONTRIBUTING.md",
|
15
|
-
"NEWS.md",
|
16
|
-
"test",
|
17
|
-
"spec"
|
18
|
-
],
|
19
|
-
"dependencies": {
|
20
|
-
"bourbon": ">=4.0"
|
21
|
-
}
|
22
|
-
}
|
data/lib/neat/engine.rb
DELETED
data/lib/tasks/install.rake
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
require "fileutils"
|
2
|
-
require "find"
|
3
|
-
|
4
|
-
namespace :bourbon do
|
5
|
-
namespace :neat do
|
6
|
-
desc "Copy Neat's files to the Rails assets directory."
|
7
|
-
task :install, [:sass_path] do |t, args|
|
8
|
-
args.with_defaults(:sass_path => 'public/stylesheets/sass')
|
9
|
-
source_root = File.expand_path(File.join(File.dirname(__FILE__), '..', '..'))
|
10
|
-
FileUtils.mkdir_p("#{Rails.root}/#{args.sass_path}/neat")
|
11
|
-
FileUtils.cp_r("#{source_root}/app/assets/stylesheets/.", "#{Rails.root}/#{args.sass_path}/neat", { :preserve => true })
|
12
|
-
|
13
|
-
Find.find("#{Rails.root}/#{args.sass_path}/neat") do |path|
|
14
|
-
if path.end_with?(".css.scss")
|
15
|
-
path_without_css_extension = path.gsub(/\.css\.scss$/, ".scss")
|
16
|
-
FileUtils.mv(path, path_without_css_extension)
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
data/sache.json
DELETED
data/spec/neat/columns_spec.rb
DELETED
@@ -1,73 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe "@include span-columns()" do
|
4
|
-
before(:all) do
|
5
|
-
ParserSupport.parse_file("span-columns")
|
6
|
-
end
|
7
|
-
|
8
|
-
context "with argument (6) in a twelve-column grid" do
|
9
|
-
it "sets width in percentage" do
|
10
|
-
expect('.span-columns-default').to have_rule('width: 48.82117%')
|
11
|
-
end
|
12
|
-
|
13
|
-
it "sets gutter in percentage" do
|
14
|
-
expect('.span-columns-default').to have_rule('margin-right: 2.35765%')
|
15
|
-
end
|
16
|
-
|
17
|
-
it "sets display to block" do
|
18
|
-
expect('.span-columns-default').to have_rule('display: block')
|
19
|
-
end
|
20
|
-
|
21
|
-
it "sets float to left" do
|
22
|
-
expect('.span-columns-default').to have_rule('float: left')
|
23
|
-
end
|
24
|
-
|
25
|
-
it "removes gutter from last element" do
|
26
|
-
expect('.span-columns-default:last-child').to have_rule('margin-right: 0')
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
context "when nested" do
|
31
|
-
it "sets relative width in percentage" do
|
32
|
-
expect('.span-columns-default .span-columns-nested').to have_rule('width: 30.11389%')
|
33
|
-
end
|
34
|
-
|
35
|
-
it "sets relative gutter in percentage" do
|
36
|
-
expect('.span-columns-default .span-columns-nested').to have_rule('margin-right: 4.82916%')
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
context "with argument (table)" do
|
41
|
-
it "sets display to table-cell" do
|
42
|
-
expect('.span-columns-table').to have_rule('display: table-cell')
|
43
|
-
end
|
44
|
-
|
45
|
-
it "sets width evenly between elements" do
|
46
|
-
expect('.span-columns-table').to have_rule('width: 50%')
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
context "with argument (block-collapse)" do
|
51
|
-
it "appends gutter width to column width" do
|
52
|
-
expect('.span-columns-collapse').to have_rule('width: 51.17883%')
|
53
|
-
end
|
54
|
-
|
55
|
-
it "removes the next gutter" do
|
56
|
-
expect('.span-columns-collapse').to_not have_rule('margin-right: 2.35765%')
|
57
|
-
end
|
58
|
-
|
59
|
-
it "removes gutter percentage from the width of the last child" do
|
60
|
-
expect('.span-columns-collapse:last-child').to have_rule('width: 48.82117%')
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
|
-
context "with argument (no-display)" do
|
65
|
-
it "doesn't set display property" do
|
66
|
-
expect('.span-columns-no-display').to_not have_rule('display: block')
|
67
|
-
end
|
68
|
-
|
69
|
-
it "sets width in percentage based on a block layout" do
|
70
|
-
expect('.span-columns-no-display').to have_rule('width: 48.82117%')
|
71
|
-
end
|
72
|
-
end
|
73
|
-
end
|
data/spec/neat/container_spec.rb
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe "@include outer-container()" do
|
4
|
-
before(:all) do
|
5
|
-
ParserSupport.parse_file("outer-container")
|
6
|
-
end
|
7
|
-
|
8
|
-
it "adds clearfix" do
|
9
|
-
expect('.container-default:after').to have_rule('clear: both')
|
10
|
-
end
|
11
|
-
|
12
|
-
it "sets max-width" do
|
13
|
-
expect('.container-default').to have_rule('max-width: 960px')
|
14
|
-
end
|
15
|
-
|
16
|
-
context "with max-width argument: 100%" do
|
17
|
-
it "sets max-width to 100%" do
|
18
|
-
expect('.container-custom-width').to have_rule('max-width: 100%')
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
data/spec/neat/default_spec.rb
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe "By default" do
|
4
|
-
before(:all) do
|
5
|
-
ParserSupport.parse_file("default")
|
6
|
-
end
|
7
|
-
|
8
|
-
it "sets sizing on the html element to 'border-box'" do
|
9
|
-
expect('html').to have_rule('box-sizing: border-box')
|
10
|
-
end
|
11
|
-
|
12
|
-
it "sets sizing on the global selector to 'inherit'" do
|
13
|
-
expect('*:after').to have_rule('box-sizing: inherit')
|
14
|
-
end
|
15
|
-
end
|
data/spec/neat/direction_spec.rb
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe "@include direction-context() {...}" do
|
4
|
-
before(:all) do
|
5
|
-
ParserSupport.parse_file("direction-context")
|
6
|
-
end
|
7
|
-
|
8
|
-
context "with no argument" do
|
9
|
-
it "uses default direction setting" do
|
10
|
-
expect('.default-block').to have_rule('float: left')
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
context "whith argument (right-to-left)" do
|
15
|
-
it "changes direction setting inside the block" do
|
16
|
-
expect('.right-to-left-block').to have_rule('float: right')
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
data/spec/neat/display_spec.rb
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe "@include display-context() {...}" do
|
4
|
-
before(:all) do
|
5
|
-
ParserSupport.parse_file("display-context")
|
6
|
-
end
|
7
|
-
|
8
|
-
context "with argument (table)" do
|
9
|
-
it "changes display value to table" do
|
10
|
-
expect('.display-table-block').to have_rule('display: table-cell')
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
context "whith nested call and argument (block)" do
|
15
|
-
it "changes display value to block" do
|
16
|
-
expect('.display-nested-block').to have_rule('display: block')
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
data/spec/neat/media_spec.rb
DELETED
@@ -1,55 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe "@include media() {...}" do
|
4
|
-
before(:all) do
|
5
|
-
ParserSupport.parse_file("media")
|
6
|
-
end
|
7
|
-
|
8
|
-
context "with argument (481px)" do
|
9
|
-
it "outputs @media screen and (min-width: 481px)" do
|
10
|
-
expect('.media-default').to be_contained_in('screen and (min-width: 481px)')
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
context "with argument (max-width 480px)" do
|
15
|
-
it "outputs @media screen and (max-width: 480px)" do
|
16
|
-
expect('.media-max-width').to be_contained_in('screen and (max-width: 480px)')
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
context "with argument (min-width 320px max-width 480px)" do
|
21
|
-
it "outputs @media screen and (min-width: 320px) and (max-width: 480px)" do
|
22
|
-
expect('.media-min-max-width').to be_contained_in('screen and (min-width: 320px) and (max-width: 480px)')
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
context "with argument (481px, 6)" do
|
27
|
-
it "outputs @media screen and (min-width: 481px)" do
|
28
|
-
expect('.change-media-context').to be_contained_in('screen and (min-width: 481px)')
|
29
|
-
end
|
30
|
-
|
31
|
-
it "uses a 6-column grid" do
|
32
|
-
expect('.change-media-context').to have_rule('width: 100%')
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
context "with shorthand argument (max-width 480px 6)" do
|
37
|
-
it "outputs @media screen and (max-width: 480px)" do
|
38
|
-
expect('.change-media-context-shorthand').to be_contained_in('screen and (max-width: 480px)')
|
39
|
-
end
|
40
|
-
|
41
|
-
it "uses a 6-column grid" do
|
42
|
-
expect('.change-media-context-shorthand').to have_rule('width: 100%')
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
context "with composite argument (max-width 768px min-width 110px orientation portait 6)" do
|
47
|
-
it "outputs @media screen and (max-width: 768px) and (min-width: 110px) and (orientation: portait)" do
|
48
|
-
expect('.composite-media-query').to be_contained_in('screen and (max-width: 768px) and (min-width: 110px) and (orientation: portait)')
|
49
|
-
end
|
50
|
-
|
51
|
-
it "uses a 6-column grid" do
|
52
|
-
expect('.composite-media-query').to have_rule('width: 100%')
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe "new-breakpoint()" do
|
4
|
-
before(:all) do
|
5
|
-
ParserSupport.parse_file("new-breakpoint")
|
6
|
-
end
|
7
|
-
|
8
|
-
context "with argument (max-width 768px 12)" do
|
9
|
-
it "outputs (max-width 768px)" do
|
10
|
-
expect('.responsive-element').to be_contained_in('screen and (max-width: 768px)')
|
11
|
-
end
|
12
|
-
|
13
|
-
it "adds (max-width 768px 12) to visual grid breakpoints" do
|
14
|
-
expect('$visual-grid-breakpoints').to have_value('max-width 768px 12')
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
data/spec/neat/omega_spec.rb
DELETED
@@ -1,43 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe "@include omega()" do
|
4
|
-
before(:all) do
|
5
|
-
ParserSupport.parse_file("omega")
|
6
|
-
end
|
7
|
-
|
8
|
-
context "with no argument" do
|
9
|
-
it "removes right margin" do
|
10
|
-
expect('.omega-default').to have_rule('margin-right: 0')
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
context "with argument (4n)" do
|
15
|
-
it "removes right margin of nth-child(4n)" do
|
16
|
-
expect('.omega-nth-default:nth-child(4n)').to have_rule('margin-right: 0')
|
17
|
-
end
|
18
|
-
|
19
|
-
it "adds clear to nth-child(4n+1)" do
|
20
|
-
expect('.omega-nth-default:nth-child(4n+1)').to have_rule('clear: left')
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
context "with argument ('4n+1')" do
|
25
|
-
it "removes right margin of nth-child(4n+1)" do
|
26
|
-
expect('.omega-complex-nth:nth-child(4n+1)').to have_rule('margin-right: 0')
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
context "when called inside an RTL row" do
|
31
|
-
context "with no argument" do
|
32
|
-
it "removes left margin" do
|
33
|
-
expect('section .omega-default-left').to have_rule('margin-left: 0')
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
context "with argument (4n block)" do
|
38
|
-
it "removes left margin of nth-child(4n)" do
|
39
|
-
expect('section .omega-nth-default-left:nth-child(4n)').to have_rule('margin-left: 0')
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
data/spec/neat/pad_spec.rb
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe "@include pad()" do
|
4
|
-
before(:all) do
|
5
|
-
ParserSupport.parse_file("pad")
|
6
|
-
end
|
7
|
-
|
8
|
-
context "with no argument" do
|
9
|
-
it "sets padding to gutter percentage" do
|
10
|
-
expect('.pad-default').to have_rule('padding: 2.35765%')
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
context "with argument (20px)" do
|
15
|
-
it "sets padding to 20px" do
|
16
|
-
expect('.pad-explicit').to have_rule('padding: 20px')
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
context "with argument (30px 20px 10px 5px)" do
|
21
|
-
it "sets padding to 30px 20px 10px 5px" do
|
22
|
-
expect('.pad-shorthand').to have_rule('padding: 30px 20px 10px 5px')
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
context "with argument (default)" do
|
27
|
-
it "uses default gutter percentage" do
|
28
|
-
expect('.pad-shorthand-default').to have_rule('padding: 30px 2.35765% 10px 2.35765%')
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
data/spec/neat/row_spec.rb
DELETED
@@ -1,39 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe "@include row()" do
|
4
|
-
before(:all) do
|
5
|
-
ParserSupport.parse_file("row")
|
6
|
-
end
|
7
|
-
|
8
|
-
context "with no argument" do
|
9
|
-
it "adds clearfix" do
|
10
|
-
expect('.row-default:after').to have_rule('clear: both')
|
11
|
-
end
|
12
|
-
|
13
|
-
it "sets display to block" do
|
14
|
-
expect('.row-default').to have_rule('display: block')
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
context "with argument (table)" do
|
19
|
-
it "sets display to table" do
|
20
|
-
expect('.row-table').to have_rule('display: table')
|
21
|
-
end
|
22
|
-
|
23
|
-
it "forces table-cell display on child elements" do
|
24
|
-
expect('.row-table-reset .block-child').to have_rule('display: table-cell')
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
context "with reset-display()" do
|
29
|
-
it "resets display to block" do
|
30
|
-
expect('.no-row').to have_rule('display: block')
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
context "with invalid display argument" do
|
35
|
-
it "sets display to block" do
|
36
|
-
expect('.row-invalid-display').to have_rule('display: block')
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
data/spec/neat/shift_spec.rb
DELETED
@@ -1,41 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe "@include shift()" do
|
4
|
-
before(:all) do
|
5
|
-
ParserSupport.parse_file("shift")
|
6
|
-
end
|
7
|
-
|
8
|
-
context "with no argument" do
|
9
|
-
it "shifts element one column in the default direction" do
|
10
|
-
expect('.shift-default').to have_rule('margin-left: 8.5298%')
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
context "with argument (2)" do
|
15
|
-
it "shifts element 2 columns in the default direction" do
|
16
|
-
expect('.shift-positive').to have_rule('margin-left: 17.05961%')
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
context "with argument (-3)" do
|
21
|
-
it "shifts element 3 columns in the opposite direction" do
|
22
|
-
expect('.shift-negative').to have_rule('margin-left: -25.58941%')
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
context "when nested" do
|
27
|
-
it "shifts element relative to its parent" do
|
28
|
-
expect('.shifted-parent .shifted-child').to have_rule('margin-left: 34.94305%')
|
29
|
-
end
|
30
|
-
|
31
|
-
it "resets nesting context" do
|
32
|
-
expect('.post-nested-shift').to have_rule('margin-left: 17.05961%')
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
context "when layout direction changes" do
|
37
|
-
it "shifts element in the corresponding direction" do
|
38
|
-
expect('section .shift-negative').to have_rule('margin-right: -25.58941%')
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
data/test/_setup.scss
DELETED
data/test/default.scss
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
@import 'setup';
|
data/test/direction-context.scss
DELETED
data/test/display-context.scss
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
@import 'setup';
|
2
|
-
|
3
|
-
@include display-context(table) {
|
4
|
-
.display-table-block {
|
5
|
-
@include span-columns(6);
|
6
|
-
}
|
7
|
-
}
|
8
|
-
|
9
|
-
@include display-context(table) {
|
10
|
-
@include display-context(block) {
|
11
|
-
.display-nested-block {
|
12
|
-
@include span-columns(6);
|
13
|
-
}
|
14
|
-
}
|
15
|
-
}
|
data/test/media.scss
DELETED
@@ -1,39 +0,0 @@
|
|
1
|
-
@import 'setup';
|
2
|
-
|
3
|
-
$composite: new-breakpoint(max-width 768px min-width 110px orientation portait 6);
|
4
|
-
|
5
|
-
.media-default {
|
6
|
-
@include media(481px) {
|
7
|
-
color: #000;
|
8
|
-
}
|
9
|
-
}
|
10
|
-
|
11
|
-
.media-max-width {
|
12
|
-
@include media(max-width 480px) {
|
13
|
-
position: relative;
|
14
|
-
}
|
15
|
-
}
|
16
|
-
|
17
|
-
.media-min-max-width {
|
18
|
-
@include media(min-width 320px max-width 480px) {
|
19
|
-
position: relative;
|
20
|
-
}
|
21
|
-
}
|
22
|
-
|
23
|
-
.change-media-context {
|
24
|
-
@include media(481px, 6) {
|
25
|
-
@include span-columns(6);
|
26
|
-
}
|
27
|
-
}
|
28
|
-
|
29
|
-
.change-media-context-shorthand {
|
30
|
-
@include media(max-width 480px 6) {
|
31
|
-
@include span-columns(6);
|
32
|
-
}
|
33
|
-
}
|
34
|
-
|
35
|
-
.composite-media-query {
|
36
|
-
@include media($composite) {
|
37
|
-
@include span-columns(6);
|
38
|
-
}
|
39
|
-
}
|
data/test/new-breakpoint.scss
DELETED
data/test/omega.scss
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
@import 'setup';
|
2
|
-
|
3
|
-
.omega-default {
|
4
|
-
@include omega;
|
5
|
-
}
|
6
|
-
|
7
|
-
.omega-nth-default {
|
8
|
-
@include omega(4n)
|
9
|
-
}
|
10
|
-
|
11
|
-
.omega-complex-nth {
|
12
|
-
@include omega("4n+1");
|
13
|
-
}
|
14
|
-
|
15
|
-
section {
|
16
|
-
@include row($direction: RTL);
|
17
|
-
|
18
|
-
.omega-default-left {
|
19
|
-
@include omega;
|
20
|
-
}
|
21
|
-
|
22
|
-
.omega-nth-default-left {
|
23
|
-
@include omega(4n block);
|
24
|
-
}
|
25
|
-
}
|
data/test/outer-container.scss
DELETED
data/test/pad.scss
DELETED
data/test/row.scss
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
@import 'setup';
|
2
|
-
|
3
|
-
.row-default {
|
4
|
-
@include row;
|
5
|
-
}
|
6
|
-
|
7
|
-
.row-table {
|
8
|
-
@include row(table);
|
9
|
-
}
|
10
|
-
|
11
|
-
.row-invalid-display {
|
12
|
-
@include row(invalid-argument);
|
13
|
-
}
|
14
|
-
|
15
|
-
.row-table-reset {
|
16
|
-
@include row(table);
|
17
|
-
|
18
|
-
.block-child {
|
19
|
-
@include span-columns(4, block);
|
20
|
-
@include reset-display;
|
21
|
-
}
|
22
|
-
}
|
23
|
-
|
24
|
-
.no-row {
|
25
|
-
@include span-columns(4);
|
26
|
-
}
|