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,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 3c187e561d182ee776676e3ec386fdbfa3b35a7b
4
+ data.tar.gz: 3437784019c5356aa6f73096e8720ddceb256a94
5
+ SHA512:
6
+ metadata.gz: 488eb68ebfa87d2732752a54d4b82959612b579d8d7aad522f03bdda1748cc7c8652a078e53db8e2d329284d800259b85c24d82c20a354c44491f79d026f8d71
7
+ data.tar.gz: 24fc6af419c3954aab27d63b835d8afefcee59cd6b1780f1cb430e13937e5115664347eeae020d26d9588c680f73472c25a586b54ac38fed7a63b9e592d8f584
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.4.0
4
+ before_install: gem install bundler -v 1.11.2
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in scooter-sass.gemspec
4
+ gemspec
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 sanata-
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,46 @@
1
+ # Scooter version for Rails 4, 3.x Asset Pipeline
2
+ An SCSS framework & UI library for [Dropbox](https://github.com/dropbox/scooter).
3
+ Built to provide base styles, CSS components, and rapid static prototyping.
4
+
5
+ ## Installation
6
+
7
+ In your Gemfile you need to add the scooter-sass gem:
8
+
9
+ ```ruby
10
+ gem 'scooter-sass'
11
+ ```
12
+
13
+ And then run the bundler and restart your server to make the files available through the pipeline:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install scooter-sass
20
+
21
+ ## Usage
22
+ ### a. Sass
23
+
24
+ Import Scooter styles in `app/assets/stylesheets/application.scss`:
25
+
26
+ ```scss
27
+ @import "scooter";
28
+ ```
29
+
30
+ **NOTE:** If you have just generated a new Rails application, it may come with a `.css` file instead. If this file exists, it will be served instead of Sass, so remove it.
31
+
32
+ ```console
33
+ $ rm app/assets/stylesheets/application.css
34
+ ```
35
+
36
+
37
+
38
+
39
+
40
+ ## Contributing
41
+
42
+ 1. Fork it ( https://github.com/sanata-/scooter-sass/fork )
43
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
44
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
45
+ 4. Push to the branch (`git push origin my-new-feature`)
46
+ 5. Create a new Pull Request
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,38 @@
1
+ // scss-lint:disable ImportPath
2
+ //
3
+ /*!
4
+ *
5
+ * SCOOTER
6
+ *
7
+ * ---
8
+ * /
9
+ * /______
10
+ * 0 0
11
+ *
12
+ * scoot
13
+ * verb [no obj.]
14
+ * go or leave somewhere quickly: "I'd better scoot"
15
+ *
16
+ */
17
+
18
+
19
+ // Variables
20
+ @import "scooter/variables/_all";
21
+
22
+ // Functions
23
+ @import "scooter/functions/_all";
24
+
25
+ // Mixins
26
+ @import "scooter/mixins/_all";
27
+
28
+ // Base styles
29
+ @import "scooter/base/_all";
30
+
31
+ // Objects
32
+ @import "scooter/objects/_all";
33
+
34
+ // Components
35
+ @import "scooter/components/_all";
36
+
37
+ // Helpers
38
+ @import "scooter/helpers/_all";
@@ -0,0 +1,12 @@
1
+ //---------------------------
2
+ //
3
+ // Base styles
4
+ //
5
+ // Reset, normalisation, and raw tag styles for Dropbox web. Outside of these
6
+ // files, all CSS selectors should be class names.
7
+ //
8
+ //---------------------------
9
+
10
+ @import "reset";
11
+ @import "base";
12
+ @import "typography";
@@ -0,0 +1,23 @@
1
+ //---------------------------
2
+ //
3
+ // Base/root styles
4
+ //
5
+ //---------------------------
6
+
7
+ @if ($DBscope-scooter-reset == true) {
8
+ html.scooter-css, .scooter-css:root {
9
+ box-sizing: border-box;
10
+
11
+ font: 81.25%/1.75 "Open Sans", "Helvetica Neue", Arial, sans-serif;
12
+
13
+ color: color(gray, dark);
14
+ }
15
+ } @else {
16
+ html, :root {
17
+ box-sizing: border-box;
18
+
19
+ font: 81.25%/1.75 "Open Sans", "Helvetica Neue", Arial, sans-serif;
20
+
21
+ color: color(gray, dark);
22
+ }
23
+ }
@@ -0,0 +1,55 @@
1
+ //---------------------------
2
+ //
3
+ // Reset
4
+ //
5
+ //---------------------------
6
+
7
+ $DBscope-scooter-reset: false !default;
8
+
9
+ @mixin scooter-reset {
10
+ *, ::after, ::before {
11
+ position: relative;
12
+ margin: 0;
13
+ padding: 0;
14
+ box-sizing: inherit;
15
+ }
16
+
17
+ input, button, textarea, select {
18
+ font: inherit;
19
+
20
+ appearance: none;
21
+ }
22
+
23
+ input[type=checkbox] {
24
+ -webkit-appearance: checkbox;
25
+ -moz-appearance: checkbox;
26
+ appearance: checkbox;
27
+ }
28
+
29
+ input[type=radio] {
30
+ -webkit-appearance: radio;
31
+ -moz-appearance: radio;
32
+ appearance: radio;
33
+ }
34
+
35
+ ul, ol {
36
+ margin-left: double($DBbaseline);
37
+ }
38
+
39
+ p, table {
40
+ margin-bottom: $DBbaseline;
41
+ }
42
+
43
+ table {
44
+ border-collapse: collapse;
45
+ }
46
+ }
47
+
48
+ @if ($DBscope-scooter-reset == true) {
49
+ .scooter-css {
50
+ @include scooter-reset;
51
+ }
52
+ } @else {
53
+ @include scooter-reset;
54
+ }
55
+
@@ -0,0 +1,91 @@
1
+ //---------------------------
2
+ //
3
+ // Typography
4
+ // ==========
5
+ //
6
+ //---------------------------
7
+
8
+ @mixin scooter-type() {
9
+ // Headings
10
+ // ========
11
+ //
12
+ // Only h1-h4 are used/styled. If your DOM heirarchy goes as deep at h5 or h6,
13
+ // you have some rethinking to do.
14
+ //
15
+ h1,
16
+ %f-alpha,
17
+ .f-alpha {
18
+ display: block;
19
+ margin-bottom: $DBbaseline;
20
+
21
+ font-size: 28px;
22
+ font-weight: 200;
23
+ line-height: 36px;
24
+ }
25
+
26
+ h2,
27
+ %f-beta,
28
+ .f-beta {
29
+ display: block;
30
+ margin-bottom: $DBbaseline;
31
+
32
+ font-size: 20px;
33
+ font-weight: 400;
34
+ line-height: 28px;
35
+ }
36
+
37
+ h3,
38
+ %f-gamma,
39
+ .f-gamma {
40
+ display: block;
41
+ margin-bottom: $DBbaseline;
42
+
43
+ font-size: 16px;
44
+ font-weight: 400;
45
+ line-height: 28px;
46
+ }
47
+
48
+ h4,
49
+ %f-delta,
50
+ .f-delta {
51
+ display: block;
52
+
53
+ font-size: 13px;
54
+ font-weight: 600;
55
+ line-height: $DBbaseline;
56
+ }
57
+
58
+ // Other type styles
59
+ // =================
60
+ //
61
+ hr,
62
+ %hr{
63
+ margin-bottom: $DBbaseline;
64
+
65
+ border: 0;
66
+ border-top: 1px solid color(gray, x-dark, 0.1);
67
+ }
68
+
69
+ a,
70
+ %f-a,
71
+ .f-a {
72
+ text-decoration: none;
73
+
74
+ color: color(blue);
75
+
76
+ cursor: pointer;
77
+
78
+ &:hover {
79
+ text-decoration: underline;
80
+ }
81
+ }
82
+ }
83
+
84
+ @if ($DBscope-scooter-reset == true) {
85
+ .scooter-css {
86
+ @include scooter-type;
87
+ }
88
+ } @else {
89
+ @include scooter-type;
90
+ }
91
+
@@ -0,0 +1,21 @@
1
+ //-----------------------------
2
+ //
3
+ // Components
4
+ //
5
+ //-----------------------------
6
+
7
+ @import "arrow";
8
+ @import "avatar";
9
+ @import "badge";
10
+ @import "banners";
11
+ @import "buttons";
12
+ @import "calendar";
13
+ @import "cards";
14
+ @import "inputs";
15
+ @import "loading-indicator";
16
+ @import "modal";
17
+ @import "tab-nav";
18
+ @import "tables";
19
+ @import "title-bubble";
20
+ @import "tokens";
21
+ @import "typeahead";
@@ -0,0 +1,25 @@
1
+ //-----------------------------
2
+ //
3
+ // Component: Arrow
4
+ //
5
+ //-----------------------------
6
+
7
+ $DBarrow-namespace: "c-arrow";
8
+
9
+ .#{$DBarrow-namespace} {
10
+ &, &--down {
11
+ @include arrow(10px, currentColor, down);
12
+ }
13
+
14
+ &--left {
15
+ @include arrow(10px, currentColor, left);
16
+ }
17
+
18
+ &--right {
19
+ @include arrow(10px, currentColor, right);
20
+ }
21
+
22
+ &--up {
23
+ @include arrow(10px, currentColor, up);
24
+ }
25
+ }
@@ -0,0 +1,191 @@
1
+ //-----------------------------
2
+ //
3
+ // Avatars
4
+ //
5
+ //-----------------------------
6
+
7
+ $DBavatar-namespace: "c-avatar" !default;
8
+ $DBavatar-container-namespace: "c-facepile" !default;
9
+ // Ideally, colors are set by JS, but this provides a fallback
10
+ $DBavatar-color: color(blue) !default;
11
+
12
+ // Map for the various sizes of avatars
13
+ // This will help automate generation of classes for different avatar sizes
14
+ $DBavatar-sizes: (
15
+ xs: 16px,
16
+ s: 24px,
17
+ m: 32px,
18
+ l: 48px,
19
+ xl: 64px
20
+ ) !default;
21
+
22
+ // @private mixin avatarSize
23
+ // Set proportional font size, weight, and line-height for avatars without photos
24
+ @mixin __avatarSize($s: 32px) {
25
+ width: $s;
26
+ // min-width provides a fallback for flexible-width elements like c-avatar--meta
27
+ min-width: $s;
28
+ height: $s;
29
+
30
+ font-size: round($s * 0.4);
31
+
32
+ @if($s < 32px) {
33
+ font-weight: 700;
34
+ } @else if($s >= 48px) {
35
+ font-weight: 400;
36
+ } @else {
37
+ font-weight: 600;
38
+ }
39
+ }
40
+
41
+ /**
42
+ * Avatar component. A wrapper element with an (optional) image or the user's
43
+ * initials.
44
+ */
45
+ .#{$DBavatar-namespace} {
46
+ // Default size for avatars without explicit sizing
47
+ @include __avatarSize(32px);
48
+
49
+ display: inline-block;
50
+ vertical-align: middle;
51
+ overflow: hidden;
52
+ position: relative;
53
+ box-sizing: border-box;
54
+
55
+ text-align: center;
56
+ line-height: 2.5;
57
+
58
+ border-radius: 1000px;
59
+
60
+ &__img,
61
+ > img {
62
+ display: block;
63
+ min-width: 100%;
64
+ height: 100%;
65
+ // Keep proportions in tact even if the container is the wrong size
66
+ object-fit: cover;
67
+ }
68
+
69
+ // Give avatars a subtle little border
70
+ &:after {
71
+ content: "";
72
+ position: absolute;
73
+ top: 0;
74
+ right: 0;
75
+ bottom: 0;
76
+ left: 0;
77
+
78
+ border-radius: 1000px;
79
+ box-shadow: inset 0 0 0 1px color(gray, x-dark, 0.1);
80
+
81
+ pointer-events: none;
82
+ }
83
+
84
+ &#{&}--no-img {
85
+ // Default color for avatars without images
86
+ color: color(white);
87
+ background-color: $DBavatar-color;
88
+
89
+ &:after {
90
+ content: attr(data-initials);
91
+
92
+ box-shadow: none;
93
+ }
94
+
95
+ &.#{$DBavatar-namespace}--xs:after {
96
+ content: "";
97
+ }
98
+ }
99
+
100
+ &#{&}--square {
101
+ text-transform: uppercase;
102
+
103
+ border-radius: 3px;
104
+
105
+ &:after {
106
+ // Prevent the shadow pseudo-element from rendering
107
+ content: none;
108
+ }
109
+ }
110
+
111
+ &#{&}--meta {
112
+ display: inline-flex;
113
+ align-items: center;
114
+ justify-content: center;
115
+ flex: 0 0 auto;
116
+
117
+ width: auto;
118
+ padding: 0 2px;
119
+
120
+ color: color(gray, medium);
121
+ background-color: color(gray, light, 0.7);
122
+
123
+ > img {
124
+ display: inline-block;
125
+ vertical-align: middle;
126
+ width: auto;
127
+ height: auto;
128
+ object-fit: none;
129
+ margin: 0 auto;
130
+ }
131
+
132
+ > span {
133
+ // Safari has some trouble properly aligning elements in the avatar
134
+ // without explicit margins or widths
135
+ margin: auto;
136
+ }
137
+
138
+ &:after {
139
+ // Prevent the shadow pseudo-element from rendering
140
+ content: none;
141
+ }
142
+ }
143
+
144
+ // Loop through all the avatar sizes to generate selectors
145
+ @each $key, $size in $DBavatar-sizes {
146
+ // This is output to `.#{DBavatar-ns}--size`
147
+ &--#{$key} {
148
+ @include __avatarSize($size);
149
+
150
+ @if $key == "xs" {
151
+ // Extra small avatars get no initials
152
+ &:after {
153
+ content: "";
154
+ }
155
+ }
156
+ }
157
+ } // end @each
158
+ } // end .avatar
159
+
160
+ .#{$DBavatar-container-namespace} {
161
+ display: flex;
162
+ align-items: center;
163
+
164
+ > * {
165
+ margin-right: quarter($DBbaseline);
166
+ }
167
+
168
+ &.is-animated .#{$DBavatar-namespace} {
169
+ animation: DBavatar-animation .3s;
170
+ animation-timing-function: cubic-bezier(.57,.23,.39,1.6);
171
+ animation-fill-mode: both;
172
+
173
+ @for $i from 1 through 15 {
174
+ &:nth-child(#{$i}) {
175
+ animation-delay: #{$i*.025}s;
176
+ }
177
+ }
178
+ }
179
+ }
180
+
181
+ @keyframes DBavatar-animation {
182
+ from {
183
+ opacity: 0;
184
+ transform: translateX(10px);
185
+ }
186
+
187
+ to {
188
+ opacity: 1;
189
+ transform: translateX(0);
190
+ }
191
+ }