ad_particles 0.1.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 (47) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +25 -0
  3. data/.npmignore +11 -0
  4. data/.scss-lint.yml +243 -0
  5. data/Gemfile +3 -0
  6. data/README.md +7 -0
  7. data/Rakefile +15 -0
  8. data/ad_particles.gemspec +30 -0
  9. data/atomic/_particles.scss +3 -0
  10. data/atomic/particles/_mixins.scss +7 -0
  11. data/atomic/particles/_modifiers.scss +1 -0
  12. data/atomic/particles/_props.scss +7 -0
  13. data/atomic/particles/mixins/_box.scss +21 -0
  14. data/atomic/particles/mixins/_color.scss +9 -0
  15. data/atomic/particles/mixins/_form.scss +45 -0
  16. data/atomic/particles/mixins/_helper.scss +32 -0
  17. data/atomic/particles/mixins/_layout.scss +155 -0
  18. data/atomic/particles/mixins/_rwd.scss +29 -0
  19. data/atomic/particles/mixins/_type.scss +15 -0
  20. data/atomic/particles/modifiers/_rwd.scss +18 -0
  21. data/atomic/particles/modifiers/_string.scss +3 -0
  22. data/atomic/particles/props/_box.scss +6 -0
  23. data/atomic/particles/props/_color.scss +27 -0
  24. data/atomic/particles/props/_config.scss +4 -0
  25. data/atomic/particles/props/_icon.scss +1 -0
  26. data/atomic/particles/props/_image.scss +4 -0
  27. data/atomic/particles/props/_motion.scss +4 -0
  28. data/atomic/particles/props/_rwd.scss +3 -0
  29. data/atomic/particles/props/_type.scss +51 -0
  30. data/eyeglass-exports.js +7 -0
  31. data/index.js +7 -0
  32. data/lib/ad_particles.rb +8 -0
  33. data/lib/ad_particles/generator.rb +81 -0
  34. data/lib/ad_particles/version.rb +3 -0
  35. data/package.json +37 -0
  36. data/spec/fixtures/_setup.scss +1 -0
  37. data/spec/fixtures/mixins/box.scss +33 -0
  38. data/spec/fixtures/mixins/color.scss +6 -0
  39. data/spec/particles/mixins/box_spec.rb +61 -0
  40. data/spec/particles/mixins/color_spec.rb +20 -0
  41. data/spec/spec_helper.rb +24 -0
  42. data/spec/support/matchers/have_rule.rb +38 -0
  43. data/spec/support/matchers/have_ruleset.rb +23 -0
  44. data/spec/support/matchers/have_value.rb +20 -0
  45. data/spec/support/parser_support.rb +16 -0
  46. data/spec/support/sass_support.rb +12 -0
  47. metadata +201 -0
@@ -0,0 +1,32 @@
1
+ @import "../props/color";
2
+ @import "../props/box";
3
+
4
+ @mixin helper-divide_children() {
5
+
6
+ > *:after {
7
+ content: "|";
8
+ margin: 0 $box-spacing;
9
+ }
10
+
11
+ > *:last-child:after {
12
+ content: none;
13
+ }
14
+
15
+ }
16
+
17
+ @mixin helper-colorize_button($bkgcolor : $color-brand--primary, $textcolor : $color-white) {
18
+ background-color: $bkgcolor;
19
+ color: $textcolor;
20
+
21
+ &:hover {
22
+ background-color: lighten($bkgcolor, 10%);
23
+ }
24
+
25
+ }
26
+
27
+ @mixin helper-container_fluid() {
28
+ margin-right: auto;
29
+ margin-left: auto;
30
+ padding-left: $box-spacing--wide;
31
+ padding-right: $box-spacing--wide;
32
+ }
@@ -0,0 +1,155 @@
1
+ @mixin layout-flex-flexbox($fallback: false) {
2
+
3
+ display: -webkit-box;
4
+ display: -webkit-flex;
5
+ display: -moz-flex;
6
+ display: -ms-flexbox;
7
+ display: flex;
8
+
9
+ }
10
+
11
+ @mixin layout-flex-direction($value: row, $fallback: false) {
12
+
13
+ @if $value == row-reverse {
14
+ -webkit-box-direction: reverse;
15
+ -webkit-box-orient: horizontal;
16
+ } @else if $value == column {
17
+ -webkit-box-direction: normal;
18
+ -webkit-box-orient: vertical;
19
+ } @else if $value == column-reverse {
20
+ -webkit-box-direction: reverse;
21
+ -webkit-box-orient: vertical;
22
+ } @else {
23
+ -webkit-box-direction: normal;
24
+ -webkit-box-orient: horizontal;
25
+ }
26
+ -webkit-flex-direction: $value;
27
+ -moz-flex-direction: $value;
28
+ -ms-flex-direction: $value;
29
+ flex-direction: $value;
30
+
31
+ }
32
+
33
+ @mixin layout-flex-wrap($value: nowrap) {
34
+
35
+ -webkit-flex-wrap: $value;
36
+ -moz-flex-wrap: $value;
37
+ @if $value == nowrap {
38
+ -ms-flex-wrap: none;
39
+ } @else {
40
+ -ms-flex-wrap: $value;
41
+ }
42
+ flex-wrap: $value;
43
+
44
+ }
45
+
46
+ @mixin layout-flex-flow($values: (row nowrap)) {
47
+
48
+ -webkit-flex-flow: $values;
49
+ -moz-flex-flow: $values;
50
+ -ms-flex-flow: $values;
51
+ flex-flow: $values;
52
+
53
+ }
54
+
55
+ @mixin layout-flex-order($int: 0) {
56
+
57
+ -webkit-box-ordinal-group: $int + 1;
58
+ -webkit-order: $int;
59
+ -moz-order: $int;
60
+ -ms-flex-order: $int;
61
+ order: $int;
62
+
63
+ }
64
+
65
+ @mixin layout-flex-grow($int: 0) {
66
+
67
+ -webkit-box-flex: $int;
68
+ -webkit-flex-grow: $int;
69
+ -moz-flex-grow: $int;
70
+ -ms-flex-positive: $int;
71
+ flex-grow: $int;
72
+
73
+ }
74
+
75
+ @mixin layout-flex-shrink($int: 1) {
76
+
77
+ -webkit-flex-shrink: $int;
78
+ -moz-flex-shrink: $int;
79
+ -ms-flex-negative: $int;
80
+ flex-shrink: $int;
81
+
82
+ }
83
+
84
+ @mixin layout-flex-basis($value: auto) {
85
+
86
+ -webkit-flex-basis: $value;
87
+ -moz-flex-basis: $value;
88
+ -ms-flex-preferred-size: $value;
89
+ flex-basis: $value;
90
+
91
+ }
92
+
93
+ @mixin layout-flex($flex-grow: 1, $flex-shrink: null, $flex-basis: null) {
94
+
95
+ $boxflex: $flex-grow;
96
+
97
+ @if type-of($flex-grow) == "list" {
98
+ $boxflex: nth($flex-grow, 1);
99
+ }
100
+
101
+ -webkit-box-flex: $boxflex;
102
+ -webkit-flex: $flex-grow $flex-shrink $flex-basis;
103
+ -moz-box-flex: $boxflex;
104
+ -moz-flex: $flex-grow $flex-shrink $flex-basis;
105
+ -ms-flex: $flex-grow $flex-shrink $flex-basis;
106
+ flex: $flex-grow $flex-shrink $flex-basis;
107
+ }
108
+
109
+ @mixin layout-flex-align_items($value: stretch) {
110
+
111
+ @if $value == flex-start {
112
+ -webkit-box-align: start;
113
+ -ms-flex-align: start;
114
+ } @else if $value == flex-end {
115
+ -webkit-box-align: end;
116
+ -ms-flex-align: end;
117
+ } @else {
118
+ -webkit-box-align: $value;
119
+ -ms-flex-align: $value;
120
+ }
121
+ -webkit-align-items: $value;
122
+ -moz-align-items: $value;
123
+ align-items: $value;
124
+
125
+ }
126
+
127
+ @mixin layout-flex-align-self($value: auto) {
128
+
129
+ -webkit-align-self: $value;
130
+ -moz-align-self: $value;
131
+ @if $value == flex-start {
132
+ -ms-flex-item-align: start;
133
+ } @else if $value == flex-end {
134
+ -ms-flex-item-align: end;
135
+ } @else {
136
+ -ms-flex-item-align: $value;
137
+ }
138
+ align-self: $value;
139
+
140
+ }
141
+
142
+ @mixin layout-flex-align-content($value: stretch) {
143
+
144
+ -webkit-align-content: $value;
145
+ -moz-align-content: $value;
146
+ @if $value == flex-start {
147
+ -ms-flex-line-pack: start;
148
+ } @else if $value == flex-end {
149
+ -ms-flex-line-pack: end;
150
+ } @else {
151
+ -ms-flex-line-pack: $value;
152
+ }
153
+ align-content: $value;
154
+
155
+ }
@@ -0,0 +1,29 @@
1
+ @import "../props/rwd";
2
+ @import "../modifiers/rwd";
3
+
4
+ @mixin rwd-scope--phone() {
5
+ $condition: query($max: $rwd-breakpoint--phone);
6
+
7
+ @media #{$condition} {
8
+ @content;
9
+ }
10
+
11
+ }
12
+
13
+ @mixin rwd-scope--tablet() {
14
+ $condition: query($rwd-breakpoint--tablet);
15
+
16
+ @media #{$condition} {
17
+ @content;
18
+ }
19
+
20
+ }
21
+
22
+ @mixin desktop() {
23
+ $condition: query($rwd-breakpoint--desktop);
24
+
25
+ @media#{$condition} {
26
+ @content;
27
+ }
28
+
29
+ }
@@ -0,0 +1,15 @@
1
+ @import "../props/config";
2
+ @import "../props/type";
3
+ @import "../modifiers/string";
4
+
5
+ @mixin type-baseline($fontfam: $fontface-copy--regular) {
6
+ font: normal $type-weight #{$type-size--baseline}/#{$type-leading} #{$fontfam};
7
+ };
8
+
9
+ @mixin type-src($font: $fontface-copy) {
10
+ $font_url: "#{$config-path--fonts}#{capitalize($font)}/#{$font}-webfont.";
11
+ src: url("#{$font-url}eot");
12
+ src: url("#{$font-url}eot#iefix") format("embedded-opentype"),
13
+ url("#{$font-url}woff2") format("woff2"),
14
+ url("#{$font-url}woff") format("woff");
15
+ };
@@ -0,0 +1,18 @@
1
+
2
+ @function query($min: false, $max: false) {
3
+ $condition: "only screen and ";
4
+
5
+ @if $min {
6
+ $condition: $condition + "(min-width: #{$min})";// % $min;
7
+ }
8
+ @if $min {
9
+ @if $max {
10
+ $condition: $condition + " and ";
11
+ }
12
+ }
13
+ @if $max {
14
+ $condition: $condition + "(max-width: " + ($max - 1) + ")";// % ($max - 1);
15
+ }
16
+
17
+ @return $condition;
18
+ }
@@ -0,0 +1,3 @@
1
+ @function capitalize($string) {
2
+ @return to-upper-case(str-slice($string, 1, 1)) + str-slice($string, 2);
3
+ };
@@ -0,0 +1,6 @@
1
+ $box-border_radius: 3px;
2
+ $box-spacing--thinner: 2px;
3
+ $box-spacing--thin: 5px;
4
+ $box-spacing: 10px;
5
+ $box-spacing--wide: 15px;
6
+ $box-spacing--wider: 20px;
@@ -0,0 +1,27 @@
1
+ @charset "UTF-8";
2
+
3
+ $color-black--alpha: rgba(0, 0, 0, 0);
4
+ $color-black: rgba(0, 0, 0, 1);
5
+ $color-gray--alpha_dark: rgba(184, 184, 184, 0);
6
+ $color-gray--darker: lighten($color-black, 13.5%);
7
+ $color-gray--dark: lighten($color-black, 20%);
8
+ $color-gray: lighten($color-black, 33.5%);
9
+ $color-gray--light: lighten($color-black, 60%);
10
+ $color-gray--lighter: lighten($color-black, 93.5%);
11
+ $color-gray--alpha_light: rgba(204, 204, 204, 0.65);
12
+ $color-white: rgba(255, 255, 255, 1);
13
+ $color-white--alpha: rgba(255, 255, 255, 0);
14
+
15
+ $color-shadow: #818181;
16
+
17
+ $color-brand--primary: #007fb2;
18
+ $color-brand--secondary: #e6b319;
19
+ $color-brand--accent: #c9eefd;
20
+ $color-brand--primary_dark: #274982;
21
+
22
+ $color-action--success: #60ab2a;
23
+ $color-action--info: #5bc0de;
24
+ $color-action--warning: #f0ad4e;
25
+ $color-action--danger: #ffdede;
26
+
27
+ $color-table_text: $color-gray;
@@ -0,0 +1,4 @@
1
+ $config-path: "/";
2
+ $config-path--asset_prefix: "..";
3
+ $config-path--images: "/images/";
4
+ $config-path--fonts: "https://cdnjs.cloudflare.com/ajax/libs/ink/3.1.10/fonts/";
@@ -0,0 +1 @@
1
+ $icon-input--checkbox: '"\2713"';
@@ -0,0 +1,4 @@
1
+ @import "config";
2
+
3
+ $image-car--small: "#{config-path--asset_prefix}#{$config-path--images}images/pages/car.png";
4
+ $image-carfox--large: "#{config-path--asset_prefix}#{$config-path--images}images/pages/large-fox.png";
@@ -0,0 +1,4 @@
1
+ $motion-duration: 1s;
2
+ $motion-fill_mode: both;
3
+ $motion-backface_visibility: visible;
4
+ $motion-timing_function: ease-in;
@@ -0,0 +1,3 @@
1
+ $rwd-breakpoint--phone: 326px;
2
+ $rwd-breakpoint--tablet: 768px;
3
+ $rwd-breakpoint--desktop: 1200px;
@@ -0,0 +1,51 @@
1
+ $type-size--baseline: 14px;
2
+
3
+ $type-size--h1: 2.143rem;
4
+ $type-size--h2: 1.714rem;
5
+ $type-size--h3: 1.143rem;
6
+ $type-size--h4: 1rem;
7
+ $type-size--h5: 0.857rem;
8
+ $type-size--h6: 0.714rem;
9
+
10
+ $type-size--table: 0.786rem;
11
+
12
+ $type-weight--light: 300;
13
+ $type-weight: 500;
14
+ $type-weight--heavy: 700;
15
+
16
+ $type-font_style: italic;
17
+
18
+ $type-button_text_transform: uppercase;
19
+
20
+ $type-leading: 1;
21
+ $type-kerning: normal;
22
+
23
+ $fontface-copy: "roboto";
24
+ $fontface-copy--thin: "#{$fontface-copy}-thin";
25
+ $fontface-copy--regular: "#{$fontface-copy}-regular";
26
+ $fontface-copy--light: "#{$fontface-copy}-light";
27
+ $fontface-copy--medium: "#{$fontface-copy}-medium";
28
+ $fontface-copy--bold: "#{$fontface-copy}-bold";
29
+ $fontface-copy--black: "#{$fontface-copy}-black";
30
+
31
+ $fontface-copy--thin_italic: "#{$fontface-copy--thin}italic";
32
+ $fontface-copy--light_italic: "#{$fontface-copy--light}italic";
33
+ $fontface-copy--medium_italic: "#{$fontface-copy--medium}italic";
34
+ $fontface-copy--regular_italic: "#{$fontface-copy--regular}italic";
35
+ $fontface-copy--bold_italic: "#{$fontface-copy--bold}italic";
36
+ $fontface-copy--black_italic: "#{$fontface-copy--black}italic";
37
+
38
+ $font_faces: (
39
+ $fontface-copy--thin,
40
+ $fontface-copy--light,
41
+ $fontface-copy--regular,
42
+ $fontface-copy--medium,
43
+ $fontface-copy--bold,
44
+ $fontface-copy--black,
45
+ $fontface-copy--thin_italic,
46
+ $fontface-copy--light_italic,
47
+ $fontface-copy--regular_italic,
48
+ $fontface-copy--medium_italic,
49
+ $fontface-copy--bold_italic,
50
+ $fontface-copy--black_italic
51
+ );
@@ -0,0 +1,7 @@
1
+ var atomicDesignParticles = require("./index");
2
+
3
+ module.exports = function(eyeglass, sass) {
4
+ return {
5
+ sassDir: atomicDesignParticles.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, "atomic")
6
+ ]
7
+ };
@@ -0,0 +1,8 @@
1
+ require "ad_particles/generator"
2
+
3
+ atomic_path = File.expand_path("../../atomic", __FILE__)
4
+
5
+ ENV["SASS_PATH"] = [
6
+ ENV["SASS_PATH"],
7
+ atomic_path,
8
+ ].compact.join(File::PATH_SEPARATOR)
@@ -0,0 +1,81 @@
1
+ require "ad_particles/version"
2
+ require "fileutils"
3
+ require "thor"
4
+ require "pathname"
5
+
6
+ module AtomicDesignParticles
7
+ class Generator < Thor
8
+ map ["-v", "--version"] => :version
9
+
10
+ desc "install", "Install Atomic Particles into your project"
11
+ method_options :path => :string, :force => :boolean
12
+ def install
13
+ if atomic_files_already_exist? && !options[:force]
14
+ puts "Atomic Particles files are already installed. You are good to go!"
15
+ else
16
+ install_files
17
+ puts "Atomic Particles files installed to #{install_path}/"
18
+ end
19
+ end
20
+
21
+ desc "update", "Update Atomic Particles"
22
+ method_options :path => :string
23
+ def update
24
+ if atomic_files_already_exist?
25
+ remove_atomic_directory
26
+ install_files
27
+ puts "Atomic Particles files have been updated."
28
+ else
29
+ puts "No existing Atomic Particles installation exists."
30
+ end
31
+ end
32
+
33
+ desc "version", "Show Atomic Particles version"
34
+ def version
35
+ say "Atomic Design Particles #{AtomicDesignParticles::VERSION}"
36
+ end
37
+
38
+ private
39
+
40
+ def atomic_files_already_exist?
41
+ install_path.exist?
42
+ end
43
+
44
+ def install_path
45
+ @install_path ||= if options[:path]
46
+ Pathname.new(File.join(options[:path], "particles"))
47
+ else
48
+ Pathname.new("particles")
49
+ end
50
+ end
51
+
52
+ def install_files
53
+ make_install_directory
54
+ copy_in_scss_files
55
+ end
56
+
57
+ def remove_atomic_directory
58
+ FileUtils.rm_rf("particles")
59
+ end
60
+
61
+ def make_install_directory
62
+ FileUtils.mkdir_p(install_path)
63
+ end
64
+
65
+ def copy_in_scss_files
66
+ FileUtils.cp_r(all_stylesheets, install_path)
67
+ end
68
+
69
+ def all_stylesheets
70
+ Dir["#{stylesheets_directory}/*"]
71
+ end
72
+
73
+ def stylesheets_directory
74
+ File.join(top_level_directory, "atomic")
75
+ end
76
+
77
+ def top_level_directory
78
+ File.dirname(File.dirname(File.dirname(__FILE__)))
79
+ end
80
+ end
81
+ end