facades 0.1.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (132) hide show
  1. data/.gitignore +1 -0
  2. data/.rbenv-gemsets +1 -0
  3. data/.rvmrc +1 -0
  4. data/.travis.yml +6 -0
  5. data/Gemfile +12 -0
  6. data/Guardfile +19 -0
  7. data/README.md +115 -101
  8. data/Rakefile +8 -0
  9. data/app/assets/javascripts/facades/debug/grid.js +0 -0
  10. data/app/helpers/facades_helper.rb +1 -0
  11. data/config.ru +7 -0
  12. data/facades.gemspec +9 -2
  13. data/lib/facades/helpers/layout.rb +36 -73
  14. data/lib/facades/helpers/navigation.rb +182 -110
  15. data/lib/facades/helpers/{elements.rb → notifications.rb} +9 -36
  16. data/lib/facades/helpers.rb +6 -17
  17. data/lib/facades/patterns/tabs.rb +75 -0
  18. data/lib/facades/patterns.rb +7 -0
  19. data/lib/facades/{sass_ext → sass_extensions}/color.rb +5 -13
  20. data/lib/facades/sass_extensions/conversions.rb +27 -0
  21. data/lib/facades/sass_extensions/functions.rb +84 -0
  22. data/lib/facades/sass_extensions/icons.rb +66 -0
  23. data/lib/facades/sass_extensions.rb +21 -0
  24. data/lib/facades/support/compass/project/MIT-LICENSE.txt +20 -0
  25. data/lib/facades/support/compass/project/humans.txt +8 -0
  26. data/lib/facades/support/compass/project/index.html +45 -0
  27. data/lib/facades/support/compass/project/manifest.rb +18 -0
  28. data/lib/facades/support/compass/project/robots.txt +4 -0
  29. data/lib/facades/support/compass.rb +9 -0
  30. data/lib/facades/support/rails.rb +12 -15
  31. data/lib/facades/support/simple_form.rb +32 -0
  32. data/lib/facades/version.rb +1 -1
  33. data/lib/facades.rb +21 -44
  34. data/spec/internal/app/helpers/application_helper.rb +3 -0
  35. data/spec/internal/app/views/navigation/_multi_list.html.erb +11 -0
  36. data/spec/internal/app/views/navigation/_multi_option_list.html.erb +14 -0
  37. data/spec/internal/app/views/navigation/_single_list.html.erb +9 -0
  38. data/spec/internal/config/database.yml +3 -0
  39. data/spec/internal/config/routes.rb +3 -0
  40. data/spec/internal/db/schema.rb +3 -0
  41. data/spec/internal/log/.gitignore +1 -0
  42. data/spec/internal/public/favicon.ico +0 -0
  43. data/spec/spec_helper.rb +16 -6
  44. data/spec/unit/helpers/layout_spec.rb +4 -0
  45. data/spec/unit/helpers/navigation_spec.rb +384 -0
  46. data/spec/unit/helpers/notifications_spec.rb +4 -0
  47. data/spec/unit/patterns/tabs_spec.rb +58 -0
  48. data/src/icons/facades.yml +105 -0
  49. data/src/icons/font-awesome.yml +210 -0
  50. data/src/scss/facades/_buttons.scss +10 -0
  51. data/src/scss/facades/_config.scss +99 -0
  52. data/src/scss/facades/_debug.scss +8 -0
  53. data/src/scss/facades/_forms.scss +228 -0
  54. data/src/scss/facades/_global.scss +104 -0
  55. data/src/scss/facades/_icons.scss +61 -0
  56. data/src/scss/facades/_mixins.scss +115 -0
  57. data/src/scss/facades/_mobile.scss +3 -0
  58. data/src/scss/facades/_setup.scss +191 -0
  59. data/src/scss/facades/_typography.scss +220 -0
  60. data/src/scss/facades/buttons/_glossy.scss +29 -0
  61. data/src/scss/facades/buttons/_gradient.scss +36 -0
  62. data/src/scss/facades/buttons/_shared.scss +33 -0
  63. data/src/scss/facades/buttons/_simple.scss +28 -0
  64. data/src/scss/facades/icons/_classes.scss +37 -0
  65. data/src/scss/facades/icons/_legacy.scss +27 -0
  66. data/src/scss/facades/layout/_lists.scss +43 -0
  67. data/src/scss/facades/mixins/_gradients.scss +30 -0
  68. data/src/scss/facades/mixins/_rhythm.scss +37 -0
  69. data/src/scss/facades/mobile/_buttons.scss +97 -0
  70. data/src/scss/facades/mobile/_config.scss +30 -0
  71. data/src/scss/facades/mobile/_global.scss +81 -0
  72. data/src/scss/facades/mobile/_mixins.scss +49 -0
  73. data/src/scss/facades/mobile/_setup.scss +50 -0
  74. data/src/scss/facades/mobile/patterns/_navbar.scss +21 -0
  75. data/src/scss/facades/mobile/patterns/_panel.scss +37 -0
  76. data/src/scss/facades/mobile/patterns/_stage.scss +20 -0
  77. data/src/scss/facades/mobile/patterns/_toolbar.scss +25 -0
  78. data/src/scss/facades/mobile/themes/_apple.scss +17 -0
  79. data/src/scss/facades/patterns/_labels.scss +50 -0
  80. data/src/scss/facades/patterns/_navbar.scss +4 -0
  81. data/src/scss/facades/patterns/_notifications.scss +82 -0
  82. data/src/scss/facades/patterns/_pagination.scss +4 -0
  83. data/src/scss/facades/patterns/_pills.scss +50 -0
  84. data/src/scss/facades/patterns/_tabs.scss +83 -0
  85. data/src/scss/facades/patterns/_twipsy.scss +84 -0
  86. data/src/scss/facades/typography/_tables.scss +95 -0
  87. metadata +201 -58
  88. data/app/views/facades/_pagination.html.erb +0 -20
  89. data/lib/facades/builders/form/base.rb +0 -212
  90. data/lib/facades/builders/form/elements.rb +0 -112
  91. data/lib/facades/builders/form/helper.rb +0 -29
  92. data/lib/facades/builders/form.rb +0 -22
  93. data/lib/facades/builders/sprite.rb +0 -50
  94. data/lib/facades/builders/table.rb +0 -76
  95. data/lib/facades/debug/html.rb +0 -6
  96. data/lib/facades/helpers/builders.rb +0 -24
  97. data/lib/facades/helpers/mobile.rb +0 -57
  98. data/lib/facades/helpers/pagination.rb +0 -83
  99. data/lib/facades/helpers/utility.rb +0 -31
  100. data/lib/facades/sass_ext/form_elements.rb +0 -52
  101. data/lib/facades/sass_ext/funcs.rb +0 -33
  102. data/lib/facades/sass_ext.rb +0 -14
  103. data/lib/facades/stylesheets/facades/_common.scss +0 -7
  104. data/lib/facades/stylesheets/facades/_css3.scss +0 -93
  105. data/lib/facades/stylesheets/facades/_layout.scss +0 -5
  106. data/lib/facades/stylesheets/facades/_normalize.scss +0 -5
  107. data/lib/facades/stylesheets/facades/_setup.scss +0 -104
  108. data/lib/facades/stylesheets/facades/_typography.scss +0 -2
  109. data/lib/facades/stylesheets/facades/_ui.scss +0 -3
  110. data/lib/facades/stylesheets/facades/_utilities.scss +0 -32
  111. data/lib/facades/stylesheets/facades/layout/_dropdown-list.scss +0 -7
  112. data/lib/facades/stylesheets/facades/layout/_forms.scss +0 -53
  113. data/lib/facades/stylesheets/facades/layout/_grid.scss +0 -49
  114. data/lib/facades/stylesheets/facades/layout/_responsive_grid.scss +0 -164
  115. data/lib/facades/stylesheets/facades/setup/_forms.scss +0 -284
  116. data/lib/facades/stylesheets/facades/setup/_ie.scss +0 -12
  117. data/lib/facades/stylesheets/facades/setup/_reset.scss +0 -255
  118. data/lib/facades/stylesheets/facades/typography/_baseline.scss +0 -91
  119. data/lib/facades/stylesheets/facades/typography/_lists.scss +0 -34
  120. data/lib/facades/stylesheets/facades/typography/_shadow.scss +0 -8
  121. data/lib/facades/stylesheets/facades/ui/_buttons.scss +0 -34
  122. data/lib/facades/stylesheets/facades/ui/_flash-messages.scss +0 -29
  123. data/lib/facades/stylesheets/facades/ui/_tabbed.scss +0 -5
  124. data/lib/facades/stylesheets/facades/ui/_tool-tip.scss +0 -44
  125. data/lib/facades/stylesheets/facades/utilities/_clearfix.scss +0 -20
  126. data/lib/facades/stylesheets/facades/utilities/_color.scss +0 -7
  127. data/lib/facades/stylesheets/facades/utilities/_cursors.scss +0 -4
  128. data/lib/facades/support/serve.rb +0 -17
  129. data/lib/facades/support/tipsy.rb +0 -17
  130. data/spec/facades/helpers/elements_spec.rb +0 -86
  131. data/spec/facades/helpers/layout_helpers_spec.rb +0 -5
  132. data/spec/facades/helpers/navigation_spec.rb +0 -107
@@ -0,0 +1,82 @@
1
+ //
2
+ // Alert and notifications
3
+ // ----------------------------------------------------------------------------------------
4
+
5
+ @import 'facades/config';
6
+ @import 'facades/mixins';
7
+
8
+ @mixin notification($with-color: true){
9
+
10
+ @include margins(1);
11
+ padding:border-rhythm(1px, .5) rhythm(1.25) border-rhythm(1px, .5) rhythm(1);
12
+ @include leading(1);
13
+ border-width: 1px;
14
+ border-style: solid;
15
+ @include border-radius(4px);
16
+ position:relative;
17
+
18
+ @if $with-color{
19
+ background:#eee;
20
+ border-color:#dedede;
21
+ border-color:darken(#eee, 5%);
22
+ text-shadow:rgba(0,0,0,.05) 1px 1px 0px;
23
+
24
+ &.notice{
25
+ background-color:$notice-color;
26
+ @include background-image(linear-gradient(darken($notice-color, 3%) 0%, $notice-color 100%));
27
+ border-color:darken($notice-color, 5%);
28
+ color:white;
29
+ }
30
+
31
+ &.success{
32
+ background-color:$success-color;
33
+ @include background-image(linear-gradient(darken($success-color, 3%) 0%, $success-color 100%));
34
+ border-color:darken($success-color, 5%);
35
+ color:white;
36
+ }
37
+
38
+ &.error, &.alert{
39
+ background-color:$error-color;
40
+ @include background-image(linear-gradient(darken($error-color, 3%) 0%, $error-color 100%));
41
+ border-color:darken($error-color, 5%);
42
+ color:white;
43
+ }
44
+
45
+ &.warning{
46
+ background-color:$warning-color;
47
+ @include background-image(linear-gradient(top, darken($warning-color, 3%) 0%, $warning-color 100%));
48
+ border-color:darken($warning-color, 5%);
49
+ color:$font-color;
50
+ }
51
+
52
+ }
53
+
54
+ .close {
55
+ text-transform:lowercase;
56
+ font-family: 'Arial Black', 'Gadget', sans-serif;
57
+ float: right;
58
+ font-size:$font-size + 2px;
59
+ display:block;
60
+ position:absolute;
61
+ top:50%;
62
+ right:.5em;
63
+ height: 24px;
64
+ margin-top:-14px;
65
+ line-height:24px;
66
+ color: #111;
67
+ text-shadow:rgba(255,255,255,1) 0 1px 0;
68
+ @include opacity(20);
69
+
70
+ &:hover {
71
+ color: #333;
72
+ text-decoration: none;
73
+ @include opacity(40);
74
+ cursor: pointer;
75
+ }
76
+
77
+ &.lt-ie8 .close{
78
+ line-height:0;
79
+ }
80
+
81
+ }
82
+ }
@@ -0,0 +1,4 @@
1
+ //
2
+ // Pagination
3
+ // Styles for paginated links
4
+ // ----------------------------------------------------------------------------------------
@@ -0,0 +1,50 @@
1
+ //
2
+ // Pills. Basically tabs but with 'pill' style navigation
3
+ // Requires the use of tabs.js
4
+ // ----------------------------------------------------------------------------------------
5
+
6
+ @import 'facades/config';
7
+ @import 'facades/layout/lists';
8
+
9
+ // Styles a list to function as a pill based navigation
10
+ @mixin pill-navigation{
11
+ @if $facades-global-import-used == false{
12
+ @include inline-list;
13
+ }
14
+
15
+ margin:0;
16
+ padding:0;
17
+ @include clearfix;
18
+
19
+ li{
20
+ @include pill-list-item;
21
+ }
22
+ }
23
+
24
+ @mixin pill-list-item($color: $pill-color){
25
+ margin:0 .25em;
26
+
27
+ a{
28
+ @include font-size($font-size * .85);
29
+ color:$font-color;
30
+ padding:rhythm(.25, $font-size * .85) 1em;
31
+ margin:rhythm(.25, $font-size * .85) 0;
32
+ text-decoration:none;
33
+ @include opacity(50);
34
+
35
+ &:hover{
36
+ @include opacity(75);
37
+ }
38
+ }
39
+
40
+ &.active a{
41
+ @include optional-border-radius($pill-border-radius);
42
+ background-color:$color;
43
+ color:white;
44
+ text-shadow:rgba(black, 0.1);
45
+ font-weight:bold;
46
+ &, &:hover{
47
+ @include opacity(100);
48
+ }
49
+ }
50
+ }
@@ -0,0 +1,83 @@
1
+ //
2
+ // Tabs. Requires the use of tabs.js
3
+ // ----------------------------------------------------------------------------------------
4
+
5
+ /*
6
+ The tabbed base mixin is / can be used with both tabbed and pill base setups.
7
+ when including the style can either be set to tab or pill. There are lots of other
8
+ mixins below for the various features of a tabbed based nav. This way when used in
9
+ things like _global.scss, we don't end up with a lot of duplication.
10
+ */
11
+
12
+ @import 'facades/layout/lists';
13
+
14
+ @mixin tabbed($style: tab){
15
+ .tab{
16
+ display:none;
17
+ }
18
+
19
+ & > .tab.active{
20
+ display:block;
21
+ // padding the tab content keeps the rhythm intact because of margin collapsing
22
+ padding-top:rhythm(.5);
23
+ }
24
+
25
+ &.no-js .tab{
26
+ display:block;
27
+ }
28
+ }
29
+
30
+ // Styles a list to function as a tab based navigation
31
+ @mixin tab-navigation{
32
+ @if $facades-global-import-used == false{
33
+ @include inline-list;
34
+ }
35
+ margin:0 0 rhythm(.5) 0;
36
+ padding:0;
37
+ border-bottom:1px solid $tab-border-color;
38
+ @include clearfix;
39
+
40
+ li{
41
+ @include tab-list-item;
42
+ }
43
+
44
+ }
45
+
46
+ // really for internal use. makes a li into a tab.
47
+ @mixin tab-list-item{
48
+ margin:0 0 0 .25em;
49
+
50
+ a{
51
+ color:$font-color;
52
+ text-decoration:none;
53
+ padding:border-rhythm(1px, .5) rhythm(.75) rhythm(.5);
54
+ @include opacity(50);
55
+ &:hover{
56
+ @include opacity(75);
57
+ }
58
+ }
59
+
60
+ &.active a{
61
+ @include border-radius(4px 4px 0px 0px);
62
+ background-color:transparent;
63
+ border: 1px solid $tab-border-color;
64
+ border-width:4px 1px 0 1px;
65
+ border-top-color: $tab-accent-color;
66
+ padding:border-rhythm(4px, .5) rhythm(.75) rhythm(.5);
67
+
68
+ &, &:hover{
69
+ @include opacity(100);
70
+ }
71
+ }
72
+
73
+ }
74
+
75
+
76
+
77
+ @mixin tabs{
78
+ .tab-navigation{
79
+ @include tab-navigation;
80
+ }
81
+
82
+ @include tabbed;
83
+ }
@@ -0,0 +1,84 @@
1
+ //
2
+ // Twipsy tooltip
3
+ // Courtesy Twitter Bootstrap
4
+ // https://github.com/twitter/bootstrap
5
+ // ----------------------------------------------------------------------------------------
6
+
7
+ @mixin tooltip{
8
+ position: absolute;
9
+ display: block;
10
+ visibility: visible;
11
+ padding: 5px;
12
+ font-size: 11px;
13
+ @include opacity(0);
14
+ &.in { @include opacity(80); }
15
+ &.top { margin-top: -2px; }
16
+ &.right { margin-left: 2px; }
17
+ &.bottom { margin-top: 2px; }
18
+ &.left { margin-left: -2px; }
19
+ &.top .tooltip-arrow { @include tooltip-arrow-top; }
20
+ &.left .tooltip-arrow { @include tooltip-arrow-top; }
21
+ &.bottom .tooltip-arrow { @include tooltip-arrow-top; }
22
+ &.right .tooltip-arrow { @include tooltip-arrow-top; }
23
+
24
+ .tooltip-inner {
25
+ max-width: 200px;
26
+ padding: 3px 8px;
27
+ color: white;
28
+ text-align: center;
29
+ text-decoration: none;
30
+ background-color: $tooltip-color;
31
+ @include border-radius(4px);
32
+ }
33
+
34
+ .tooltip-arrow {
35
+ position: absolute;
36
+ width: 0;
37
+ height: 0;
38
+ }
39
+
40
+ }
41
+
42
+
43
+ // alias
44
+ @mixin twipsy{
45
+ @include tooltip;
46
+ }
47
+
48
+ // Popover arrows
49
+ // For tipsies and tooltips
50
+ @mixin tooltip-arrow-top($arrow-width: 5px){
51
+ bottom: 0;
52
+ left: 50%;
53
+ margin-left: -$arrow-width;
54
+ border-left: $arrow-width solid transparent;
55
+ border-right: $arrow-width solid transparent;
56
+ border-top: $arrow-width solid $tooltip-color;
57
+ }
58
+
59
+ @mixin tooltip-arrow-left($arrow-width: 5px){
60
+ top: 50%;
61
+ right: 0;
62
+ margin-top: -$arrow-width;
63
+ border-top: $arrow-width solid transparent;
64
+ border-bottom: $arrow-width solid transparent;
65
+ border-left: $arrow-width solid $tooltip-color;
66
+ }
67
+
68
+ @mixin tooltip-arrow-bottom($arrow-width: 5px){
69
+ top: 0;
70
+ left: 50%;
71
+ margin-left: -$arrow-width;
72
+ border-left: $arrow-width solid transparent;
73
+ border-right: $arrow-width solid transparent;
74
+ border-bottom: $arrow-width solid $tooltip-color;
75
+ }
76
+
77
+ @mixin tooltip-arrow-right($arrow-width: 5px){
78
+ top: 50%;
79
+ left: 0;
80
+ margin-top: -$arrow-width;
81
+ border-top: $arrow-width solid transparent;
82
+ border-bottom: $arrow-width solid transparent;
83
+ border-right: $arrow-width solid $tooltip-color;
84
+ }
@@ -0,0 +1,95 @@
1
+ @import 'facades/config';
2
+ @import 'facades/mixins/rhythm';
3
+
4
+
5
+ // Table action
6
+ // ----------------------------------------
7
+ table {
8
+ width: 100%;
9
+ border-collapse: separate;
10
+ margin-bottom: rhythm(1);
11
+ }
12
+
13
+ th, td {
14
+ @include leading(1);
15
+ border-spacing:0;
16
+ text-align: left;
17
+ border-top: 1px solid $table-border-color;
18
+ @include box-sizing(border-box);
19
+ }
20
+
21
+ tr, tbody{ @include box-sizing(border-box); }
22
+
23
+ th {
24
+ padding:border-rhythm(1px, .5) rhythm(.4, $font-size) rhythm(.5);
25
+ font-weight: bold;
26
+ vertical-align: bottom;
27
+ }
28
+
29
+ td {
30
+ padding:border-rhythm(1px, .5) rhythm(.4, $font-size) rhythm(.5);
31
+ vertical-align: top;
32
+ }
33
+
34
+ thead:first-child tr th,
35
+ thead:first-child tr td {
36
+ border-top: 0;
37
+ }
38
+
39
+ tbody + tbody {
40
+ border-top: 2px solid $table-border-color;
41
+ @include box-sizing(border-box);
42
+ }
43
+
44
+
45
+ // Bordered tables
46
+ // --------------------------------
47
+
48
+ @mixin bordered-table{
49
+
50
+ margin-bottom: border-rhythm(2px, 1);
51
+ border: 1px solid $table-border-color;
52
+
53
+ th + th, td + td, th + td, td + th {
54
+ border-left: 1px solid $table-border-color;
55
+ }
56
+
57
+ thead:first-child tr:first-child th,
58
+ tbody:first-child tr:first-child td {
59
+ border-top: 0;
60
+ }
61
+
62
+ }
63
+
64
+
65
+ // Striped tables
66
+ // --------------------------------
67
+
68
+
69
+ @mixin striped-table{
70
+ tbody {
71
+ tr:nth-child(odd) td,
72
+ tr:nth-child(odd) th {
73
+ background-color: $table-stripe-color;
74
+ }
75
+ }
76
+ }
77
+
78
+ // Compressed tables
79
+ // --------------------------------
80
+
81
+ @mixin compressed-table{
82
+ &{ @include margins(0 1.5); }
83
+
84
+ th {
85
+ padding:rhythm(.25) rhythm(.4, $font-size) rhythm(.25);
86
+ font-weight: bold;
87
+ vertical-align: bottom;
88
+ }
89
+
90
+ td {
91
+ padding:border-rhythm(1px, .25) rhythm(.4, $font-size) rhythm(.25);
92
+ vertical-align: top;
93
+ }
94
+
95
+ }