titon-toolkit 2.0.2 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/changelog.md +66 -183
  3. data/readme.md +17 -8
  4. data/roadmap.md +13 -11
  5. data/scss/toolkit.scss +3 -2
  6. data/scss/toolkit/_common.scss +72 -22
  7. data/scss/toolkit/base.scss +12 -1
  8. data/scss/toolkit/components/accordion.scss +19 -17
  9. data/scss/toolkit/components/blackout.scss +20 -18
  10. data/scss/toolkit/components/breadcrumb.scss +37 -36
  11. data/scss/toolkit/components/button-group.scss +130 -128
  12. data/scss/toolkit/components/button.scss +100 -98
  13. data/scss/toolkit/components/carousel.scss +63 -63
  14. data/scss/toolkit/components/code.scss +49 -47
  15. data/scss/toolkit/components/divider.scss +34 -32
  16. data/scss/toolkit/components/drop.scss +82 -79
  17. data/scss/toolkit/components/flex.scss +110 -0
  18. data/scss/toolkit/components/flyout.scss +59 -53
  19. data/scss/toolkit/components/form.scss +178 -170
  20. data/scss/toolkit/components/grid.scss +36 -34
  21. data/scss/toolkit/components/icon.scss +28 -25
  22. data/scss/toolkit/components/input-group.scss +35 -33
  23. data/scss/toolkit/components/input.scss +102 -99
  24. data/scss/toolkit/components/label.scss +99 -97
  25. data/scss/toolkit/components/lazy-load.scss +6 -4
  26. data/scss/toolkit/components/loader.scss +124 -122
  27. data/scss/toolkit/components/mask.scss +24 -22
  28. data/scss/toolkit/components/matrix.scss +16 -14
  29. data/scss/toolkit/components/modal.scss +104 -102
  30. data/scss/toolkit/components/notice.scss +24 -23
  31. data/scss/toolkit/components/off-canvas.scss +118 -116
  32. data/scss/toolkit/components/pagination.scss +90 -66
  33. data/scss/toolkit/components/pin.scss +11 -9
  34. data/scss/toolkit/components/popover.scss +50 -48
  35. data/scss/toolkit/components/progress.scss +42 -40
  36. data/scss/toolkit/components/responsive.scss +61 -66
  37. data/scss/toolkit/components/showcase.scss +62 -60
  38. data/scss/toolkit/components/step.scss +51 -44
  39. data/scss/toolkit/components/switch.scss +96 -93
  40. data/scss/toolkit/components/tab.scss +25 -25
  41. data/scss/toolkit/components/table.scss +76 -75
  42. data/scss/toolkit/components/toast.scss +91 -89
  43. data/scss/toolkit/components/tooltip.scss +82 -80
  44. data/scss/toolkit/components/type-ahead.scss +53 -52
  45. data/scss/toolkit/components/typography.scss +45 -43
  46. data/scss/toolkit/mixins/_flex.scss +80 -0
  47. data/scss/toolkit/mixins/_grid.scss +6 -29
  48. data/scss/toolkit/mixins/_helper.scss +33 -4
  49. data/scss/toolkit/mixins/_layout.scss +28 -1
  50. data/version.md +1 -1
  51. metadata +4 -2
@@ -6,42 +6,44 @@
6
6
 
7
7
  @import "../common";
8
8
 
9
- #{$divider-class} {
10
- text-align: center;
11
- overflow: hidden;
9
+ @include export("divider") {
10
+ #{$divider-class} {
11
+ text-align: center;
12
+ overflow: hidden;
12
13
 
13
- &::after,
14
- &::before {
15
- content: "";
16
- display: inline-block;
17
- vertical-align: middle;
18
- position: relative;
19
- width: 100%;
20
- border-top: 1px solid black(.1);
21
- border-bottom: 1px solid white(.75);
22
- }
23
-
24
- &::before {
25
- margin-left: -100%;
26
- left: -$margin;
27
- }
14
+ &::after,
15
+ &::before {
16
+ content: "";
17
+ display: inline-block;
18
+ vertical-align: middle;
19
+ position: relative;
20
+ width: 100%;
21
+ border-top: 1px solid black(.1);
22
+ border-bottom: 1px solid white(.75);
23
+ }
28
24
 
29
- &::after {
30
- margin-right: -100%;
31
- right: -$margin;
32
- }
25
+ &::before {
26
+ margin-#{$align-direction}: -100%;
27
+ #{$align-direction}: -$margin;
28
+ }
33
29
 
34
- // Collapse the middle when there is no content
35
- &:empty {
36
- &::before,
37
30
  &::after {
38
- right: 0;
39
- left: 0;
31
+ margin-#{$align-opposite-direction}: -100%;
32
+ #{$align-opposite-direction}: -$margin;
40
33
  }
41
- }
42
34
 
43
- > span {
44
- display: inline-block;
45
- vertical-align: middle;
35
+ // Collapse the middle when there is no content
36
+ &:empty {
37
+ &::before,
38
+ &::after {
39
+ right: 0;
40
+ left: 0;
41
+ }
42
+ }
43
+
44
+ > span {
45
+ display: inline-block;
46
+ vertical-align: middle;
47
+ }
46
48
  }
47
- }
49
+ }
@@ -6,108 +6,111 @@
6
6
 
7
7
  @import "../common";
8
8
 
9
- #{$drop-class} {
10
- @include reset-list;
11
- text-align: left;
12
- position: absolute;
13
- top: 100%;
14
- left: 0;
15
- width: 200px;
16
- line-height: 100%;
17
- z-index: $drop-zindex;
18
- opacity: 0;
19
- visibility: hidden;
20
- transition: left $drop-transition, opacity $drop-transition, visibility $drop-transition;
21
-
22
- // Nested
9
+ @include export("drop") {
23
10
  #{$drop-class} {
24
- display: block;
25
- top: 0;
26
- left: 90%;
27
- z-index: $drop-zindex + 1;
28
- }
29
-
30
- ul,
31
- ol {
32
11
  @include reset-list;
33
- }
12
+ position: absolute;
13
+ top: 100%;
14
+ left: 0;
15
+ width: 200px;
16
+ line-height: 100%;
17
+ z-index: $drop-zindex;
18
+ opacity: 0;
19
+ visibility: hidden;
20
+ transition: left $drop-transition, right $drop-transition, opacity $drop-transition, visibility $drop-transition;
21
+
22
+ // Nested
23
+ #{$drop-class} {
24
+ display: block;
25
+ top: 0;
26
+ #{$align-direction}: 90%;
27
+ z-index: $drop-zindex + 1;
28
+ }
34
29
 
35
- li {
36
- position: relative;
30
+ ul,
31
+ ol {
32
+ @include reset-list;
33
+ }
37
34
 
38
- > a {
39
- padding: $small-padding;
40
- display: block;
35
+ li {
36
+ position: relative;
41
37
 
42
- .caret-right {
43
- float: right;
44
- display: none;
38
+ > a {
39
+ padding: $small-padding;
40
+ display: block;
41
+
42
+ .caret-right,
43
+ .caret-left {
44
+ float: $align-opposite-direction;
45
+ display: none;
46
+ }
45
47
  }
46
- }
47
48
 
48
- &.has-children {
49
- > a .caret-right { display: inline-block; }
50
- }
49
+ &.has-children {
50
+ > a .caret-right,
51
+ > a .caret-left { display: inline-block; }
52
+ }
51
53
 
52
- // Show nested dropdown
53
- &:hover {
54
- #{$drop-class} {
55
- visibility: visible;
56
- opacity: 1;
57
- left: 100%;
54
+ // Show nested dropdown
55
+ &:hover {
56
+ #{$drop-class} {
57
+ visibility: visible;
58
+ opacity: 1;
59
+ #{$align-direction}: 100%;
60
+ }
58
61
  }
59
62
  }
60
63
  }
61
- }
62
64
 
63
- #{$drop-class-divider} {
64
- margin: ($margin / 2) 0;
65
- border-top: 1px solid $gray-dark;
66
- }
65
+ #{$drop-class-divider} {
66
+ margin: ($margin / 2) 0;
67
+ border-top: 1px solid $gray-dark;
68
+ }
67
69
 
68
- #{$drop-class-heading} {
69
- padding: $small-padding;
70
- }
70
+ #{$drop-class-heading} {
71
+ padding: $small-padding;
72
+ }
71
73
 
72
- //-------------------- Modifiers --------------------//
74
+ //-------------------- Modifiers --------------------//
73
75
 
74
- @if index($drop-modifiers, "up") {
75
- #{$drop-class-modifier-up} {
76
- top: auto;
77
- bottom: 100%;
76
+ @if index($drop-modifiers, "up") {
77
+ #{$drop-class-modifier-up} {
78
+ top: auto;
79
+ bottom: 100%;
80
+ }
78
81
  }
79
- }
80
82
 
81
- @if index($drop-modifiers, "right") {
82
- #{$drop-class-modifier-right} {
83
- top: auto;
84
- left: 100%;
83
+ @if index($drop-modifiers, "right") {
84
+ #{$drop-class-modifier-right} {
85
+ top: auto;
86
+ left: 100%;
87
+ }
85
88
  }
86
- }
87
89
 
88
- @if index($drop-modifiers, "left") {
89
- #{$drop-class-modifier-left} {
90
- top: auto;
91
- left: auto;
92
- right: 100%;
90
+ @if index($drop-modifiers, "left") {
91
+ #{$drop-class-modifier-left} {
92
+ top: auto;
93
+ left: auto;
94
+ right: 100%;
95
+ }
93
96
  }
94
- }
95
97
 
96
- @if index($drop-modifiers, "right") or index($drop-modifiers, "left") {
97
- #{$drop-class-modifier-right},
98
- #{$drop-class-modifier-left} {
99
- &.reverse-align {
100
- bottom: 0;
98
+ @if index($drop-modifiers, "right") or index($drop-modifiers, "left") {
99
+ #{$drop-class-modifier-right},
100
+ #{$drop-class-modifier-left} {
101
+ &.reverse-align {
102
+ bottom: 0;
103
+ }
101
104
  }
102
105
  }
103
- }
104
106
 
105
- @if index($drop-modifiers, "down") or index($drop-modifiers, "up") {
106
- #{$drop-class-modifier-down},
107
- #{$drop-class-modifier-up} {
108
- &.reverse-align {
109
- left: auto;
110
- right: 0;
107
+ @if index($drop-modifiers, "down") or index($drop-modifiers, "up") {
108
+ #{$drop-class-modifier-down},
109
+ #{$drop-class-modifier-up} {
110
+ &.reverse-align {
111
+ left: auto;
112
+ right: 0;
113
+ }
111
114
  }
112
115
  }
113
- }
116
+ }
@@ -0,0 +1,110 @@
1
+ /**
2
+ * @copyright 2010-2015, The Titon Project
3
+ * @license http://opensource.org/licenses/BSD-3-Clause
4
+ * @link http://titon.io
5
+ */
6
+
7
+ @import "../common";
8
+
9
+ @include export("flex") {
10
+ #{$flex-class-region} {
11
+ @include flex-region();
12
+
13
+ // Alignment
14
+ &.flow-top,
15
+ &.flow-left { @include flex-region-align(left); }
16
+ &.flow-bottom,
17
+ &.flow-right { @include flex-region-align(right); }
18
+ &.flow-center { @include flex-region-align(center); }
19
+ &.flow-between { @include flex-region-align(between); }
20
+ &.flow-around { @include flex-region-align(around); }
21
+
22
+ // Support RTL
23
+ @if $text-direction == rtl {
24
+ writing-mode: vertical-rl;
25
+ }
26
+ }
27
+
28
+ #{$flex-class-block} {
29
+ @include flex-block();
30
+ @include flex-block-order();
31
+
32
+ // Override parent alignment
33
+ &.self-top,
34
+ &.self-left { @include flex-block-align(top); }
35
+ &.self-bottom,
36
+ &.self-right { @include flex-block-align(bottom); }
37
+ &.self-center { @include flex-block-align(center); }
38
+ &.self-baseline { @include flex-block-align(baseline); }
39
+ &.self-stretch { @include flex-block-align(stretch); }
40
+
41
+ // Resizing
42
+ &.grow { flex-grow: 1; }
43
+ &.no-grow { flex-grow: 0; }
44
+ &.shrink { flex-shrink: 1; }
45
+ &.no-shrink { flex-shrink: 0; }
46
+ }
47
+
48
+ // Global ordering
49
+ @for $i from 1 through $flex-order-count {
50
+ .order-#{$i} { @include flex-block-order($i); }
51
+ }
52
+
53
+ // Responsive sizes
54
+ @each $size, $options in $flex-sizes {
55
+ $size-columns: nth($options, 1);
56
+
57
+ @include in-range(nth($options, 2)) {
58
+ @for $i from 1 through $size-columns {
59
+ #{$flex-class-block}.#{$size}-#{$i} { flex-basis: flex-span($i, $size-columns); }
60
+ }
61
+
62
+ // Responsive ordering
63
+ @for $i from 1 through $flex-order-count {
64
+ .#{$size}-order-#{$i} { @include flex-block-order($i); }
65
+ }
66
+ }
67
+ }
68
+
69
+ //-------------------- Modifiers --------------------//
70
+
71
+ // Generate a grid of blocks with equal spacing between
72
+ @if index($flex-modifiers, "grid") {
73
+ #{$flex-class-modifier-grid} {
74
+ flex-flow: row wrap;
75
+ justify-content: flex-start;
76
+ align-content: flex-start;
77
+ max-width: none;
78
+
79
+ @if $flex-grid-gutter {
80
+ margin-top: -$flex-grid-gutter;
81
+ margin-left: -$flex-grid-gutter;
82
+ }
83
+
84
+ > #{$flex-class-block} {
85
+ margin-top: $flex-grid-gutter;
86
+ margin-left: $flex-grid-gutter;
87
+ }
88
+ }
89
+ }
90
+
91
+ // Display blocks vertically or horizontally regardless of orientation
92
+ @if index($flex-modifiers, "horizontal") {
93
+ #{$flex-class-modifier-horizontal} {
94
+ @include flex-region-orientation(horizontal);
95
+ }
96
+ }
97
+
98
+ @if index($flex-modifiers, "vertical") {
99
+ #{$flex-class-modifier-vertical} {
100
+ @include flex-region-orientation(vertical);
101
+ }
102
+ }
103
+
104
+ // Wrap blocks onto the next line instead of trying to squish into 1 line
105
+ @if index($flex-modifiers, "wrap") {
106
+ #{$flex-class-modifier-wrap} {
107
+ @include flex-region-wrap();
108
+ }
109
+ }
110
+ }
@@ -6,71 +6,77 @@
6
6
 
7
7
  @import "../common";
8
8
 
9
- #{$flyout-class} {
10
- position: absolute;
11
- top: 0;
12
- left: 0;
13
- z-index: $flyout-zindex;
14
- opacity: 0;
15
- visibility: hidden;
16
- transition: opacity $flyout-transition, visibility $flyout-transition;
9
+ @include export("flyout") {
10
+ #{$flyout-class} {
11
+ position: absolute;
12
+ top: 0;
13
+ #{$align-direction}: 0;
14
+ z-index: $flyout-zindex;
15
+ opacity: 0;
16
+ visibility: hidden;
17
+ transition: opacity $flyout-transition, visibility $flyout-transition;
17
18
 
18
- ul {
19
- @include reset-list;
20
- float: left;
21
- width: 200px;
22
- }
19
+ ul {
20
+ @include reset-list;
21
+ float: $align-direction;
22
+ width: 200px;
23
+ }
23
24
 
24
- li {
25
- position: relative;
25
+ li {
26
+ position: relative;
26
27
 
27
- > a {
28
- padding: $small-padding;
29
- line-height: 100%;
30
- display: block;
31
- text-decoration: none;
28
+ > a {
29
+ padding: $small-padding;
30
+ line-height: 100%;
31
+ display: block;
32
+ text-decoration: none;
32
33
 
33
- .caret-right { display: none; }
34
- }
34
+ .caret-right,
35
+ .caret-left { display: none; }
36
+ }
35
37
 
36
- // Display caret arrow
37
- &.has-children > a .caret-right {
38
- float: right;
39
- display: inline-block; // reveal
40
- margin-top: 3px;
41
- }
38
+ // Display caret arrow
39
+ &.has-children > a {
40
+ .caret-right,
41
+ .caret-left {
42
+ float: $align-opposite-direction;
43
+ display: inline-block; // reveal
44
+ margin-top: 3px;
45
+ }
46
+ }
42
47
 
43
- // Nested flyouts
44
- > #{$flyout-class} {
45
- left: 90%;
46
- transition: left $flyout-transition, right $flyout-transition, opacity $flyout-transition, visibility $flyout-transition;
48
+ // Nested flyouts
49
+ > #{$flyout-class} {
50
+ #{$align-direction}: 90%;
51
+ transition: left $flyout-transition, right $flyout-transition, opacity $flyout-transition, visibility $flyout-transition;
47
52
 
48
- // Reverse menu to left side in case it goes outside the viewport
49
- // Will be set automatically from the Javascript layer
50
- &.push-left {
51
- left: auto;
52
- right: 90%;
53
+ // Reverse menu to left side in case it goes outside the viewport
54
+ // Will be set automatically from the Javascript layer
55
+ &.push-opposite {
56
+ #{$align-direction}: auto;
57
+ #{$align-opposite-direction}: 90%;
58
+ }
53
59
  }
54
- }
55
60
 
56
- &.is-open > #{$flyout-class} {
57
- opacity: 1;
58
- visibility: visible;
59
- left: 100%;
61
+ &.is-open > #{$flyout-class} {
62
+ opacity: 1;
63
+ visibility: visible;
64
+ #{$align-direction}: 100%;
60
65
 
61
- &.push-left {
62
- left: auto;
63
- right: 100%;
66
+ &.push-opposite {
67
+ #{$align-direction}: auto;
68
+ #{$align-opposite-direction}: 100%;
69
+ }
64
70
  }
65
71
  }
72
+
73
+ @include clear-fix;
66
74
  }
67
75
 
68
- @include clear-fix;
76
+ #{$flyout-class-heading} {
77
+ padding: $small-padding;
78
+ line-height: 100%;
79
+ display: block;
80
+ text-decoration: none;
81
+ }
69
82
  }
70
-
71
- #{$flyout-class-heading} {
72
- padding: $small-padding;
73
- line-height: 100%;
74
- display: block;
75
- text-decoration: none;
76
- }