scooter-sass 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
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,116 @@
1
+ //-----------------------------
2
+ //
3
+ // Tokens
4
+ // ======
5
+ //
6
+ // Usage:
7
+ //
8
+ // <div class="c-token [modifier]">
9
+ // [avatar/icon]
10
+ // <span class="c-token__name">{{Name/email}}</span>
11
+ // <i class="c-token__delete">&times;</i>
12
+ // </div>
13
+ //
14
+ //-----------------------------
15
+
16
+ $DBtoken-namespace: "c-token" !default;
17
+
18
+ $DBtoken-background-neutral: color(gray, x-light) !default;
19
+ $DBtoken-background-warning: color(yellow, x-light) !default;
20
+ $DBtoken-background-error: color(red, x-light) !default;
21
+
22
+ $DBtoken-background-neutral-selected: color(gray, medium) !default;
23
+ $DBtoken-background-warning-selected: color(yellow, dark) !default;
24
+ $DBtoken-background-error-selected: color(red, dark) !default;
25
+
26
+ $DBtoken-text-neutral: color(gray) !default;
27
+ $DBtoken-text-warning: color(yellow, x-dark) !default;
28
+ $DBtoken-text-error: color(red, x-dark) !default;
29
+
30
+ /*!
31
+ * Token components
32
+ */
33
+ .#{$DBtoken-namespace} {
34
+ display: inline-block;
35
+ // We want tokens to always remain on one line
36
+ white-space: nowrap;
37
+ padding: 4px;
38
+
39
+ line-height: 1;
40
+
41
+ color: $DBtoken-text-neutral;
42
+ border-radius: 3px;
43
+ box-shadow: inset 0 0 0 1px color(gray, x-dark, 0.1);
44
+ background-color: $DBtoken-background-neutral;
45
+
46
+ cursor: default;
47
+
48
+ &:hover {
49
+ box-shadow: inset 0 0 0 1px color(gray, x-dark, 0.3);
50
+ }
51
+
52
+ > * {
53
+ vertical-align: middle;
54
+ margin-left: 0.25em;
55
+
56
+ &:first-child {
57
+ margin-left: 0;
58
+ }
59
+ }
60
+ }
61
+
62
+ // Warning state
63
+ // (Out-of-org, non-blocking)
64
+ .#{$DBtoken-namespace}--warning {
65
+ color: $DBtoken-text-warning;
66
+ background-color: $DBtoken-background-warning;
67
+ }
68
+
69
+ // Invalid state
70
+ // (Out-of-org, suspended)
71
+ .#{$DBtoken-namespace}--invalid {
72
+ color: $DBtoken-text-error;
73
+ background-color: $DBtoken-background-error;
74
+ }
75
+
76
+ // Pending state
77
+ // Transient state while actual state is determined
78
+ .#{$DBtoken-namespace}--pending {
79
+ opacity: 0.5;
80
+ }
81
+
82
+ // Selected state
83
+ .#{$DBtoken-namespace}.is-selected, .#{$DBtoken-namespace}.is-selected:hover {
84
+ color: color(white);
85
+ background-color: $DBtoken-background-neutral-selected;
86
+
87
+ &.#{$DBtoken-namespace}--warning {
88
+ background-color: $DBtoken-background-warning-selected;
89
+ }
90
+
91
+ &.#{$DBtoken-namespace}--invalid {
92
+ background-color: $DBtoken-background-error-selected;
93
+ }
94
+ }
95
+
96
+
97
+ // User name or email
98
+ .#{$DBtoken-namespace}__name {
99
+ // Open Sans' line-height needs some manual correction
100
+ top: 1px;
101
+ margin-left: 0.25em;
102
+ }
103
+
104
+ // Delete token glyph
105
+ .#{$DBtoken-namespace}__delete {
106
+ margin-right: 0.15em;
107
+ margin-left: 0.25em;
108
+
109
+ font-size: 1.25em;
110
+
111
+ color: currentColor;
112
+ opacity: 0.7;
113
+
114
+ cursor: pointer;
115
+ }
116
+
@@ -0,0 +1,77 @@
1
+ //-----------------------------
2
+ //
3
+ // Typeahead
4
+ //
5
+ //-----------------------------
6
+
7
+ $DBtypeahead-namespace: "c-typeahead" !default;
8
+
9
+ $DBtypeahead-background: color(white) !default;
10
+
11
+ .#{$DBinput-namespace}--typeahead {
12
+ &.is-active {
13
+ border-bottom: 0;
14
+ border-bottom-left-radius: 0;
15
+ border-bottom-right-radius: 0;
16
+ }
17
+ }
18
+
19
+ /*!
20
+ * Typeahead component
21
+ */
22
+ .#{$DBtypeahead-namespace} {
23
+ display: none;
24
+ overflow: scroll;
25
+ position: absolute;
26
+ top: 100%;
27
+ right: 0;
28
+ left: 0;
29
+ max-height: 180px;
30
+ margin-top: -1px;
31
+
32
+ line-height: 1.5;
33
+
34
+ border: 1px solid color(gray, x-dark, 0.1);
35
+ border-radius: 0 0 4px 4px;
36
+ box-shadow: 0 1px 2px color(gray, x-dark, 0.1);
37
+ background-color: $DBtypeahead-background;
38
+
39
+ background-clip: padding-box;
40
+
41
+ &.is-open {
42
+ display: block;
43
+ }
44
+
45
+ &__result {
46
+ margin-top: -1px;
47
+
48
+ cursor: pointer;
49
+
50
+ &.is-selected {
51
+ z-index: 2;
52
+ margin-bottom: -2px;
53
+
54
+ color: color(blue);
55
+ border-bottom: 1px solid;
56
+ border-color: color(gray, x-dark, 0.1);
57
+ background-color: color(blue, x-light);
58
+
59
+ .f-meta {
60
+ color: inherit;
61
+ }
62
+ }
63
+
64
+ &.is-invalid {
65
+ cursor: default;
66
+ }
67
+ }
68
+
69
+ &__media, &__content {
70
+ display: inline-block;
71
+ vertical-align: middle;
72
+ }
73
+
74
+ &__media {
75
+ margin-right: half($DBbaseline);
76
+ }
77
+ }
@@ -0,0 +1,11 @@
1
+ //---------------------------
2
+ //
3
+ // Functions
4
+ //
5
+ // Just a few helpful functions
6
+ //
7
+ //---------------------------
8
+
9
+ @import "maths";
10
+ @import "colors";
11
+ @import "units";
@@ -0,0 +1,104 @@
1
+ //---------------------------
2
+ //
3
+ // Color functions
4
+ //
5
+ //---------------------------
6
+
7
+ //---------------------------
8
+ //
9
+ // Defining acceptable alpha & shade values for color functions
10
+ //
11
+ //---------------------------
12
+ $__alpha-stops: (0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1);
13
+ $__shade-vals: ("x-dark", "dark", "base", "medium", "light", "x-light");
14
+
15
+ //---------------------------
16
+ //
17
+ // The grayscale function takes two arguments:
18
+ // REQUIRED: Level of gray
19
+ // There are 10 levels of gray, ranging from 1 to 10 (darkest to lightest).
20
+ // OPTIONAL: Level of opacity
21
+ // There are 11 levels of opacity, ranging from 0.0 to 1.0 (transparent to opaque).
22
+ //
23
+ // Example: grayscale(1, 1);
24
+ // This will create a dark gray that is fully opaque.
25
+ //
26
+ //---------------------------
27
+ @function grayscale($gradation, $alpha: 1) {
28
+ @if map-has-key($DBgrayscaleColors, $gradation) {
29
+ $alpha-val: $alpha;
30
+
31
+ @if index($__alpha-stops, $alpha-val) == null {
32
+ @error "Only alpha values in 0.1 increments are allowed";
33
+ }
34
+
35
+ $grayscale-val: map-get($DBgrayscaleColors, $gradation);
36
+ @return rgba($grayscale-val, $alpha-val);
37
+ } @else {
38
+ @warn "No gradation of #{$gradation} found in $DBgrayscaleColors map.";
39
+ }
40
+ }
41
+
42
+ //---------------------------
43
+ //
44
+ // The color function takes three arguments:
45
+ // REQUIRED: Color
46
+ // There are 7 colors (gray, blue, green, red, yellow, black, white).
47
+ // OPTIONAL: Shade
48
+ // Each color has 6 shades (x-dark, dark, base, medium, light, x-light).
49
+ // OPTIONAL: Opacity
50
+ // Each shade has 11 levels of opacity, ranging from 0.0 to 1.0 (transparent to opaque).
51
+ //
52
+ // Example: color(blue);
53
+ // This will create a base blue that is fully opaque.
54
+ //
55
+ // Example 2: color(red, dark, 0.8);
56
+ // This will create a dark red that is 80% opaque.
57
+ //
58
+ // Example 3: color(yellow, 0.6);
59
+ // This will create a base yellow that is 60% opaque.
60
+ //
61
+ //---------------------------
62
+ @function color($name, $properties...) {
63
+ $n: length($properties);
64
+ $i: 1;
65
+
66
+ $shade-val: "base";
67
+ $alpha-val: 1;
68
+
69
+ @while $i <= $n {
70
+ $current-property: (nth($properties, $i));
71
+
72
+ @if type-of($current-property) == "string" {
73
+ $shade-val: $current-property;
74
+ } @else if type-of($current-property) == "number" {
75
+ $alpha-val: $current-property;
76
+ }
77
+
78
+ $i: $i + 1;
79
+ }
80
+
81
+ @if index($__shade-vals, $shade-val) == null {
82
+ @warn "Only the following shades are allowed: " + $__shade-vals;
83
+ }
84
+
85
+ @if index($__alpha-stops, $alpha-val) == null {
86
+ @error "Only alpha values in 0.1 increments are allowed";
87
+ }
88
+
89
+ @if map-has-key($DBglobalColors, $name) {
90
+ $rgb-val: ();
91
+
92
+ @if $name == white or $name == black {
93
+ $rgb-val: map-get($DBglobalColors, $name);
94
+ } @else {
95
+ $rgb-val: map-get(map-get($DBglobalColors, $name), $shade-val);
96
+ }
97
+
98
+ @return rgba($rgb-val, $alpha-val);
99
+ } @else {
100
+ @warn "No global color called #{$name} found."
101
+ + "Are you sure it's in `variables/colors?`";
102
+ }
103
+ }
104
+
@@ -0,0 +1,21 @@
1
+ //---------------------------
2
+ //
3
+ // Mathematical functions
4
+ //
5
+ //---------------------------
6
+
7
+ @function half($n) {
8
+ @return round($n / 2);
9
+ }
10
+
11
+ @function quarter($n) {
12
+ @return round($n / 4);
13
+ }
14
+
15
+ @function double($n) {
16
+ @return round($n * 2);
17
+ }
18
+
19
+ @function quadruple($n) {
20
+ @return round($n * 4);
21
+ }
@@ -0,0 +1,10 @@
1
+ //-----------------------------
2
+ //
3
+ // Units function
4
+ //
5
+ //-----------------------------
6
+
7
+ // Strip units from passed value
8
+ @function stripUnit($n) {
9
+ @return $n / ($n*0+1);
10
+ }
@@ -0,0 +1,13 @@
1
+ //---------------------------
2
+ //
3
+ // Helpers
4
+ //
5
+ // Classes and placeholders for common layout patterns, etc.
6
+ //
7
+ //---------------------------
8
+
9
+ @import "accessibility";
10
+ @import "clearfix";
11
+ @import "inputs";
12
+ @import "layout";
13
+ @import "typography";
@@ -0,0 +1,28 @@
1
+ //---------------------------
2
+ //
3
+ // Accessibility Helpers
4
+ //
5
+ //---------------------------
6
+
7
+ // Visually hide elements, leaving them accessible to screen readers
8
+ .ax-visually-hidden {
9
+ position: absolute !important;
10
+ border: 0 !important;
11
+ clip: rect(0, 0, 0, 0) !important;
12
+ width: 1px !important;
13
+ height: 1px !important;
14
+ margin: -1px !important;
15
+ padding: 0 !important;
16
+ overflow: hidden !important;
17
+ }
18
+
19
+ // Give focusable elements a distinct outline
20
+ .ax-focusable:focus, .ax-focusable.is-focused {
21
+ box-shadow: 0 0 0 2px color(blue, medium, 0.7);
22
+ outline: none;
23
+ }
24
+
25
+ // Alternative highlight for focusable elements
26
+ .ax-focusable-inline:focus, .ax-focusable-inline.is-focused {
27
+ text-decoration: underline;
28
+ }
@@ -0,0 +1,23 @@
1
+ //-----------------------------
2
+ //
3
+ // Clearfix
4
+ // ========
5
+ //
6
+ // The micro clearfix: http://cssmojo.com/latest_new_clearfix_so_far/
7
+ //
8
+ // Use @extend to avoid having the .clearfix class appear over and over again in
9
+ // markup
10
+ //
11
+ //-----------------------------
12
+
13
+ .clearfix,
14
+ %clearfix {
15
+
16
+ &:after {
17
+ content: "";
18
+ display: table;
19
+ clear: both;
20
+ }
21
+
22
+ }
23
+
@@ -0,0 +1,22 @@
1
+ //---------------------------
2
+ //
3
+ // Input Helpers
4
+ //
5
+ //---------------------------
6
+
7
+ // Remove default styles for buttons
8
+ .u-unbutton {
9
+ padding: 0;
10
+
11
+ background: none;
12
+ border: 0;
13
+
14
+ &:focus {
15
+ box-shadow: 0 0 0 2px color(blue, light);
16
+ }
17
+
18
+ &::-moz-focus-inner {
19
+ border: 0;
20
+ padding: 0;
21
+ }
22
+ }
@@ -0,0 +1,112 @@
1
+ // scss-lint:disable ImportantRule
2
+ //
3
+ //---------------------------
4
+ //
5
+ // Layout Helpers
6
+ //
7
+ //---------------------------
8
+
9
+ $DBspacing-unit: 16px !default;
10
+
11
+ $DBspacing-sizes: (
12
+ 'xxs': .25,
13
+ 'xs': .5,
14
+ 's': 1,
15
+ 'm': 1.5,
16
+ 'l': 2,
17
+ 'xl': 4,
18
+ 'xxl': 6,
19
+ 'jumbo': 8
20
+ );
21
+
22
+ $DBspacing-edges: (
23
+ 'top',
24
+ 'right',
25
+ 'bottom',
26
+ 'left',
27
+ 'vertical' ('top' 'bottom'),
28
+ 'horizontal' ('left' 'right')
29
+ );
30
+
31
+ .u-trim-margin {
32
+ margin: 0 !important;
33
+ }
34
+
35
+ .u-trim-padding {
36
+ padding: 0 !important;
37
+ }
38
+
39
+ @each $size, $scale in $DBspacing-sizes {
40
+
41
+ .u-pad-#{$size} {
42
+ padding: round($DBspacing-unit * $scale) !important;
43
+ }
44
+
45
+ .u-mar-#{$size} {
46
+ margin: round($DBspacing-unit * $scale) !important;
47
+ }
48
+
49
+ @each $edge, $sub in $DBspacing-edges {
50
+ // Padding
51
+ .u-pad-#{$edge}-#{$size} {
52
+ @if $sub {
53
+ @each $subedge in $sub {
54
+ padding-#{$subedge}: round($DBspacing-unit * $scale) !important;
55
+ }
56
+ } @else {
57
+ padding-#{$edge}: round($DBspacing-unit * $scale) !important;
58
+ }
59
+ }
60
+
61
+ // Margins
62
+ .u-mar-#{$edge}-#{$size} {
63
+ @if $sub {
64
+ @each $subedge in $sub {
65
+ margin-#{$subedge}: round($DBspacing-unit * $scale) !important;
66
+ }
67
+ } @else {
68
+ margin-#{$edge}: round($DBspacing-unit * $scale) !important;
69
+ }
70
+ }
71
+ }
72
+ }
73
+
74
+ // Floats
75
+ // ======
76
+ //
77
+ .u-l-fl,
78
+ %u-l-fl {
79
+ float: left !important;
80
+ }
81
+
82
+ .u-l-fr,
83
+ %u-l-fr {
84
+ float: right !important;
85
+ }
86
+
87
+ // Display types
88
+ // =============
89
+ //
90
+ .u-l-b {
91
+ display: block !important;
92
+ }
93
+
94
+ .u-l-ib {
95
+ display: inline-block !important;
96
+
97
+ &--m {
98
+ vertical-align: middle !important;
99
+ }
100
+
101
+ &--t {
102
+ vertical-align: top !important;
103
+ }
104
+
105
+ &--b {
106
+ vertical-align: bottom !important;
107
+ }
108
+ }
109
+
110
+ .u-l-dn {
111
+ display: none !important;
112
+ }