archetype 0.0.1.pre.3.811928f → 0.0.1.pre.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +24 -1
  3. data/LICENSE +1 -1
  4. data/README.md +1 -1
  5. data/VERSION.yml +1 -1
  6. data/bin/archetype +3 -0
  7. data/lib/archetype.rb +4 -0
  8. data/lib/archetype/actions/help.rb +16 -0
  9. data/lib/archetype/actions/theme.rb +73 -0
  10. data/lib/archetype/executor.rb +27 -0
  11. data/lib/archetype/functions/hash.rb +28 -12
  12. data/lib/archetype/functions/helpers.rb +46 -13
  13. data/lib/archetype/functions/styleguide_memoizer.rb +9 -1
  14. data/lib/archetype/sass_extensions.rb +1 -0
  15. data/lib/archetype/sass_extensions/functions/lists.rb +34 -40
  16. data/lib/archetype/sass_extensions/functions/locale.rb +32 -16
  17. data/lib/archetype/sass_extensions/functions/styleguide.rb +115 -37
  18. data/lib/archetype/sass_extensions/functions/ui.rb +3 -2
  19. data/lib/archetype/sass_extensions/functions/version.rb +11 -6
  20. data/lib/archetype/sass_extensions/monkey_patches.rb +3 -0
  21. data/lib/archetype/sass_extensions/monkey_patches/handle_include_loop.rb +13 -0
  22. data/lib/archetype/version.rb +19 -12
  23. data/stylesheets/archetype/_base.scss +3 -0
  24. data/stylesheets/archetype/_config.scss +31 -7
  25. data/stylesheets/archetype/_hacks.scss +17 -5
  26. data/stylesheets/archetype/_ui.scss +64 -23
  27. data/stylesheets/archetype/styleguide/components/_buttons.scss +6 -6
  28. data/stylesheets/archetype/styleguide/components/_headlines.scss +1 -0
  29. data/stylesheets/archetype/styleguide/components/_links.scss +2 -0
  30. data/stylesheets/archetype/util/_styles.scss +59 -14
  31. data/stylesheets/archetype/util/_targeting.scss +1 -1
  32. data/templates/_theme/_components.scss +3 -0
  33. data/templates/_theme/_config.scss +1 -0
  34. data/templates/_theme/_core.scss +13 -0
  35. data/templates/_theme/_helpers.scss +1 -0
  36. data/templates/_theme/_primitives.scss +3 -0
  37. data/templates/_theme/components/README +1 -0
  38. data/templates/_theme/primitives/README +1 -0
  39. data/test/fixtures/stylesheets/archetype/config.rb +2 -0
  40. data/test/fixtures/stylesheets/archetype/expected/base.css +349 -0
  41. data/test/fixtures/stylesheets/archetype/expected/hacks/ie_pseudo.css +3 -3
  42. data/test/fixtures/stylesheets/archetype/expected/hacks/transparent_focusable.css +4 -0
  43. data/test/fixtures/stylesheets/archetype/expected/locale.css +23 -0
  44. data/test/fixtures/stylesheets/archetype/expected/styleguide/alerts.css +675 -0
  45. data/test/fixtures/stylesheets/archetype/expected/styleguide/buttons.css +110 -18
  46. data/test/fixtures/stylesheets/archetype/expected/styleguide/drop.css +63 -0
  47. data/test/fixtures/stylesheets/archetype/expected/styleguide/extend.css +7 -0
  48. data/test/fixtures/stylesheets/archetype/expected/styleguide/invalid_structures.css +21 -0
  49. data/test/fixtures/stylesheets/archetype/expected/styleguide/multi_value.css +13 -0
  50. data/test/fixtures/stylesheets/archetype/expected/styleguide/selective_state.css +3 -0
  51. data/test/fixtures/stylesheets/archetype/expected/ui/glyph_icon.css +116 -2
  52. data/test/fixtures/stylesheets/archetype/expected/utilities/associative.css +9 -0
  53. data/test/fixtures/stylesheets/archetype/expected/utilities/custom_output_styler.css +8 -0
  54. data/test/fixtures/stylesheets/archetype/expected/utilities/targeting/target-browser.css +5 -0
  55. data/test/fixtures/stylesheets/archetype/source/base.scss +3 -0
  56. data/test/fixtures/stylesheets/archetype/source/hacks/transparent_focusable.scss +5 -0
  57. data/test/fixtures/stylesheets/archetype/source/locale.scss +43 -0
  58. data/test/fixtures/stylesheets/archetype/source/styleguide/alerts.scss +21 -0
  59. data/test/fixtures/stylesheets/archetype/source/styleguide/buttons.scss +5 -1
  60. data/test/fixtures/stylesheets/archetype/source/styleguide/drop.scss +101 -0
  61. data/test/fixtures/stylesheets/archetype/source/styleguide/extend.scss +23 -0
  62. data/test/fixtures/stylesheets/archetype/source/styleguide/fallback_styles.scss +1 -1
  63. data/test/fixtures/stylesheets/archetype/source/styleguide/invalid_structures.scss +85 -0
  64. data/test/fixtures/stylesheets/archetype/source/styleguide/multi_value.scss +18 -0
  65. data/test/fixtures/stylesheets/archetype/source/styleguide/nested_styleguides.scss +1 -1
  66. data/test/fixtures/stylesheets/archetype/source/styleguide/selective_state.scss +1 -1
  67. data/test/fixtures/stylesheets/archetype/source/ui/glyph_icon.scss +30 -0
  68. data/test/fixtures/stylesheets/archetype/source/utilities/associative.scss +24 -0
  69. data/test/fixtures/stylesheets/archetype/source/utilities/custom_output_styler.scss +21 -0
  70. data/test/fixtures/stylesheets/archetype/source/utilities/targeting/target-browser.scss +8 -1
  71. data/test/helpers/test_case.rb +2 -2
  72. data/test/integrations/archetype_test.rb +3 -1
  73. data/test/units/sass_extensions_test.rb +18 -25
  74. metadata +108 -36
  75. data/test/fixtures/stylesheets/archetype/assets/images/vendor/archetype/animations/loaders-s7889ccc8c1.png +0 -0
@@ -0,0 +1,7 @@
1
+ .some-extend-class, .extend-styleguide-test {
2
+ color: red;
3
+ }
4
+
5
+ .extend-styleguide-test {
6
+ background: green;
7
+ }
@@ -0,0 +1,21 @@
1
+ .test-missing-nil {
2
+ color: red;
3
+ }
4
+
5
+ .test-missing-nil-2 {
6
+ color: yellow;
7
+ }
8
+
9
+ .test-missing-nil-3 {
10
+ color: blue;
11
+ }
12
+ .test-missing-nil-3.hover, .test-missing-nil-3:hover, .test-missing-nil-3.focus, .test-missing-nil-3:focus {
13
+ color: black;
14
+ background: green;
15
+ font-weight: bold;
16
+ }
17
+
18
+ .test-missing-comma {
19
+ color: white;
20
+ background: green;
21
+ }
@@ -0,0 +1,13 @@
1
+ .multi-value-styleguide-test {
2
+ color: gray;
3
+ color: rgba(0, 0, 0, 0.7);
4
+ background: white;
5
+ background: transparent;
6
+ *color: blue;
7
+ }
8
+ .ie.ie8 .multi-value-styleguide-test {
9
+ color: red;
10
+ }
11
+ .multi-value-styleguide-test, .multi-value-styleguide-test x:-moz-any-link {
12
+ color: pink;
13
+ }
@@ -6,6 +6,7 @@
6
6
  margin: 0;
7
7
  overflow: visible;
8
8
  text-decoration: none !important;
9
+ text-align: center;
9
10
  width: auto;
10
11
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
11
12
  -webkit-border-radius: 3px;
@@ -52,6 +53,7 @@
52
53
  margin: 0;
53
54
  overflow: visible;
54
55
  text-decoration: none !important;
56
+ text-align: center;
55
57
  width: auto;
56
58
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
57
59
  -webkit-border-radius: 3px;
@@ -96,6 +98,7 @@
96
98
  margin: 0;
97
99
  overflow: visible;
98
100
  text-decoration: none !important;
101
+ text-align: center;
99
102
  width: auto;
100
103
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
101
104
  -webkit-border-radius: 3px;
@@ -1,8 +1,109 @@
1
+ @font-face {
2
+ font-family: "FontAwesome";
3
+ src: url('/assets/fonts/vendor/archetype/fontawesome-webfont.eot');
4
+ src: url('/assets/fonts/vendor/archetype/fontawesome-webfont.eot?#iefix') format('eot'), url('/assets/fonts/vendor/archetype/fontawesome-webfont.woff') format('woff'), url('/assets/fonts/vendor/archetype/fontawesome-webfont.ttf') format('truetype'), url('/assets/fonts/vendor/archetype/fontawesome-webfont.svg#FontAwesome') format('svg');
5
+ font-weight: normal;
6
+ font-style: normal;
7
+ }
8
+
9
+ @font-face {
10
+ font-family: "FontAwesome-0.0.1";
11
+ src: url('/assets/fonts/vendor/archetype/fontawesome-webfont.eot');
12
+ src: url('/assets/fonts/vendor/archetype/fontawesome-webfont.eot?#iefix') format('eot'), url('/assets/fonts/vendor/archetype/fontawesome-webfont.woff') format('woff'), url('/assets/fonts/vendor/archetype/fontawesome-webfont.ttf') format('truetype'), url('/assets/fonts/vendor/archetype/fontawesome-webfont.svg#FontAwesome') format('svg');
13
+ font-weight: normal;
14
+ font-style: normal;
15
+ }
16
+
1
17
  .simple {
2
- *zoom: expression(this.runtimeStyle.zoom="1", this.el=document.createElement("x-archetype-glyph"),this.el.innerHTML="",this.el.style.cssText="font-family:'FontAwesome';font-weight:normal;font-style:normal;text-decoration:inherit;font-size:100%;color:inherit;",this.insertBefore(this.el));
18
+ *zoom: expression(this.runtimeStyle.zoom="1", this.el=document.createElement("x-archetype-glyph"),this.el.id="ie-pseudo-archetype-uid-RANDOM_UID",this.el.innerHTML="",this.el.style.cssText="font-family:'FontAwesome-0.0.1', 'FontAwesome';font-weight:normal;font-style:normal;text-decoration:inherit;font-size:100%;color:inherit;",this.insertBefore(this.el));
3
19
  }
4
20
  .simple:before {
5
- font-family: FontAwesome;
21
+ font-family: "FontAwesome-0.0.1", "FontAwesome";
22
+ font-weight: normal;
23
+ font-style: normal;
24
+ text-decoration: inherit;
25
+ speak: none;
26
+ font-size: 100%;
27
+ color: inherit;
28
+ content: "\f0d7";
29
+ }
30
+
31
+ .false {
32
+ font-family: "FontAwesome-0.0.1", "FontAwesome";
33
+ font-weight: normal;
34
+ font-style: normal;
35
+ text-decoration: inherit;
36
+ speak: none;
37
+ font-size: 100%;
38
+ color: inherit;
39
+ }
40
+
41
+ .size {
42
+ *zoom: expression(this.runtimeStyle.zoom="1", this.el=document.createElement("x-archetype-glyph"),this.el.id="ie-pseudo-archetype-uid-RANDOM_UID",this.el.innerHTML="",this.el.style.cssText="font-family:'FontAwesome-0.0.1', 'FontAwesome';font-weight:normal;font-style:normal;text-decoration:inherit;font-size:20px;color:inherit;",this.insertBefore(this.el));
43
+ }
44
+ .size:before {
45
+ font-family: "FontAwesome-0.0.1", "FontAwesome";
46
+ font-weight: normal;
47
+ font-style: normal;
48
+ text-decoration: inherit;
49
+ speak: none;
50
+ font-size: 20px;
51
+ color: inherit;
52
+ content: "\f0d7";
53
+ }
54
+
55
+ .not-inline {
56
+ *zoom: expression(this.runtimeStyle.zoom="1", this.el=document.createElement("x-archetype-glyph"),this.el.id="ie-pseudo-archetype-uid-RANDOM_UID",this.el.innerHTML="",this.insertBefore(this.el));
57
+ }
58
+ .not-inline:before {
59
+ font-family: "FontAwesome-0.0.1", "FontAwesome";
60
+ font-weight: normal;
61
+ font-style: normal;
62
+ text-decoration: inherit;
63
+ speak: none;
64
+ font-size: 100%;
65
+ color: inherit;
66
+ content: "\f0d7";
67
+ }
68
+ .not-inline #ie-pseudo-archetype-uid-RANDOM_UID {
69
+ font-family: 'FontAwesome-0.0.1', 'FontAwesome';
70
+ font-weight: normal;
71
+ font-style: normal;
72
+ text-decoration: inherit;
73
+ font-size: 100%;
74
+ color: inherit;
75
+ }
76
+
77
+ .ie-uid {
78
+ *zoom: expression(this.runtimeStyle.zoom="1", this.el=document.createElement("x-archetype-glyph"),this.el.id="my-custom-id",this.el.innerHTML="",this.insertBefore(this.el));
79
+ }
80
+ .ie-uid:before {
81
+ font-family: "FontAwesome-0.0.1", "FontAwesome";
82
+ font-weight: normal;
83
+ font-style: normal;
84
+ text-decoration: inherit;
85
+ speak: none;
86
+ font-size: 100%;
87
+ color: inherit;
88
+ content: "\f0d7";
89
+ }
90
+ .ie-uid #my-custom-id {
91
+ font-family: 'FontAwesome-0.0.1', 'FontAwesome';
92
+ font-weight: normal;
93
+ font-style: normal;
94
+ text-decoration: inherit;
95
+ font-size: 100%;
96
+ color: inherit;
97
+ }
98
+ .ie-uid:before, .ie-uid #my-custom-id {
99
+ color: pink;
100
+ }
101
+
102
+ .content-block {
103
+ *zoom: expression(this.runtimeStyle.zoom="1", this.el=document.createElement("x-archetype-glyph"),this.el.id="ie-pseudo-archetype-uid-RANDOM_UID",this.el.innerHTML="",this.insertBefore(this.el));
104
+ }
105
+ .content-block:before {
106
+ font-family: "FontAwesome-0.0.1", "FontAwesome";
6
107
  font-weight: normal;
7
108
  font-style: normal;
8
109
  text-decoration: inherit;
@@ -11,3 +112,16 @@
11
112
  color: inherit;
12
113
  content: "\f0d7";
13
114
  }
115
+ .content-block #ie-pseudo-archetype-uid-RANDOM_UID {
116
+ font-family: 'FontAwesome-0.0.1', 'FontAwesome';
117
+ font-weight: normal;
118
+ font-style: normal;
119
+ text-decoration: inherit;
120
+ font-size: 100%;
121
+ color: inherit;
122
+ }
123
+ .content-block:before, .content-block #ie-pseudo-archetype-uid-RANDOM_UID {
124
+ position: absolute;
125
+ top: 10px;
126
+ left: 10px;
127
+ }
@@ -0,0 +1,9 @@
1
+ .test {
2
+ a: "1";
3
+ b: "2";
4
+ c: "5";
5
+ d: "6";
6
+ e: "5";
7
+ f: "6";
8
+ g: "1";
9
+ }
@@ -0,0 +1,8 @@
1
+ .test {
2
+ font-size: 13px;
3
+ line-height: 17px;
4
+ /* post override */
5
+ color: #222222;
6
+ /* pre override */
7
+ font-weight: normal;
8
+ }
@@ -98,3 +98,8 @@
98
98
  .target-opera, .target-opera x:-o-prefocus {
99
99
  width: 82%;
100
100
  }
101
+
102
+ .ie.lte8 .target-with-content-block {
103
+ /* testing content block */
104
+ color: red;
105
+ }
@@ -0,0 +1,3 @@
1
+ @import "archetype";
2
+
3
+ @include generate-loader-keyframes();
@@ -0,0 +1,5 @@
1
+ @import "archetype";
2
+
3
+ .test {
4
+ @include transparent-focusable();
5
+ }
@@ -0,0 +1,43 @@
1
+ @import "archetype";
2
+
3
+ // test for a simple locale
4
+ .en_US {
5
+ @if(locale(en_US)) {
6
+ content: "en_US";
7
+ }
8
+ }
9
+
10
+ // test for a wildcard territory
11
+ .en_wild {
12
+ @if(locale(en_)) {
13
+ content: "en_*";
14
+ }
15
+ }
16
+
17
+ // test for a wildcard language
18
+ .wild_US {
19
+ @if(locale(_US)) {
20
+ content: "*_US";
21
+ }
22
+ }
23
+
24
+ // multiple locales, one valid
25
+ .one {
26
+ @if(locale(de_DE fr_FR pt_ en_US)) {
27
+ content: "one of de_DE fr_FR pt_ en_US";
28
+ }
29
+ }
30
+
31
+ // multiple locales, none valid
32
+ .not {
33
+ @if(not locale(ja_JP pt_BR _GB de_)) {
34
+ content: "not one of ja_JP pt_BR _GB de_";
35
+ }
36
+ }
37
+
38
+ // test that the lang() alias works
39
+ .lang {
40
+ @if(lang(en_US)) {
41
+ content: "en_US";
42
+ }
43
+ }
@@ -0,0 +1,21 @@
1
+ @import "archetype";
2
+
3
+ @each $type in (error success notice yield) {
4
+ .alert.#{$type} {
5
+ @include styleguide($type alert);
6
+ .dismiss {
7
+ @include styleguide(close in a $type alert);
8
+ }
9
+ }
10
+ }
11
+
12
+ $CONFIG_GENERATED_TAG_INLINE: false;
13
+
14
+ @each $type in (error success notice yield) {
15
+ .alert.#{$type} {
16
+ @include styleguide($type alert);
17
+ .dismiss {
18
+ @include styleguide(close in a $type alert);
19
+ }
20
+ }
21
+ }
@@ -1,4 +1,4 @@
1
- @import "archetype";
1
+ @import "archetype";
2
2
 
3
3
  @each $context in container, bristol, punchcut {
4
4
  .#{$context} {
@@ -12,3 +12,7 @@
12
12
  }
13
13
  }
14
14
  }
15
+
16
+ .test-exclude {
17
+ @include styleguide(small secondary button in a container, $exclude: width height border-radius padding font-size line-height cursor);
18
+ }
@@ -0,0 +1,101 @@
1
+ @import "archetype";
2
+
3
+ @if not styleguide-component-exists(dropping-styles-test, $CONFIG_THEME) {
4
+ $a-blackhole: styleguide-add-component(dropping-styles-test, (), (
5
+ (default, (
6
+ display block,
7
+ color red,
8
+ background green,
9
+ (states, (
10
+ (hover, (
11
+ styleguide module,
12
+ border (2px solid red),
13
+ (selectors, (
14
+ ('.test', (
15
+ padding 100px,
16
+ margin 20px
17
+ )),
18
+ nil
19
+ ))
20
+ )),
21
+ nil
22
+ ))
23
+ )),
24
+ (parent, (
25
+ display none,
26
+ color black
27
+ )),
28
+ (heir, (
29
+ inherit (parent),
30
+ nil
31
+ )),
32
+ (dropped, (
33
+ drop true,
34
+ color yellow
35
+ )),
36
+ (dropped2, (
37
+ drop true,
38
+ color yellow,
39
+ (states, (
40
+ (hover, (
41
+ color blue,
42
+ nil
43
+ )),
44
+ (active, (
45
+ color green,
46
+ width 100%
47
+ )),
48
+ nil
49
+ ))
50
+ )),
51
+ (dropped3, (
52
+ color purple,
53
+ (states, (
54
+ drop hover, // TODO: this is currently throwing an ambiguous warning, need to investigate
55
+ nil
56
+ )),
57
+ nil
58
+ )),
59
+ (dropped4, (
60
+ color purple,
61
+ (states, (
62
+ (hover, (
63
+ drop selectors,
64
+ nil
65
+ )),
66
+ nil
67
+ ))
68
+ )),
69
+ nil
70
+ ), $CONFIG_THEME);
71
+ }
72
+
73
+ .dropping-styles-test {
74
+ /* should contain hover state and .test selector */
75
+ @include styleguide(dropping-styles-test);
76
+ &.parent {
77
+ /* should contain hover state and .test selector */
78
+ @include styleguide(parent dropping-styles-test);
79
+ }
80
+ &.heir {
81
+ /* should contain hover state and .test selector */
82
+ @include styleguide(heir dropping-styles-test);
83
+ }
84
+ &.dropped {
85
+ /* should only contain color:yellow */
86
+ @include styleguide(dropped dropping-styles-test);
87
+ }
88
+ &.dropped2 {
89
+ /* should contain color:yellow, custom :hover, :active */
90
+ @include styleguide(dropped2 dropping-styles-test);
91
+ }
92
+ &.dropped3 {
93
+ /* should only contain color:purple */
94
+ @include styleguide(dropped3 dropping-styles-test);
95
+ }
96
+ // TODO fix this guy: drops nested multiple levels deep don't resolve yet :(
97
+ //&.dropped4 {
98
+ // /* should contain color:purple, :hover, but no `.test` selector */
99
+ // @include styleguide(dropped4 dropping-styles-test);
100
+ //}
101
+ }
@@ -0,0 +1,23 @@
1
+ @import "archetype";
2
+
3
+ .some-extend-class {
4
+ color: red;
5
+ }
6
+
7
+ %some-extend-placeholder {
8
+ background: green;
9
+ }
10
+
11
+ @if not styleguide-component-exists(extend-styleguide-test, $CONFIG_THEME) {
12
+ $a-blackhole: styleguide-add-component(extend-styleguide-test, (), (
13
+ (default, (
14
+ extend '.some-extend-class',
15
+ extend '%some-extend-placeholder'
16
+ )),
17
+ nil
18
+ ), $CONFIG_THEME);
19
+ }
20
+
21
+ .extend-styleguide-test {
22
+ @include styleguide(extend-styleguide-test);
23
+ }