scooter-sass 0.9.1

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 (61) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +9 -0
  3. data/.travis.yml +4 -0
  4. data/Gemfile +4 -0
  5. data/LICENSE.txt +21 -0
  6. data/README.md +46 -0
  7. data/Rakefile +1 -0
  8. data/app/assets/stylesheets/scooter.scss +38 -0
  9. data/app/assets/stylesheets/scooter/base/__all.scss +12 -0
  10. data/app/assets/stylesheets/scooter/base/_base.scss +23 -0
  11. data/app/assets/stylesheets/scooter/base/_reset.scss +55 -0
  12. data/app/assets/stylesheets/scooter/base/_typography.scss +91 -0
  13. data/app/assets/stylesheets/scooter/components/__all.scss +21 -0
  14. data/app/assets/stylesheets/scooter/components/_arrow.scss +25 -0
  15. data/app/assets/stylesheets/scooter/components/_avatar.scss +191 -0
  16. data/app/assets/stylesheets/scooter/components/_badge.scss +46 -0
  17. data/app/assets/stylesheets/scooter/components/_banners.scss +68 -0
  18. data/app/assets/stylesheets/scooter/components/_buttons.scss +152 -0
  19. data/app/assets/stylesheets/scooter/components/_calendar.scss +97 -0
  20. data/app/assets/stylesheets/scooter/components/_cards.scss +146 -0
  21. data/app/assets/stylesheets/scooter/components/_inputs.scss +91 -0
  22. data/app/assets/stylesheets/scooter/components/_loading-indicator.scss +69 -0
  23. data/app/assets/stylesheets/scooter/components/_modal.scss +74 -0
  24. data/app/assets/stylesheets/scooter/components/_tab-nav.scss +70 -0
  25. data/app/assets/stylesheets/scooter/components/_tables.scss +66 -0
  26. data/app/assets/stylesheets/scooter/components/_title-bubble.scss +137 -0
  27. data/app/assets/stylesheets/scooter/components/_tokens.scss +116 -0
  28. data/app/assets/stylesheets/scooter/components/_typeahead.scss +77 -0
  29. data/app/assets/stylesheets/scooter/functions/__all.scss +11 -0
  30. data/app/assets/stylesheets/scooter/functions/_colors.scss +104 -0
  31. data/app/assets/stylesheets/scooter/functions/_maths.scss +21 -0
  32. data/app/assets/stylesheets/scooter/functions/_units.scss +10 -0
  33. data/app/assets/stylesheets/scooter/helpers/__all.scss +13 -0
  34. data/app/assets/stylesheets/scooter/helpers/_accessibility.scss +28 -0
  35. data/app/assets/stylesheets/scooter/helpers/_clearfix.scss +23 -0
  36. data/app/assets/stylesheets/scooter/helpers/_inputs.scss +22 -0
  37. data/app/assets/stylesheets/scooter/helpers/_layout.scss +112 -0
  38. data/app/assets/stylesheets/scooter/helpers/_typography.scss +88 -0
  39. data/app/assets/stylesheets/scooter/mixins/__all.scss +11 -0
  40. data/app/assets/stylesheets/scooter/mixins/_accessibility.scss +22 -0
  41. data/app/assets/stylesheets/scooter/mixins/_arrow.scss +53 -0
  42. data/app/assets/stylesheets/scooter/mixins/_debug.scss +83 -0
  43. data/app/assets/stylesheets/scooter/mixins/_image.scss +15 -0
  44. data/app/assets/stylesheets/scooter/mixins/_properties.scss +16 -0
  45. data/app/assets/stylesheets/scooter/objects/__all.scss +11 -0
  46. data/app/assets/stylesheets/scooter/objects/_flag.scss +88 -0
  47. data/app/assets/stylesheets/scooter/objects/_grid.scss +295 -0
  48. data/app/assets/stylesheets/scooter/objects/_list-ui.scss +23 -0
  49. data/app/assets/stylesheets/scooter/objects/_media.scss +33 -0
  50. data/app/assets/stylesheets/scooter/objects/_wrap.scss +12 -0
  51. data/app/assets/stylesheets/scooter/variables/__all.scss +10 -0
  52. data/app/assets/stylesheets/scooter/variables/_colors.scss +72 -0
  53. data/app/assets/stylesheets/scooter/variables/_config.scss +5 -0
  54. data/app/assets/stylesheets/scooter/variables/_units.scss +8 -0
  55. data/bin/console +14 -0
  56. data/bin/setup +8 -0
  57. data/lib/scooter-sass.rb +52 -0
  58. data/lib/scooter-sass/engine.rb +11 -0
  59. data/lib/scooter-sass/version.rb +5 -0
  60. data/scooter-sass.gemspec +26 -0
  61. metadata +132 -0
@@ -0,0 +1,46 @@
1
+ //---------------------------
2
+ //
3
+ // Badge
4
+ //
5
+ //---------------------------
6
+
7
+ $DBbadge-namespace: "c-badge" !default;
8
+
9
+ $DBbadge-background: color(white) !default;
10
+ $DBbadge-text-color: color(red, medium) !default;
11
+ $DBbadge-border-color: color(red, light) !default;
12
+
13
+ /**
14
+ * Badge component
15
+ */
16
+ .#{$DBbadge-namespace} {
17
+ // Repeat the box-sizing reset here in case this component is used without the reset stylesheet.
18
+ box-sizing: border-box;
19
+
20
+ display: inline-block;
21
+ vertical-align: middle;
22
+ margin: 0;
23
+ padding: 1px 4px;
24
+
25
+ font-size: 9px;
26
+ font-weight: 700;
27
+ line-height: 1.4;
28
+ text-align: center;
29
+ text-shadow: none;
30
+
31
+ color: $DBbadge-text-color;
32
+ background: $DBbadge-background;
33
+
34
+ border: 1px solid $DBbadge-border-color;
35
+ border-radius: 3px;
36
+
37
+ &#{&}--top-right {
38
+ position: absolute;
39
+ z-index: 1;
40
+ top: -1em;
41
+ left: -1em;
42
+
43
+ // Align the left edge relative to the right edge.
44
+ margin-left: 100%;
45
+ }
46
+ }
@@ -0,0 +1,68 @@
1
+ //-----------------------------
2
+ //
3
+ // Banners
4
+ //
5
+ // Example:
6
+ // <div class="c-banner">
7
+ // This is a neutral banner
8
+ // </div>
9
+ //
10
+ // <div class="c-banner c-banner--warning">
11
+ // This is a warning banner
12
+ // </div>
13
+ //
14
+ // <div class="c-banner c-banner--unpinned">
15
+ // This is a free-floating banner
16
+ // </div>
17
+ //
18
+ //-----------------------------
19
+
20
+ $DBbanner-namespace: "c-banner" !default;
21
+
22
+ $DBbanner-background-neutral: color(gray, x-light) !default;
23
+ $DBbanner-background-success: color(green, x-light) !default;
24
+ $DBbanner-background-warning: color(yellow, x-light) !default;
25
+ $DBbanner-background-error: color(red, x-light) !default;
26
+
27
+ $DBbanner-text-neutral: color(gray) !default;
28
+ $DBbanner-text-success: color(green, x-dark) !default;
29
+ $DBbanner-text-warning: color(yellow, x-dark) !default;
30
+ $DBbanner-text-error: color(red, x-dark) !default;
31
+
32
+ /**
33
+ * Banner component. Used to display messages to the user, typically pinned to
34
+ * the top of the page.
35
+ */
36
+ .#{$DBbanner-namespace} {
37
+ padding: 12px;
38
+
39
+ color: $DBbanner-text-neutral;
40
+ border-bottom-width: 1px;
41
+ border-bottom-style: solid;
42
+ border-color: color(gray, x-dark, 0.1);
43
+ background-color: $DBbanner-background-neutral;
44
+
45
+ &#{&}--success {
46
+ color: $DBbanner-text-success;
47
+ background-color: $DBbanner-background-success;
48
+ }
49
+
50
+ &#{&}--warning {
51
+ color: $DBbanner-text-warning;
52
+ background-color: $DBbanner-background-warning;
53
+ }
54
+
55
+ &#{&}--error {
56
+ color: $DBbanner-text-error;
57
+ background-color: $DBbanner-background-error;
58
+ }
59
+
60
+ // The default style for banners assumes that the banner is pinned to the top
61
+ // edge of the page. The unpinned modifier treats the banner as a fixed or
62
+ // relatively-positioned element.
63
+ &#{&}--unpinned {
64
+ border-width: 1px;
65
+ border-style: solid;
66
+ border-radius: 3px;
67
+ }
68
+ }
@@ -0,0 +1,152 @@
1
+ //---------------------------
2
+ //
3
+ // Buttons
4
+ //
5
+ //---------------------------
6
+
7
+ $DBbutton-namespace: "c-btn" !default;
8
+
9
+ $DBbutton-background-primary: linear-gradient(color(blue), color(blue, dark)) !default;
10
+ $DBbutton-background-primary-hover: color(blue) !default;
11
+ $DBbutton-background-primary-active: color(blue, dark) !default;
12
+
13
+ $DBbutton-background-secondary: color(white) !default;
14
+ $DBbutton-background-secondary-hover: linear-gradient(color(white), color(gray, x-light)) !default;
15
+ $DBbutton-background-secondary-active: color(gray, x-light) !default;
16
+
17
+ $DBbutton-background-tertiary: linear-gradient(color(white), color(blue, x-light)) !default;
18
+ $DBbutton-background-tertiary-hover: color(blue, x-light) !default;
19
+ $DBbutton-background-tertiary-active: linear-gradient(color(blue, x-light), lighten(color(blue, light), 5%)) !default;
20
+
21
+
22
+ // Providing fallback colors for IE <= 9
23
+ $DBbutton-background-fallback-primary: color(blue);
24
+ $DBbutton-background-fallback-tertiary: color(white);
25
+
26
+ $DBbutton-text-primary: color(white) !default;
27
+ $DBbutton-text-secondary: color(gray) !default;
28
+ $DBbutton-text-tertiary: color(blue) !default;
29
+
30
+ $DBbutton-border-primary: color(blue, dark) !default;
31
+ $DBbutton-border-secondary: color(gray, light) !default;
32
+ $DBbutton-border-tertiary: color(blue) !default;
33
+
34
+ /**
35
+ * Button component
36
+ */
37
+ .#{$DBbutton-namespace} {
38
+ // Ensure the element is actually a button
39
+ @include assert-selector(button, "[type=submit]");
40
+
41
+ display: inline-block;
42
+ padding: 7px 12px;
43
+
44
+ font-weight: 600;
45
+ line-height: 1.4;
46
+ text-align: center;
47
+ text-decoration: none;
48
+
49
+ border: 1px solid currentColor;
50
+ border-radius: 3px;
51
+
52
+ cursor: pointer;
53
+
54
+ &[disabled], &#{&}--disabled {
55
+ opacity: 0.5;
56
+
57
+ cursor: default;
58
+ }
59
+
60
+ &:focus {
61
+ box-shadow: 0 0 0 2px color(blue, 0.3);
62
+ outline: none;
63
+ }
64
+
65
+ &:hover {
66
+ text-decoration: none;
67
+ }
68
+
69
+ &#{&}--big {
70
+ padding: 10px 26px;
71
+ }
72
+
73
+ &#{&}--full {
74
+ display: block;
75
+ width: 100%;
76
+ }
77
+
78
+ &#{&}--primary {
79
+ color: $DBbutton-text-primary;
80
+ border-color: $DBbutton-border-primary;
81
+ background-color: $DBbutton-background-fallback-primary;
82
+ background: $DBbutton-background-primary;
83
+
84
+ &:hover:not(:disabled) {
85
+ background: $DBbutton-background-primary-hover;
86
+ }
87
+
88
+ &:active:not(:disabled) {
89
+ background:$DBbutton-background-primary-active;
90
+ }
91
+ }
92
+
93
+ &#{&}--secondary {
94
+ color: $DBbutton-text-secondary;
95
+ border-color: $DBbutton-border-secondary;
96
+ background: $DBbutton-background-secondary;
97
+
98
+ &:hover:not(:disabled) {
99
+ background: $DBbutton-background-secondary-hover;
100
+ }
101
+
102
+ &:active:not(:disabled) {
103
+ background:$DBbutton-background-secondary-active;
104
+ }
105
+ }
106
+
107
+ &#{&}--tertiary {
108
+ color: $DBbutton-text-tertiary;
109
+ border-color: $DBbutton-border-tertiary;
110
+ background-color: $DBbutton-background-fallback-tertiary;
111
+ background: $DBbutton-background-tertiary;
112
+
113
+ &:hover:not(:disabled) {
114
+ background: $DBbutton-background-tertiary-hover;
115
+ }
116
+
117
+ &:active:not(:disabled) {
118
+ background:$DBbutton-background-tertiary-active;
119
+ }
120
+ }
121
+ }
122
+
123
+ .#{$DBbutton-namespace}-group {
124
+ display: flex;
125
+
126
+ .#{$DBbutton-namespace} {
127
+ margin: 0;
128
+ border-radius: 0;
129
+
130
+ + .#{$DBbutton-namespace} {
131
+ border-left: 0;
132
+ }
133
+
134
+ &:first-child {
135
+ border-top-left-radius: 3px;
136
+ border-bottom-left-radius: 3px;
137
+ }
138
+
139
+ &:last-child {
140
+ border-top-right-radius: 3px;
141
+ border-bottom-right-radius: 3px;
142
+ }
143
+ }
144
+
145
+ &--justify {
146
+ width: 100%;
147
+
148
+ .#{$DBbutton-namespace} {
149
+ flex: 1 0 auto;
150
+ }
151
+ }
152
+ }
@@ -0,0 +1,97 @@
1
+ //-----------------------------
2
+ //
3
+ // Component: Calendar
4
+ //
5
+ //-----------------------------
6
+
7
+ $DBcalendar-namespace: "c-calendar";
8
+ $DBdatepicker-namespace: "c-datepicker";
9
+
10
+ .#{$DBdatepicker-namespace} {
11
+ position: relative;
12
+ box-sizing: border-box;
13
+
14
+ background-color: color(white);
15
+
16
+ .#{$DBcalendar-namespace} {
17
+ position: absolute;
18
+ top: 100%;
19
+ left: 0;
20
+ }
21
+ }
22
+
23
+ .#{$DBcalendar-namespace} {
24
+ display: inline-block;
25
+ z-index: 1;
26
+
27
+ border-radius: 5px;
28
+ background-color: color(gray, x-light);
29
+
30
+ .#{$DBcalendar-namespace}__header {
31
+ padding-bottom: 4px;
32
+
33
+ font-size: 0.6em;
34
+ letter-spacing: 0.05em;
35
+ text-transform: uppercase;
36
+
37
+ color: color(gray, medium);
38
+ }
39
+
40
+ .#{$DBcalendar-namespace}__date {
41
+ box-sizing: border-box;
42
+ padding: 4px 8px;
43
+ // This assumes that the `date` element is a child nested inside a `td`
44
+ width: 100%;
45
+ min-width: 32px;
46
+
47
+ text-align: center;
48
+
49
+ color: color(blue);
50
+ border: 1px solid color(gray, x-light);
51
+ background-color: color(white);
52
+
53
+ cursor: pointer;
54
+ appearance: none;
55
+
56
+ tr:first-child td:first-child & {
57
+ border-top-left-radius: 4px;
58
+ }
59
+
60
+ tr:first-child td:last-child & {
61
+ border-top-right-radius: 4px;
62
+ }
63
+
64
+ tr:last-child td:first-child & {
65
+ border-bottom-left-radius: 4px;
66
+ }
67
+
68
+ tr:last-child td:last-child & {
69
+ border-bottom-right-radius: 4px;
70
+ }
71
+
72
+ &:hover {
73
+ background-color: color(blue, x-light);
74
+ }
75
+
76
+ &:hover, &:focus:not([class*="--disabled"]) {
77
+ text-decoration: underline;
78
+ }
79
+
80
+ &.is-selected {
81
+ color: color(white);
82
+ background-color: color(blue);
83
+ }
84
+
85
+ &.is-in-range {
86
+ color: color(white);
87
+ background-color: color(blue, medium);
88
+ }
89
+
90
+ &--disabled, &--disabled:hover {
91
+ color: color(gray, light);
92
+ background-color: color(gray, x-light);
93
+
94
+ cursor: default;
95
+ }
96
+ }
97
+ }
@@ -0,0 +1,146 @@
1
+ // scss-lint:disable NestingDepth
2
+ //
3
+ //-----------------------------
4
+ //
5
+ // Cards
6
+ //
7
+ // Simple styling for a card-like component used in a variety of ways with
8
+ // optional arrows for tooltip-like cards
9
+ //
10
+ //-----------------------------
11
+
12
+ $DBcard-namespace: "c-card" !default;
13
+
14
+ $DBcard-background: color(white) !default;
15
+
16
+ // The opaque color for the card border/shadow. Transparency is handled by
17
+ // the class itself.
18
+ $DBcard-border: color(gray, x-dark) !default;
19
+ $DBcard-border-selected: color(blue) !default;
20
+
21
+ /**
22
+ * Card component with optional arrow/tail
23
+ */
24
+ .#{$DBcard-namespace} {
25
+ display: inline-block;
26
+ vertical-align: top;
27
+ position: relative;
28
+ padding: 12px;
29
+ box-sizing: border-box;
30
+
31
+ border: 1px solid rgba($DBcard-border, 0.1);
32
+ border-radius: 3px;
33
+ box-shadow: 0 1px 2px rgba($DBcard-border, 0.1);
34
+ background-color: $DBcard-background;
35
+ background-clip: padding-box;
36
+ transition: 0.1s;
37
+
38
+ &#{&}--arrow {
39
+ &::before, &::after {
40
+ content: "";
41
+ position: absolute;
42
+ bottom: 100%;
43
+ left: 50%;
44
+ margin-left: -8px;
45
+
46
+ border: 8px solid transparent;
47
+ border-bottom-color: color(white);
48
+ transition: 0.1s;
49
+ }
50
+
51
+ &::before {
52
+ margin-left: -9px;
53
+
54
+ border-width: 9px;
55
+ border-bottom-color: rgba($DBcard-border, 0.2);
56
+ }
57
+
58
+
59
+
60
+ // West/East directions are only affecting horizontal offsets, so we can
61
+ // style North and South at the same time
62
+ &-nw, &-sw {
63
+ &::after, &::before {
64
+ left: 0;
65
+ margin-left: 12px;
66
+ }
67
+
68
+ &::before {
69
+ margin-left: 11px;
70
+ }
71
+ }
72
+
73
+ &-ne, &-se {
74
+ &::after, &::before {
75
+ right: 0;
76
+ left: auto;
77
+ margin-right: 12px;
78
+ }
79
+
80
+ &::before {
81
+ margin-right: 11px;
82
+ }
83
+ }
84
+
85
+ // South direction changes a lot of styles, and it's probably safe to
86
+ // assume North is the desired default.
87
+ &-sw, &-se, &-s {
88
+ &::after, &::before {
89
+ top: 100%;
90
+ bottom: auto;
91
+
92
+ border-top-color: color(white);
93
+ border-bottom-color: transparent;
94
+ }
95
+
96
+ &::before {
97
+ border-top-color: rgba($DBcard-border, 0.2);
98
+ // Since we're spoofing a triangle with borders, we can't use
99
+ // box-shadow, but we can use the drop-shadow filter. Limited support,
100
+ // but it's just a nice-to-have.
101
+ filter: drop-shadow(0 1px 2px rgba($DBcard-border, 0.2));
102
+ }
103
+ }
104
+ }
105
+ }
106
+
107
+ // Floating cards have a hover state and selected states
108
+ .#{$DBcard-namespace}--floating {
109
+ &:hover {
110
+ border-color: rgba($DBcard-border, 0.2);
111
+ box-shadow: 0 1px 2px rgba($DBcard-border, 0.2);
112
+ }
113
+
114
+ &.#{$DBcard-namespace}--arrow {
115
+ &:hover::before {
116
+ border-bottom-color: rgba($DBcard-border, 0.3);
117
+ }
118
+
119
+ &-se, &-sw, &-s {
120
+ &:hover::before {
121
+ border-top-color: rgba($DBcard-border, 0.3);
122
+ border-bottom-color: transparent;
123
+ filter: drop-shadow(0 1px 2px rgba($DBcard-border, 0.3));
124
+ }
125
+ }
126
+ }
127
+
128
+ &.is-selected {
129
+ border-color: $DBcard-border-selected;
130
+ }
131
+
132
+ &--arrow.is-selected {
133
+ &::before, &:hover::before {
134
+ border-bottom-color: $DBcard-border-selected;
135
+ }
136
+ }
137
+
138
+ &--arrow-se, &--arrow-sw, &--arrow-s {
139
+ &.is-selected {
140
+ &::before, &:hover::before {
141
+ border-top-color: $DBcard-border-selected;
142
+ border-bottom-color: transparent;
143
+ }
144
+ }
145
+ }
146
+ }